cars
The idea for this project was inspired by a cartoon about car racing, where drivers always faced challenges in parking safely in tight spots. I wanted to design a smart circuit that simulates a real-life parking assistant system used in modern cars. This inspired me to create a simple, low-cost prototype using Arduino that measures the distance between the car and nearby obstacles, and then gives both visual (LEDs) and audio (buzzer) feedback to the driver.
Software: TinkerCad (for simulation and code blocks), Arduino IDE (for uploading code).
Hardware Components:
Arduino UNO
Ultrasonic Sensor (HC-SR04)
LEDs (Green, Yellow, Red)
Buzzer
Breadboard & Jumper Wires
Resistors (220Ω for LEDs)
Tinckercad circuit
Input Component: Ultrasonic Sensor (HC-SR04) measures the distance between the car and an obstacle.
Action Components: LEDs and a buzzer provide feedback to the driver.
Logic:
Distance > 50 cm → Green LED ON (Safe distance).
Distance between 20–50 cm → Yellow LED ON + Buzzer with slow beep.
Distance between 10–20 cm → Red LED ON + Buzzer with fast beep.
Distance < 10cm → Red LED ON + Continuous buzzer alarm (Danger).
I first designed the circuit in TinkerCad. The wiring included connecting the ultrasonic sensor to Arduino digital pins, the LEDs each with a resistor, and the buzzer to another pin.
Code Explanation:
I used the digitalWrite() function to control LEDs and buzzer.
The pulseIn() function was used to calculate the time taken by the ultrasonic signal to return, which was converted into distance.
If/else conditions were used to set different thresholds for lighting LEDs and controlling buzzer tone.
The sequence of the code blocks in TinkerCad ensured that the sensor reads the distance continuously and updates the outputs in real time.
Ultrasonic Sensor (HC-SR04):
Trig Pin → Arduino Pin 2
Echo Pin → Arduino Pin 3
VCC → 5V
GND → GND
Green LED: Arduino Pin 11 (through 220Ω resistor to GND)
Yellow LED: Arduino Pin 12 (through 220Ω resistor to GND)
Red LED: Arduino Pin 13 (through 220Ω resistor to GND)
Buzzer: Arduino Pin 10 (with GND connection)
After finalizing the design in TinkerCad, I implemented the smart circuit on a breadboard:
Connected the ultrasonic sensor to the Arduino UNO.
Added Green, Yellow, and Red LEDs with resistors.
Connected the buzzer to a digital pin.
Powered the board using USB connection.
I transferred the code from TinkerCad to Arduino IDE and uploaded it to the board. The prototype worked as intended:
When objects were far, only the green LED lit.
As the object got closer, the yellow LED turned on and the buzzer beeped.
At very close range, the red LED lit up and the buzzer sounded continuously.
This successfully demonstrated the parking assistant concept.
Problem:
When transferring the circuit from TinkerCad to the physical Arduino setup, the ultrasonic sensor (HC-SR04) did not give accurate readings, and the LEDs/buzzer did not respond as expected.
Solution:
I calibrated the ultrasonic sensor by adjusting the distance thresholds in the code, checked all wiring connections to ensure they were correct and secure, and verified the resistor values for the LEDs. After fine-tuning both the code and hardware connections, the circuit worked successfully.
first valus
This week’s assignment helped me strengthen several skills that I can directly apply to my final project:
Circuit Design & Wiring:
I learned how to carefully connect input and output components on a breadboard, test them in simulation, and then transfer them to real hardware. This will be essential in my final project, where multiple sensors and actuators will need to work together.
Sensor Calibration:
Through adjusting the ultrasonic sensor thresholds, I gained experience in calibrating sensors so that they give reliable results in real-life conditions. In my final project, I will also need to test and calibrate sensors (e.g., for timing, movement, or measuring values) to ensure accuracy.
Troubleshooting & Debugging:
Moving from simulation to real hardware taught me that things rarely work perfectly the first time. I now feel more confident in identifying wiring issues, refining code, and making adjustments until the system performs well.
Coding Logic:
Using conditional statements and structuring my code to handle different distance ranges gave me practice in building logical decision-making. My final project will also need this type of structured code to control multiple actions based on different inputs.
Overall, this assignment gave me a strong foundation in combining hardware + software + problem-solving, which will help me successfully implement my final smart device prototype.
Maker Diploma Dish party
in the train
breakfast
arabit fool time
kahoa balady time