I am designing a Parking Sensor Alarm system that uses a combination of LED lights and a buzzer to alert drivers when they are approaching an obstacle.
The system measures the distance to nearby objects using an ultrasonic sensor and provides visual and auditory feedback:
Red Light + Fast Beep: Very close to an object (danger)
Green Light + Medium Beep: Approaching an object (caution)
Blue Light + Slow Beep: Slight distance (safe zone)
This combination ensures the driver is aware of how close they are to obstacles, enhancing safety during parking.
I planned to integrate the following electronic components:
Arduino Uno Board – to control the sensor and LED
Ultrasonic Sensor (HC-SR04) – to measure distance to obstacles
RGB LED – for red, green, and blue alerts in one component
Buzzer – to generate sound alerts
Resistors (220 Ω) – one for each RGB channel to limit current
Jumper Wires – to connect components to Arduino
Breadboard – for prototyping the circuit
Power Supply – USB from Arduino or external 5V
Circuit Building Software
TINKERCAD
Arduino IDE
Electric Components
STARTED MAKING THE CIRCUIT
Part 1: if Distance <= 100
if Distance <= 100 then
set pin 3 to LOW
set pin 5 to LOW
set pin 6 to HIGH
play speaker on pin 4 with tone 1000 for 1 sec
Explanation:
Condition: If the measured distance is less than or equal to 100 cm.
RGB LED:
pin 3 (e.g., Red) → LOW → off
pin 5 (e.g., Green) → LOW → off
pin 6 (e.g., Blue) → HIGH → on
→ The LED will show blue.
Buzzer: Produces a sound at 1000 Hz for 1 second.
Part 2: if Distance <= 200
if Distance <= 200 then
set pin 3 to HIGH
set pin 5 to LOW
set pin 6 to LOW
play speaker on pin 4 with tone 750 for 1 sec
Explanation:
Condition: If the distance is less than or equal to 200 cm (but greater than 100 cm because the previous if already handles 0–100 cm).
RGB LED:
pin 3 → HIGH → on (Red)
pin 5 → LOW → off
pin 6 → LOW → off
→ The LED shows red.
Buzzer: Produces a sound at 750 Hz for 1 second
Part 3: if Distance <= 300
if Distance <= 300 then
set pin 3 to LOW
set pin 5 to HIGH
set pin 6 to LOW
play speaker on pin 4 with tone 500 for 1 sec
Explanation:
Condition: If the distance is less than or equal to 300 cm (and greater than 200 cm, since the previous conditions did not apply).
RGB LED:
pin 3 → LOW → off
pin 5 → HIGH → on (Green)
pin 6 → LOW → off
→ The LED shows green.
Buzzer: Produces a sound at 500 Hz for 1 second.
Cardboard Enclosure
Watching teams presenting their ideas in the session!
When I got stuck / Research needed
I had trouble getting the RGB LED to display the correct colors according to the distance measured by the ultrasonic sensor.
The hardest part was making the buzzer sound change with distance while keeping the LED colors accurate. I had to research how `pulseIn()` works and how to calculate distance correctly.
After testing and adjusting the code, I figured out how to combine the LED and buzzer logic so both work together smoothly.
Mistakes / Pitfalls / Challenges
At first, the RGB LED didn’t always show the intended colors at the right distances. I realized that setting up the correct if/else conditions for smooth color transitions was trickier than I expected.
When testing on the real circuit, debugging became more challenging due to wiring and pin connection issues. On top of that, combining the buzzer and LED logic caused unexpected behavior if not carefully managed.
Each of these challenges was connected, and I had to address them step by step to make the system work reliably.
Tips for Others
Test the buzzer and LED separately before combining them.
Start with simple if/else statements before using nested conditions.
Double-check all wiring and pin connections on the real circuit.
Verify distance calculations carefully to ensure LED colors change at the correct distances.
Title of Media
Title of Media
Title of Media