Digital Logic Design · Riphah International University
Instructor: Syed Hassaan
Authors: Hanan Shafay (72442) · Mohid Ahmed (73410) · Umair Hassan (74825)
A real-time ultrasonic radar system built with an Arduino Uno and visualised through a Processing 4 GUI. The radar sweeps an HC-SR04 sensor across a 180° arc, plots detected objects on a phosphor-green display, and features a hardware-toggled lock system that freezes the radar and shows a full animated LOCKED screen.
- 180° sweep via servo motor in 2° steps
- Distance measurement up to 40 cm using HC-SR04 ultrasonic sensor
- Hardware lock toggle — falling edge on Pin 2 (INPUT_PULLUP) switches radar between
ACTIVEandLOCKEDstates - Processing 4 display at 1280×720 with:
- Phosphor-green radar rings, spoke lines, and sweep trail
- Red blip markers for detected objects
- Sine-wave beep sounds (pitch varies with distance)
- Animated LOCKED screen with CRT scanlines, pulsing rings, and padlock
- Side panel with live angle, distance, FPS, and system info
- Header with Riphah logo and author credits
| Component | Details |
|---|---|
| Arduino Uno | Microcontroller board |
| HC-SR04 | Ultrasonic distance sensor |
| Servo Motor | Any standard 5V hobby servo |
| Push button | Normally open, connected to Pin 2 and GND |
| Jumper wires | As needed |
| Signal | Arduino Pin |
|---|---|
| Servo | 12 |
| TRIG | 10 |
| ECHO | 11 |
| LOCK (button) | 2 → GND |
- Arduino IDE with
Servo.h(built-in) - Processing 4 with libraries:
processing.serial(built-in)processing.sound— install via Sketch → Import Library → Add Library → Sound
- Wire the components according to the table above.
- Open
RadarLock/RadarLock.inoin Arduino IDE, select your board and port, and upload. - Open
RadarProcessingBeep/RadarProcessingBeep.pdein Processing 4. - Change the
COM_PORTvariable at the top of the sketch to match your Arduino's serial port (e.g."COM3"on Windows,"/dev/ttyUSB0"on Linux). - Place
riphah.pngin the same folder as the.pdefile. - Run the Processing sketch.
- Press and release the button on Pin 2 to toggle the radar ON/OFF.
| Message | Direction | Meaning |
|---|---|---|
angle,distance. |
Arduino → Processing | Sweep data (e.g. 90,15.) |
ACTIVE. |
Arduino → Processing | Radar turned on |
LOCKED. |
Arduino → Processing | Radar turned off |
The Arduino sends LOCKED. every 500 ms while in locked state to keep the display in sync.
Loc Radar System Riphah/
├── RadarLock/
│ └── RadarLock.ino # Arduino firmware
└── RadarProcessingBeep/
├── RadarProcessingBeep.pde # Processing display sketch
└── riphah.png # University logo asset
| Name |
|---|
| HananShafay |
| Mohid Ahmed |
| Umair Hassan |
Academic project — Riphah International University, Department of Software Engineering.