I built a smart parking sensor system using Arduino. An ultrasonic sensor measures distance, and if the car is more than 1 meter away, the LED stays green. If the car is within 1 meter, the LED turns blue and the buzzer sounds as a warning.
I chose this idea because I’m passionate about automotive technology, and parking sensors are a practical real-world application. My inspiration came from actual car reverse sensors and projects.
For this assignment, I used Tinkercad to design and simulate my circuit before physical implementation.
Tinkercad allows me to test the connections, components, and logic virtually, which helps in identifying errors early and saves time and materials before moving to real hardware.
Materials:
breadboard
Buzzer
Arduino Cable
Jumper wires
RGB LED
Ultrasonic Sensor
220 Ohm Resistor
Breadboard, jumper wires, switch: for easy circuit assembly and testing.
Buzzer: to provide an audible fire alert.
5V power adaptor: to safely run all components.
Arduino Uno = brain
HC-SR04 = eyes (measuring distance)
Buzzer = mouth (gives sound alert)
Resistors = protect/signal conditioning
Breadboard & Wires = connection platform
This block-based code uses an ultrasonic distance sensor (trigger pin 6, echo pin 8) to control digital output pins based on distance.
Condition:
If the measured distance ≥ 100 cm
→ Execute the first set of pin commands.
Else
→ execute the second set.
Pin 7 → LOW
Pin 5 → LOW
Pin 4 → HIGH
Pin 3 → LOW
Pin 7 → HIGH
Pin 5 → HIGH
Pin 4 → LOW
Pin 3 → HIGH
🔹 In short: the code makes pins switch states depending on whether an object is farther than 100 cm or closer than 100 cm.
Open Tinkercad → Create a new Circuit.
Add Components:
Arduino Uno R3
HC-SR04 Ultrasonic Sensor
RGB LED (or normal LED if RGB not available)
Buzzer
Breadboard
Jumper wires & resistors (220Ω for LED, ~1kΩ/2kΩ if needed for voltage divider).
Wiring Connections:
HC-SR04 Ultrasonic Sensor
VCC → 5V on Arduino
GND → GND on Arduino
TRIG → Digital Pin 9
ECHO → Digital Pin 10
RGB LED
Common cathode → GND
Green pin → Digital Pin 3 (through 220Ω resistor)
Blue pin → Digital Pin 4 (through 220Ω resistor)
Buzzer
Positive → Digital Pin 7
Negative → GND
Program with Code Blocks:
Create blocks to:
Send trigger pulse to HC-SR04
Read echo time → calculate distance
If distance > 1m → Green LED ON
If distance ≤ 1m → Blue LED ON + Buzzer ON
Run Simulation: Place an object in front of the sensor and check the LED/buzzer response.
Gather Components:
Arduino Uno board + USB cable
Breadboard
HC-SR04 Ultrasonic Sensor
RGB LED (or 2 LEDs: green & blue)
Buzzer (passive or active)
Jumper wires
220Ω resistors (for LED)
Circuit Wiring (same as Tinkercad):
HC-SR04 → VCC → 5V, GND → GND, TRIG → Pin 9, ECHO → Pin 10
RGB LED → Cathode → GND, Green → Pin 3 (with resistor), Blue → Pin 4 (with resistor)
Buzzer → Positive → Pin 7, Negative → GND
Upload Code:
Copy the Arduino C code from Tinkercad Code Blocks into Arduino IDE.
Connect your Arduino Uno via USB and upload the code.
Test the Circuit:
Place your hand or object at different distances.
If object is farther than 1m → Green LED ON.
If object is closer than 1m → Blue LED ON + Buzzer ON.
Record Video: Show how the LED color changes and the buzzer beeps depending on distance.
Export .ino File: Save and submit your Arduino sketch.
For this assignment, I shared my parking sensor idea with my classmates to get their feedback. Some of them suggested that instead of only using a buzzer, I should also add an LED to give a visual warning, which I integrated into my project by using a green and blue LED. Another peer suggested setting different distance thresholds with multiple colors (like traffic lights), which inspired me to think about expanding the project in the future.
I also helped my peers by explaining how the HC-SR04 ultrasonic sensor works (sending a trigger pulse and reading the echo time to calculate distance) and showing them how to wire it correctly in Tinkercad. In return, some classmates helped me troubleshoot my buzzer connection and suggested keeping the wiring simple so it would work both in simulation and real hardware.
Through this exchange, I was able to improve my project and also support others in building theirs.
One problem I faced was that I mistakenly used the wrong ultrasonic sensor in Tinkercad (PING instead of HC-SR04). This caused confusion because the PING sensor has only one pin for both sending and receiving, while the HC-SR04 has two separate pins (TRIG and ECHO), so I didn’t know how to connect it properly.
To troubleshoot, I traced my circuit wiring step by step and compared the sensor pins in Tinkercad with real HC-SR04 pinouts. I also tested different wiring setups in the simulator to see how the sensor responded.
The technical solution was to switch to the correct HC-SR04 sensor in Tinkercad, then connect TRIG → Pin 9 and ECHO → Pin 10 on the Arduino, with VCC to 5V and GND to ground. After this correction, the circuit worked properly.
The key to solving this problem was a combination of trial and error in Tinkercad and checking an online tutorial: How HC-SR04 Ultrasonic Sensor Works with Arduino. This clarified the pin functions and helped me fix the issue.
I learned how to make code using code blocks, and I can use this skill for quick testing of small parts in my final project. For example, I can test the LED with a switch before I write the full program. This will help me make sure each part works step by step.
Coolest thing I learned this week: how to make a buzzer play different sounds using code blocks.
Something I’ll never forget from this week: programming the buzzer to play a popular song—it felt amazing to turn code into real music.