Skip to content

About

A 180-degree sonar radar system using Arduino, an HC-SR04 sensor, and a Processing 4 visualizer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Ultrasonic Radar System using Arduino ๐Ÿ“ก

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.


๐ŸŽฅ Demo Video

โ–ถ๏ธ Watch the Ultrasonic Radar System Demo


๐Ÿ“ธ Project Images

๐Ÿ”ง Final Project

Final Project

๐Ÿ› ๏ธ Project Hardware

Project Hardware

๐ŸŽฏ Radar Object Detection

Radar Object Detection

๐Ÿ“ก Radar Visualization

Radar View

๐Ÿ’ป Proteus Simulation

Proteus Simulation


โœจ Features

  • ๐Ÿ“ก 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

๐Ÿงฐ Hardware Required

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

๐Ÿ”Œ Wiring Guide

Component Arduino Pin
Servo Signal D9
HC-SR04 Trig D10
HC-SR04 Echo D11
Buzzer (+) D12
VCC 5V
GND GND

โš™๏ธ Working Principle

The system works in the following sequence:

  1. The SG90 servo motor rotates the HC-SR04 ultrasonic sensor from 0ยฐ to 180ยฐ.
  2. At each angle, the HC-SR04 sends an ultrasonic pulse.
  3. The sensor receives the reflected echo from nearby objects.
  4. Arduino calculates the distance using the echo time.
  5. Arduino sends the angle and distance values to the computer through serial communication.
  6. Processing 4 receives the serial data.
  7. Processing converts the data into a real-time radar visualization.
  8. If an object is detected within 30 cm, the radar target changes to red.
  9. The buzzer produces an alert tone when the object enters the alert range.
  10. The servo continues sweeping, providing continuous 180ยฐ scanning.

๐Ÿ“ Distance Calculation

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.


๐Ÿšจ Proximity Alert

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.


๐Ÿ’ป Software Used

Arduino IDE

Used to program the Arduino and control:

  • HC-SR04 ultrasonic sensor
  • SG90 servo motor
  • Buzzer
  • Serial communication

Processing 4

Used to create the graphical radar interface and visualize:

  • Radar sweep
  • Detected object position
  • Object distance
  • Detection angle
  • Proximity warning

Proteus

Used for circuit simulation and testing of the project.


๐Ÿ“ฆ Required Libraries

Arduino

The project uses the Arduino:

Servo

The Servo library is commonly included with the Arduino IDE.

Processing

The Processing sketch requires:

Serial

To install it:

Sketch โ†’ Import Library โ†’ Manage Libraries

Search for Serial and install the required library.


๐Ÿš€ How to Run the Project

1. Upload Arduino Code

Open:

Code's/Arduino_Radar.ino

in the Arduino IDE.

Select your Arduino board and the correct COM port, then upload the program.


2. Connect the Hardware

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.

3. Configure Processing

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";

4. Run Processing

After uploading the Arduino code:

  1. Keep the Arduino connected to the computer.
  2. Close the Arduino Serial Monitor if it is open.
  3. Open the Processing sketch.
  4. Select Run in Processing.
  5. The radar visualization will start.
  6. Move an object in front of the ultrasonic sensor to test detection.

๐Ÿงช Proteus Simulation

The Proteus simulation files are available in:

Proteus/

Proteus Project

Proteus/Radar_project.pdsprj

Simulation Images

Proteus Radar View

Proteus Simulation

Note: The Proteus simulation is provided for circuit testing and demonstration. The Processing radar visualization operates through serial communication with the Arduino.


๐Ÿ“ Repository Structure

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

๐Ÿ› ๏ธ Technologies Used

  • Arduino
  • HC-SR04 Ultrasonic Sensor
  • SG90 Servo Motor
  • Processing 4
  • Proteus
  • Serial Communication
  • Embedded C / Arduino C++

๐ŸŽฏ Applications

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

๐Ÿ”ฎ Future Improvements

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

๐Ÿ‘จโ€๐Ÿ’ป Author

Imandi Lakshmi Pavan Kalyan Imandi

Electronics & Communication Engineering

GitHub: Pavan Kalyan Imandi

LinkedIn: Lakshmi Pavan Kalyan Imandi


โญ Support

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.

About

A 180-degree sonar radar system using Arduino, an HC-SR04 sensor, and a Processing 4 visualizer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages