A SONAR system using Arduino
This project aims to create a SONAR mapping device which uses an ultrasonic distance sensor to map the surroundings of the device in a semicircular region in-front of the device. It can also be used as an obstacle detection device, which have many more applications such as in self-driving cars.
- Arduino Uno
- HC-SR04 (Ultrasonic Distance Sensor Module)
- SG-90 Micro Servo Motor
- Jump Wires
- Pin 5 on the Arduino Uno is connected to Trig (TRIGGER) Pin of the HC-SR04
- Pin 6 on the Arduino Uno is connected to Echo (ECHO) Pin of the HC-SR04
- Pin 9 on the Arduino Uno is connected to Data Pin of the SG-90 Servo
The HC-SR04 is mounted on top of the SG-90 as shown in the image. The servo rotates and with each rotation, the HC-SR04 calcuates the distance from the sensor to the wall/obstacle. It then calculates the angle between 2 distance measurements and provides the data via the serial monitor.
Some basic math was used to get the co-ordinates of points around the device. All co-ordinates were plotted using PROCESSING in real time. The map refreshes itself after it completes one full semicircle, to and forth.
A 2-Dimensional Map of the surroundings of the device is obtained.