DIY ADVANCE PROJECT NO.03 (RADAR EXPLORER)

RADAR EXPLORER
BUILD • CODE • DETECT
Radar System using Ultrasonic Sensor & OLED Display!

1. What Is Radar?

RADAR stands for Radio Detection and Ranging. It’s a technology that detects the presence, distance, and sometimes speed of objects by sending out a signal (traditionally radio waves) and measuring how long it takes for that signal to bounce off an object and return.

The basic principle is simple:

  1. A signal is sent out from a transmitter.
  2. The signal travels outward until it hits an object.
  3. Some of the signal reflects (bounces back) toward the source.
  4. A receiver picks up the reflected signal.
  5. Since the speed of the signal is known, the time delay tells you the distance to the object.

This project uses the same core principle, but with ultrasonic sound waves instead of radio waves — technically this makes it a SONAR-style system (Sound Navigation And Ranging), though it mimics a radar’s sweeping display and behaviour. The physics of “send a wave, time the echo, calculate distance” is identical.

2. What This Project Does?

This is an Arduino-based radar system. An ultrasonic sensor mounted on a servo motor sweeps back and forth like a real radar, measuring the distance to nearby objects. The results are shown live on an OLED screen as a radar-style display, while LEDs and a buzzer warn you when something gets too close.

3. Components Required

Component Quantity Purpose
Arduino (Uno or similar) 1 Main controller / brain
HC-SR04 Ultrasonic Sensor 1 Measures distance using sound waves
SG90 Servo Motor 1 Rotates the sensor to scan side to side
SSD1306 OLED Display (0.96″, I²C) 1 Shows the radar screen
Green LED 1 Indicates “Safe” zone
Yellow LED 1 Indicates “Warning” zone
Red LED 1 Indicates “Danger” zone
Buzzer 1 Beeps as warning, faster when closer
3.7V Li-ion Battery 2 Powers the circuit
Jumper wires & breadboard As needed Connections

Component Images

Arduino Uno or similar

Arduino

HC-SR04 Ultrasonic Sensor

HC-SR04 Ultrasonic Sensor

SG90 Servo Motor

SG90 Servo Motor

SSD1306 OLED Display (0.96 inch, I2C)

SSD1306 OLED Display

Green LED

Green LED

Yellow LED

Yellow LED

Red LED

Red LED

Buzzer

Buzzer

3.7V Li-ion Battery

3.7V Li-ion Battery

Jumper Wires

Jumper Wires

Breadboard

Breadboard

4. Pin Connections

Ultrasonic Sensor (HC-SR04)

HC-SR04 Pin Arduino Connection
VCC Arduino 5V
GND Arduino GND
Trig Pin 9
Echo Pin 10

Servo Motor

Servo Pin Arduino Connection
Signal (orange) Pin 6
Power (red) 5V
GND (brown) GND

OLED Display (SSD1306, I²C)

OLED Pin Arduino Connection
VCC 5V
GND GND
SDA A4 (Uno)
SCL A5 (Uno)

I²C Address used in code: 0x3C

LEDs

LED Arduino Pin
Green 2
Yellow 3
Red 4

Buzzer

Buzzer Pin Arduino Connection
Positive 5
Negative GND

5. Libraries (Install Before Uploading)

Open Arduino IDE → Sketch → Include Library → Manage Libraries, then search and install:

• Adafruit GFX Library

• Adafruit SSD1306

• Servo (usually pre-installed with Arduino IDE)

6. How to Upload the Code?

  1. Connect the Arduino to your computer using a USB cable.
  2. Open the Arduino IDE.
  3. Go to Tools → Board and select your Arduino model (e.g., “Arduino Uno”).
  4. Go to Tools → Port and select the COM port your Arduino is connected to.
  5. Open the project .ino file in the IDE.
  6. Make sure the required libraries are installed.
  7. Click the Upload button (right arrow icon) or press Ctrl+U.
  8. Wait for “Done uploading” to appear at the bottom of the IDE.
  9. Open Tools → Serial Monitor (set baud rate to 9600) to see live distance readings as a sanity check.

If Upload Fails

• Check the correct board and port are selected.

• Make sure no other program (like Serial Monitor) is holding the port open during upload.

• Try a different USB cable/port if the Arduino isn’t detected.

7. How It Works? — Step by Step

1. Setup: On power-up, the Arduino initializes the OLED, attaches the servo, and shows a “RADAR” start screen for 1.5 seconds.

2. Sweep: The servo moves in 2° steps from 0° to 180° and back, continuously, like a real radar dish.

3. Distance Measurement: At each angle, the Arduino sends a short ultrasonic pulse from the Trig pin, listens for the echo on the Echo pin, and converts the time taken into a distance in centimetres using distance = duration / 58.0.

4. Display Update: The OLED redraws the radar screen each cycle — range rings and a sweeping line show the current scan angle, a dot marks any detected object within 30 cm, and the angle, distance, and status are printed as text.

5. Warning System: Above 30 cm the green LED is on (Safe); between 10–30 cm the yellow LED is on with a slow beep (Warning); below 10 cm the red LED is on with a fast beep (Danger).

6. Serial Output: The current angle and distance are also printed to the Serial Monitor for debugging.

7. Loop: All of this repeats continuously, giving a live, constantly updating radar display.

8. Uses of Radar

Application How Radar Is Used
Air Traffic Control Tracks aircraft and monitors their positions.
Weather Monitoring Detects rain, storms, and other weather conditions.
Military Detects and tracks aircraft, ships, and other objects.
Navigation Helps ships and aircraft determine their surroundings.
Automotive Used in collision detection, adaptive cruise control, and parking assistance.

9. Quick Troubleshooting

Problem Solution
OLED not displaying Check the I²C address (0x3C), SDA/SCL wiring, and power connections.
Servo not moving Check the signal wire connection to Pin 6 and ensure the servo has sufficient power.
Distance reading incorrect Make sure the Trig and Echo pins are connected correctly and that there are no obstacles too close to the sensor.
LEDs not working Check the LED polarity, resistor connections, and Arduino pin numbers.
Buzzer not sounding Check the buzzer polarity and make sure it is connected to Pin 5 and GND.

10. Sample Output

Sample Output 1 - Output indication using LED

Output indication using LED

Sample Output 2 - Object detection using OLED

Object detection using OLED

11. Arduino Code

Scan the QR code below to download the full Arduino sketch for this project.

YABOT ACADEMY
Igniting the Passion for Robotics in Kids

Leave A Comment

Your email address will not be published. Required fields are marked *