Arduino Radar System
In this tutorial, I'll walk you through step by step how to assemble the components on a breadboard and how to program the Arduino board. We'll use the Arduino IDE to write the code that controls the servo motor and the ultrasonic sensor. By the end of this tutorial, you'll have a fully functional radar system that can detect objects and display their distance on the serial monitor.
Supplies
Here are the material you're going to need to make it: (click the words to find the link to where it can be bought)
1. Arduino UNO ($27.60)
2. 1 Servo Motor ($13.99)
3. 1 Breadboard ($7.65)
4. Ultrasonic Sensor ($13.99)
5. Jumper Wires ($9.99)
6. Some sort of device that that physically display the radar (price varies)
Glue It Down!
Glue down all the parts required for the breadboard:
- Stick the ultrasonic sensor to the servo motor. I advise this to be done with hot glue as it looks much cleaner rather than using something like tape.
- Now place that sensor/motor object to the breadboard, it doesn't matter which side the object is placed as the motor spins 360 degrees.
- Attach the Arduino UNO board on the breadboard. I would suggest not using hot glue for this as Arduino UNO's can be used for many purposes. Make sure the side with the port is place on the outside of the breadboard as suggested in the image.
Connections
Now connect all the wires using the diagram above:
Breadboard Connections:
Red Wire: Connect the VIN pin on the Arduino to the positive rail on the breadboard.
Black Wire: Connect the GND pin on the Arduino to the negative rail (ground) on the breadboard.
Servo Connections:
Blue Wire: Connect pin 12 on the Arduino to the orange wire (signal) of the servo.
Red Wire: Connect the positive rail (5V) on the breadboard to the red wire (power) of the servo.
Black Wire: Connect the negative rail (ground) on the breadboard to the brown wire (ground) of the servo.
Ultrasonic Sensor Connections:
Red Wire: Connect the VCC pin on the ultrasonic sensor to the positive rail (5V) on the breadboard.
Black Wire: Connect the GND pin on the ultrasonic sensor to the negative rail (ground) on the breadboard.
Purple Wire: Connect the Trig pin on the ultrasonic sensor to pin 11 on the Arduino.
Grey Wire: Connect the Echo pin on the ultrasonic sensor to pin 10 on the Arduino.
Arduino Code!
For this step you will required to download Arduino IDE. Click this to be redirected to the download page and instructions . Below is the code that will be run the Arduino. Open the application and paste the code in below:
Go to the select port menu and select Arduino UNO.
Make sure you are aware of what port you're using (ex. COM2, COM3, COM4)
Verify the code just in case their is something wrong on your end.
Processing Code
For this next step you will need to download this processing software (Click this to be redirected to a page to download the software)
Using the code below you will have a visual representation of your radar's movement and what it detects.
Around the line 15-19 code, change the COM port to the one you connected to your device.
Now you can start the Arduino IDE and processing software and it should start working!
Make It Look Cool!
Present your radar in a cool way! I made a tank, I used cardboard, tape, and a hot glue gun. The hole in the back is for the cable to run to the device.