Mine Detector - shalan/CSCE4301-WiKi GitHub Wiki
Mine Detector
Project Repo URL: https://github.com/FA1-cyber/Embedded-Project-2
Project Description:
The aim of this project is to use a robot that would traverse a field and while traversing it would detect if there are any mines in that field in the range of 40 cm. After detecting the existence of a mine, it will send the current location to a mobile phone; thus marking that location as unsafe. Afterwards, it would continue traversing the rest of the field until it is done. This mine detector can be utilized in areas where lots of mines were planted during a time of war, but were never taken out until our day.
How it works:
We will be using the LOOMO Robot in order to traverse the field. We will have a metal detector sensor mounted on a wooden rod. When the metal detector senses a metal, it will send a signal to the microcontroller. The Microcontroller will then get the current location from the GPS module and send it to the designated mobile phone using a Bluetooth module. The motion of the LOOMO robot is controlled via voice commands. The user can either control the LOOMO by saying the motion commands out-loud, or if the user is far away, they can simply connect to the speaker mounted on the LOOMO and play the desired command.
Software Requirements:
- CubeMX
- Keil uVision
- Android Application called Serial Bluetooth Terminal
- Android Studio
Hardware Requirements:
- Microcontroller (STM32L432KCU6)
- Metal Detector sensor: Works by a magnetic field being created around the coil. Whenever the magnetic field is interrupted by a metal, a signal is sent back indicating a metal is detected.
- GPS Module (RXM-SG GPS Module w/Ext Antenna (#28505): Uses the external antenna to acquire and lock 3 or more satellites to provide the current position.
- Speaker
- Wires
- Breadboard
- Android mobile phones
- Bluetooth module (UART to Bluetooth Bridge): Used to send the coordinates of of the metal detected to the mobile phone by the use of an application (Serial Bluetooth Terminal) which connects the mobile phone to the module. We used the HM-10 module in our implementation.
- 12V battery for the metal detector sensor
- Power bank for the STM and all components connected to it
Initial Design (1st prototype):
For the first prototype, we were not able to operate the LOOMO Robot in order to traverse the field, however, we hope to operate it by the time of the final submission. Our implementation for this prototype has a metal detector sensor connected to a 12 V battery. A signal is taken from this sensor ( 1 or 0) indicating the presence of a metal or not and it is connected to a GPIO Input Pin on the STM32 microcontroller. When the metal detector senses a metal, a buzzer is triggered and a signal to the microcontroller. Based on this signal, the Microcontroller will then get the current location from the GPS module and its antenna which uses 3 or more satellites to acquire the location and sends it to the designated mobile phone using a Bluetooth module. We downloaded an Android application called Serial Bluetooth Terminal in order to be able to see the location on the phone. This is done by connecting the GPS module to UART1 in order to receive the location and UART2 to transmit the location to the mobile phone.
Final Design:
The STM configurations and keil code that were implemented in the prototype were not changed, as they implemented the required functionality fully. However, in order to control the motion of the LOOMO we needed to code it using Android Studio. Our LOOMO’s motion is controlled remotely via voice command. We mounted a speaker on it and we connect to that speaker via Bluetooth from a mobile phone and play the command we want it to execute. The LOOMO recognizes the command as it detects it from the speaker and executes it. The commands that we have implanted are: “move forward”, “turn right/left” (turn in that direction and move forward), “rotate right/left” (rotate in that direction, but stay in place) and “move backward” (turn around a 180 degree and move forward). In addition, for the safety of the LOOMO and to prevent the metal detector from detecting the LOOMO by mistake, we mounted a piece of wood on the LOOMO and the metal detector coil is laid at the end of it. That way the system would detect a mine before it gets close to it and prevents its explosion.
CubeMX Configurations:
USART1_RX and USART1_TX are used for receiving the coordinates from the GPS module. USART2_RX and USART2_TX are used to transmit the coordinates to the mobile phone using the Bluetooth module. GPIO_Input is used to get a value from the metal sensor to check whether a metal is detected or not (1 - metal detected, 0 - no metal). RCC set to Crystal/Ceramic Resonator. SYS set to Serial Wire. Picture of the configuration: https://drive.google.com/file/d/1steU1Vv7ZO_chwA7Wr9h4wtD2ooD69ww/view?usp=sharing
Technical challenges and how we overcame them
GPS Module
We initially planned on using the Ublox NEO-6m GPS Module, however, after several testings and trials, we found out that the GPS module that we bought was defective so we had to get another GPS module from the lab.
Metal sensor power source
Our metal sensor works best when it's connected to a power source that's between 9 V and 12V and we could not find a single power source that gives such voltage (even though there are 9V batteries but we found out after testing that the sensor works best at 12V). Thus, we welded together a 9V battery and two 1.5V batteries in series.
LOOMO
Finally, in the beginning we had trouble connecting and controlling the LOOMO via the application. We overcame that by writing an application ourselves on Android Studio and deploying that application on LOOMO. The application we coded helps us control the motion of the LOOMO via voice command.
Testing Limitations:
Due to metal being present under the ground (wires and pipes), we decreased the sensitivity of the metal sensor to ensure that the metal beneath the ground is not detected, we then used the Dagu Thumper as our test because it had a relatively high height and could be detected by the metal sensor.
Possible Upgrades:
There are ways to improve on our project, but we could not implement them due to the time and resource constraints. For example, having a coil that is as wide as the LOOMO itself in order to make sure that the LOOMO is 100% protected.
Movements Videos
- Turn right - https://drive.google.com/file/d/1W2_RBnowDraVUuo_kMOm6Im5I44izvwx/view?usp=sharing
- Turn left - https://drive.google.com/file/d/14iigBAR1Nj-Te9kTv2J0pOi7sxcEhbgR/view?usp=sharing
- Rotate right - https://drive.google.com/file/d/1FxGMbgXL0ho11lGCZSjVIDJr8LH19sdL/view?usp=sharing
- Rotate left - https://drive.google.com/file/d/1hNYP1SQBnjIi220o4clTr9xjdbDt0KNj/view?usp=sharing
- Move forward - https://drive.google.com/file/d/1YFiWCr5phwQz5p2tpYYSIWH4Z9vQtLZO/view?usp=sharing
- Move backward - https://drive.google.com/file/d/1Xh3Wd-DoaV2J2f__3bloo1kLKwXfi4m6/view?usp=sharing
Block Diagram:
https://drive.google.com/file/d/1L8RX38MQEqVZyCdHmSMh2jF81ZyUehWg/view?usp=sharing
Project Prototype Video:
https://drive.google.com/file/d/1qWX9UHMXGOloJEWX9RHMugyQMy2w_mY2/view?resourcekey
Final Demo Video
https://drive.google.com/file/d/1unqwvTUAAfQ9kOfLiNdyAANT1dk96CVH/view?usp=sharing