
Designing a Mine Detection Robot with Arduino: Hardware, Software, and Communication Infrastructure
Selçuk DİKİCİ
Anadolu University Faculty of Business Administration
Anadolu University Department of Jurisprudence and Justice
Istanbul University Industrial Engineering
Abant İzzet Baysal University Industrial Electronics
Özet: Bu çalışmada, Arduino tabanlı bir mayın arama robotu tasarımı ve geliştirilmesi ele alınmaktadır. Proje kapsamında metal dedektörü, GPS modülü, ultrasonik sensörler, motor sürücüleri ve RF iletişim sistemleri kullanılarak bir robot tasarlanmıştır. Robot, mayınları algılayarak verileri şifreli bir şekilde iletebilmekte ve haritalama yazılımı yardımıyla bu veriler görselleştirilebilmektedir. Makalede, projenin donanım ve yazılım bileşenleri ile GPS verilerinin şifrelenip iletilmesi ve bu verilerin web servisleri aracılığıyla veri tabanına aktarılması süreçleri incelenmiştir.
Giriş: Mayın tarama, tehlikeli ve zaman alıcı bir süreç olduğundan, bu görevi otomatikleştirecek sistemlerin geliştirilmesi hayati önem taşımaktadır. Bu makalede, Arduino tabanlı bir mayın arama robotu projesi ele alınmıştır. Robot, metal dedektörü yardımıyla mayınları tespit ederken, ultrasonik sensörlerle engellerden kaçınmaktadır. Ayrıca GPS koordinatlarını toplayıp, RF modülleri aracılığıyla şifreli bir şekilde iletişim sağlamaktadır.
Malzemeler:
- Arduino Kartı: Projede, robotun kontrolü için Arduino Mega kullanılmıştır.
- DC Motorlar ve Motor Sürücü Modülü (L298N): Robotun hareket etmesini sağlayan temel bileşenlerdir.
- Metal Dedektörü Sensörü: Mayınların tespiti için kullanılır.
- Ultrasonik Sensör (HC-SR04): Robotun engelleri algılaması için kullanılır.
- GPS Modülü (NEO-6M): Robotun coğrafi konumunu belirler.
- RF Modülü (LoRa veya RF433): Robot ile alıcı arasında uzun mesafeli iletişim sağlar.
- AES Kripto Modülü: Verilerin şifrelenerek güvenli bir şekilde iletilmesi için kullanılır.
Sistem Tasarımı ve Donanım Entegrasyonu:
Robotun temel işlevselliği metal dedektörü ve ultrasonik sensörlerle sağlanmıştır. Metal dedektörü, Arduino’nun analog pinlerine bağlanarak sürekli veri toplar. Robot, bir metal tespit ettiğinde durur ve bir alarm devreye girer. Ultrasonik sensörler ise engelleri algılayarak robotun yön değiştirmesini sağlar.
GPS Verilerinin Toplanması:
Robotun bulunduğu konum, NEO-6M GPS modülü ile sürekli olarak takip edilir. Bu veriler Arduino üzerinden işlenir ve RF modülleri aracılığıyla alıcıya şifrelenmiş olarak gönderilir. AES-128 şifreleme algoritması kullanılarak güvenli veri iletimi sağlanmıştır.
Yazılım Altyapısı ve Veri İletişimi:
Robotun yazılım altyapısı, Arduino IDE kullanılarak geliştirilmiştir. Robotun hareket, engelden kaçma ve veri toplama işlemleri için aşağıdaki algoritmalar kullanılmıştır:
- Metal Tespiti: Metal dedektöründen gelen sinyal, belirli bir eşik değeri ile karşılaştırılır ve eşik aşılırsa robot durur ve alarm çalar.
- Engelden Kaçınma: Ultrasonik sensörlerden alınan mesafe verileri, engel algılandığında robotun yönünü değiştirmek için kullanılır.
- GPS Verisi ve Şifreleme: GPS verileri toplandıktan sonra AES-128 şifreleme algoritması kullanılarak şifrelenir ve RF modülü ile gönderilir.
Arduino Kodu:
cpp
Kodu kopyala
#include <SPI.h>
#include <Wire.h>
#include <Servo.h>
#include <AESLib.h> // AES şifreleme kütüphanesi
#include <TinyGPS++.h> // GPS verileri için kütüphane
// Donanım pin tanımları
#define metalDetectorPin A0
#define echoPin 9
#define trigPin 10
#define motorPin1 6
#define motorPin2 7
// AES şifreleme için anahtar
byte aes_key[] = { 0x1A, 0xC3, 0x7F, 0x29, 0x5B, 0x6C, 0xD4, 0x9A, 0x7E, 0xF1, 0x8B, 0x2D, 0x4E, 0xA3, 0x6C, 0x5D };
TinyGPSPlus gps; // GPS nesnesi oluştur
Servo motor1, motor2; // Motor kontrolü için
void setup() {
Serial.begin(9600);
motor1.attach(motorPin1);
motor2.attach(motorPin2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(metalDetectorPin, INPUT);
}
void loop() {
// Metal tespiti
int metalValue = analogRead(metalDetectorPin);
if (metalValue > 500) { // Eşik değeri 500
Serial.println(“Metal Tespit Edildi!”);
dur();
alarmCal();
gpsVeriGonder(); // Metal tespit edildiğinde GPS verilerini gönder
}
// Engelden kaçma
float mesafe = mesafeOlc();
if (mesafe < 20) { // 20 cm’den yakın engel tespit edilirse
engeldenKacin();
}
// GPS verilerini okuma
while (Serial.available() > 0) {
gps.encode(Serial.read());
}
}
void dur() {
motor1.write(90); // Motorları durdur
motor2.write(90);
}
void alarmCal() {
// Buzzer veya LED alarmı devreye sok
}
float mesafeOlc() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long sure = pulseIn(echoPin, HIGH);
float mesafe = sure * 0.034 / 2; // Mesafeyi cm cinsinden hesapla
return mesafe;
}
void engeldenKacin() {
motor1.write(180); // Motorları ters çalıştır
motor2.write(0);
delay(1000); // Bir saniye geri git
motor1.write(0); // Sağa dön
motor2.write(180);
delay(500);
}
void gpsVeriGonder() {
if (gps.location.isUpdated()) {
float lat = gps.location.lat();
float lng = gps.location.lng();
String veri = String(lat, 6) + “,” + String(lng, 6); // GPS verileri stringe dönüştür
char veriChar[32];
veri.toCharArray(veriChar, 32);
byte encrypted[32];
aes128_encrypt(encrypted, veriChar, aes_key); // Veriyi şifrele
Serial.print(“Şifrelenmiş Veri: “);
for (int i = 0; i < sizeof(encrypted); i++) {
Serial.print(encrypted[i], HEX);
}
Serial.println();
}
}
Veri Toplama ve Haritalama:
Alıcı, RF modülü aracılığıyla gelen şifrelenmiş verileri alır ve AES anahtarı ile bu verileri deşifre eder. Deşifre edilen GPS koordinatları, bir web servisine HTTP POST isteği ile gönderilir ve veri tabanına kaydedilir. Web arayüzü aracılığıyla, bu veriler Google Maps API kullanılarak harita üzerinde görselleştirilir.
Sonuçlar:
Bu çalışma, Arduino tabanlı bir mayın arama robotunun nasıl tasarlanacağını, donanım ve yazılım bileşenlerinin nasıl entegre edileceğini ve veri güvenliğinin nasıl sağlanacağını göstermektedir. Proje, simülasyon ve prototip aşamalarında başarıyla test edilmiştir. Gelecekte, robotun performansını artırmak ve daha karmaşık algoritmalar kullanarak gerçek dünyada kullanım için optimize etmek hedeflenmektedir.
Anahtar Kelimeler: Mayın arama, Arduino, GPS, RF modülü, AES şifreleme, ultrasonik sensör, veri iletimi, haritalama
English Article
Designing a Mine Detection Robot with Arduino: Hardware, Software, and Communication Infrastructure
Abstract: This study focuses on the design and development of an Arduino-based mine detection robot. The robot integrates a metal detector, GPS module, ultrasonic sensors, motor drivers, and RF communication systems. It is capable of detecting mines, encrypting the data, and transmitting it securely. The project also includes the visualization of the collected data through a mapping software. This article explores the hardware and software components of the project, GPS data encryption and transmission, and the process of transferring data to a database via web services.
Introduction: Mine detection is a dangerous and time-consuming task, making the development of automated systems for this purpose essential. This paper presents an Arduino-based mine detection robot project. The robot uses a metal detector to identify mines and ultrasonic sensors to avoid obstacles. Additionally, it collects GPS coordinates and securely transmits the data via RF modules.
Components:
- Arduino Board: Arduino Mega is used for controlling the robot.
- DC Motors and Motor Driver Module (L298N): These components are responsible for the robot’s movement.
- Metal Detector Sensor: Used for mine detection.
- Ultrasonic Sensor (HC-SR04): Helps the robot detect obstacles.
- GPS Module (NEO-6M): Provides the robot’s geographical location.
- RF Module (LoRa or RF433): Enables long-distance communication between the robot and receiver.
- AES Crypto Module: Ensures the secure transmission of data through encryption.
System Design and Hardware Integration:
The robot’s core functionality is achieved using a metal detector and ultrasonic sensors. The metal detector is connected to the Arduino’s analog pins and continuously collects data. When metal is detected, the robot stops, and an alarm is triggered. The ultrasonic sensors detect obstacles and guide the robot to change direction.
GPS Data Collection:
The robot’s location is continuously monitored using the NEO-6M GPS module. This data is processed through Arduino and sent to the receiver in an encrypted format via RF modules. AES-128 encryption is employed to ensure secure data transmission.
Software Infrastructure and Data Communication:
The robot’s software infrastructure was developed using Arduino IDE. The main algorithms controlling the robot’s movement, obstacle avoidance, and data collection include:
- Metal Detection: The signal from the metal detector is compared to a threshold value. If the threshold is exceeded, the robot stops, and an alarm sounds.
- Obstacle Avoidance: The distance data from the ultrasonic sensors guide the robot to change direction if an obstacle is detected.
- GPS Data and Encryption: GPS data is collected and encrypted using the AES-128 algorithm before being transmitted via the RF module.
Arduino Code:
cpp
Kodu kopyala
#include <SPI.h>
#include <Wire.h>
#include <Servo.h>
#include <AESLib.h>
#include <TinyGPS++.h>
#define metalDetectorPin A0
#define echoPin 9
#define trigPin 10
#define motorPin1 6
#define motorPin2 7
byte aes_key[] = { 0x1A, 0xC3, 0x7F, 0x29, 0x5B, 0x6C, 0xD4, 0x9A, 0x7E, 0xF1, 0x8B, 0x2D, 0x4E, 0xA3, 0x6C, 0x5D };
TinyGPSPlus gps;
Servo motor1, motor2;
void setup() {
Serial.begin(9600);
motor1.attach(motorPin1);
motor2.attach(motorPin2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(metalDetectorPin, INPUT);
}
void loop() {
int metalValue = analogRead(metalDetectorPin);
if (metalValue > 500) {
Serial.println(“Metal Detected!”);
stopRobot();
triggerAlarm();
sendGpsData();
}
float distance = measureDistance();
if (distance < 20) {
avoidObstacle();
}
while (Serial.available() > 0) {
gps.encode(Serial.read());
}
}
void stopRobot() {
motor1.write(90);
motor2.write(90);
}
void triggerAlarm() {
}
float measureDistance() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long duration = pulseIn(echoPin, HIGH);
float distance = duration * 0.034 / 2;
return distance;
}
void avoidObstacle() {
motor1.write(180);
motor2.write(0);
delay(1000);
motor1.write(0);
motor2.write(180);
delay(500);
}
void sendGpsData() {
if (gps.location.isUpdated()) {
float lat = gps.location.lat();
float lng = gps.location.lng();
String data = String(lat, 6) + “,” + String(lng, 6);
char dataChar[32];
data.toCharArray(dataChar, 32);
byte encrypted[32];
aes128_encrypt(encrypted, dataChar, aes_key);
Serial.print(“Encrypted Data: “);
for (int i = 0; i < sizeof(encrypted); i++) {
Serial.print(encrypted[i], HEX);
}
Serial.println();
}
}
Data Collection and Mapping:
The receiver decrypts the data received via the RF module using an AES key. The decrypted GPS coordinates are sent to a web service via an HTTP POST request and stored in a database. These coordinates are visualized on a map using Google Maps API through a web interface.
Conclusion:
This study demonstrates how to design an Arduino-based mine detection robot, how to integrate the hardware and software components, and how to ensure data security. The project has been successfully tested in simulation and prototyping phases. Future work aims to enhance the robot’s performance and optimize it for real-world use with more complex algorithms.
Keywords: Mine detection, Arduino, GPS, RF module, AES encryption, ultrasonic sensor, data transmission, mapping