A 180ยฐ ultrasonic radar system built using Arduino, HC-SR04 ultrasonic sensor, SG90 servo motor, and buzzer, with a real-time radar visualization developed using Processing 4.
The ultrasonic sensor continuously sweeps from 0ยฐ to 180ยฐ using the servo motor and measures the distance of detected objects. The measured angle and distance are transmitted from Arduino to Processing through serial communication and displayed on a graphical radar interface.
When an object is detected within the 30 cm alert range, the target is highlighted in red and the buzzer is activated.
- ๐ก 180ยฐ Radar Scanning
- ๐ Ultrasonic Distance Measurement
- ๐ Servo-Controlled Sensor Sweeping
- ๐ป Real-Time Processing 4 Visualization
- ๐ฏ Object Detection
- ๐จ 30 cm Proximity Alert
- ๐ด Red Target Indication for Nearby Objects
- ๐ Buzzer Alert
- ๐ Real-Time Angle and Distance Data
- ๐ฅ๏ธ Arduino-to-Processing Serial Communication
- ๐งช Proteus Simulation
| Component | Quantity | Purpose |
|---|---|---|
| Arduino UNO / Nano / Mega | 1 | Main controller |
| HC-SR04 Ultrasonic Sensor | 1 | Distance measurement |
| SG90 Micro Servo Motor | 1 | 180ยฐ sensor movement |
| Buzzer | 1 | Proximity alert |
| Breadboard | 1 | Circuit prototyping |
| Jumper Wires | As required | Connections |
| USB Cable | 1 | Arduino programming and serial communication |
| Component | Arduino Pin |
|---|---|
| Servo Signal | D9 |
| HC-SR04 Trig | D10 |
| HC-SR04 Echo | D11 |
| Buzzer (+) | D12 |
| VCC | 5V |
| GND | GND |
The system works in the following sequence:
- The SG90 servo motor rotates the HC-SR04 ultrasonic sensor from 0ยฐ to 180ยฐ.
- At each angle, the HC-SR04 sends an ultrasonic pulse.
- The sensor receives the reflected echo from nearby objects.
- Arduino calculates the distance using the echo time.
- Arduino sends the angle and distance values to the computer through serial communication.
- Processing 4 receives the serial data.
- Processing converts the data into a real-time radar visualization.
- If an object is detected within 30 cm, the radar target changes to red.
- The buzzer produces an alert tone when the object enters the alert range.
- The servo continues sweeping, providing continuous 180ยฐ scanning.
The HC-SR04 measures distance based on the time taken by the ultrasonic pulse to travel to the object and return.
The distance is calculated using:
Distance = (Echo Time ร Speed of Sound) / 2
The division by 2 is required because the ultrasonic wave travels to the object and then returns to the sensor.
The system uses a 30 cm threshold for object detection alerts.
| Distance | Radar Display | Buzzer |
|---|---|---|
| > 30 cm | Normal target | OFF |
| โค 30 cm | ๐ด Red target | ON |
| > 400 cm | Out of range | OFF |
Readings beyond approximately 400 cm are treated as out-of-range to keep the radar visualization clean.
Used to program the Arduino and control:
- HC-SR04 ultrasonic sensor
- SG90 servo motor
- Buzzer
- Serial communication
Used to create the graphical radar interface and visualize:
- Radar sweep
- Detected object position
- Object distance
- Detection angle
- Proximity warning
Used for circuit simulation and testing of the project.
The project uses the Arduino:
Servo
The Servo library is commonly included with the Arduino IDE.
The Processing sketch requires:
Serial
To install it:
Sketch โ Import Library โ Manage Libraries
Search for Serial and install the required library.
Open:
Code's/Arduino_Radar.ino
in the Arduino IDE.
Select your Arduino board and the correct COM port, then upload the program.
Connect the components according to the wiring table.
Make sure:
- HC-SR04 VCC is connected to 5V.
- HC-SR04 GND is connected to GND.
- Servo signal is connected to D9.
- HC-SR04 Trig is connected to D10.
- HC-SR04 Echo is connected to D11.
- Buzzer is connected to D12.
Open:
Code's/Radar_Visualization.pde
Locate the serial port configuration in the Processing code.
For example:
final String PORT_NAME = "COM3";Change COM3 to the COM port assigned to your Arduino.
For example:
final String PORT_NAME = "COM5";After uploading the Arduino code:
- Keep the Arduino connected to the computer.
- Close the Arduino Serial Monitor if it is open.
- Open the Processing sketch.
- Select Run in Processing.
- The radar visualization will start.
- Move an object in front of the ultrasonic sensor to test detection.
The Proteus simulation files are available in:
Proteus/
Proteus/Radar_project.pdsprj
Note: The Proteus simulation is provided for circuit testing and demonstration. The Processing radar visualization operates through serial communication with the Arduino.
Ultrasonic-Radar-System-using-Arduino/
โ
โโโ Code's/
โ โโโ Arduino_Radar.ino
โ โโโ Radar_Visualization.pde
โ
โโโ Hardware-&-Image's/
โ โโโ Final-Project.png
โ โโโ Project-IMG.jpg
โ โโโ Radar-Detects.jpg
โ โโโ Radar-View.jpg
โ โโโ Simulation-IMG.png
โ
โโโ Proteus/
โ โโโ Radar-View.jpg
โ โโโ Radar_project.pdsprj
โ โโโ Simulation-IMG.png
โ
โโโ README.md
- Arduino
- HC-SR04 Ultrasonic Sensor
- SG90 Servo Motor
- Processing 4
- Proteus
- Serial Communication
- Embedded C / Arduino C++
This project can be used as a basic platform for:
- ๐ค Robotics
- ๐ Autonomous vehicles
- ๐ก๏ธ Object detection systems
- ๐ก Distance measurement
- ๐ Security systems
- ๐งช Embedded systems experiments
- ๐ Electronics and engineering education
- ๐ฌ Sensor-based automation projects
Possible improvements for the next version include:
- ๐ฑ Wireless radar monitoring using ESP32
- ๐ถ Wi-Fi-based data transmission
- ๐ Improved radar graphics
- ๐ Variable alert frequency based on distance
- ๐ฏ Multiple-object tracking
- ๐พ Data logging
- ๐ Distance history and graphs
- ๐ฅ๏ธ Web-based radar dashboard
- ๐ Automatic scanning optimization
Imandi Lakshmi Pavan Kalyan Imandi
Electronics & Communication Engineering
GitHub: Pavan Kalyan Imandi
LinkedIn: Lakshmi Pavan Kalyan Imandi
If you found this project useful or interesting, consider giving the repository a โญ Star on GitHub.
Feel free to explore the source code, Proteus simulation, hardware images, and Processing visualization.






