Title of Media
the idea came from my car parking sensor , i wanted to make a circuit that give me a warning thru three led depends on the distance and it changes from green to yellow to red
i used tinkercad to build my circuit and build my code then test it before build it with real components
and will use arduino ide to upload my code to arduino uno
Title of Media
i'll use arduino uno as my project brain
ultrasonic sensor as input device
three leds as output device
Title of Media
that's my circuit on tinkercad
i used arduino uno and i attached three led green to pin 5 and yellow to led 6 and red to pin 7
and the ultrasonic trigger to pin 9 and echo to pin 8 an
i'll power the ultrasonic from 5v pin
and power the Arduino uno with usb 5v
then i started to add code blocks to run my circuit correctly
i started with control block if condition and input reading my ultrsonic trigger and echo pins , then a math to define the distance for each lamp
the green led will turn on in distance from 55cm to 35 cm
the yellow led will turn on in distance from 34cm to 2cm
the red led will turn on in distance below 20cm and will blink
tinkercad simulation
i started to build my circuit as tinkercad design
then i uploaded the code thru arduino ide software
and tested it and it worked correctly
Title of Media
project test
i had problem in my code before using using if condition < or > without adding and condition so tinkercad was turning on all lamps each if condition
so i defined the distance to let each led work from and to specific distance
and i knew the solution thru instructor muhanad in the extra zoom help session
and thru slack , alaa , rawan , ahmed osama , ahmed atef
Title of Media
i learned how to use input device and use its data to control an output device
and using different blocks in tinkercad to run my code correctly
final project test
Title of Media
Title of Media