Title of Media
i wanted to make smart parking gate
it has 2 led indicators to enter the gate or not
and button to open the gate to let the car cross
then it closes again
i used tinker cad to draw the circuit and adding the components
i used
-arduino uno
-servo motor
- ir sensor
- push button
- 2 leds
- bread board
then i used arduino ide to write my code
Title of Media
i connected the leds green in pin 5 , and red in pin 5 thru 220 ohm resistors and ground from the bread board
and the leds will be output component
the servo motor ground and volt from the bread board and the signal to pin 7 as output component
the ir sensor ground and volt from the bread board and the signal in pin 4 as input component
and push button to ground and pin 12
i started the code by attaching the servo library
then the integers to my components
and define the pins which one is input and which one is out put
at first i told the code if the gate is empty and the ir sensor not detecting and objects turn on the green led
and if it detect anything turn on the red led
and if the car driver pushed the button
open the gate by letting the servo rotate to 90 degree then delay two seconds then move back to 180 degree
Title of Media
there was a problem in adding delay in the servo movement
to let the gate opened a little bit till the car entered
and i searched in arduino.cc and found the solution
by adding the delay between the first move and the second move
Title of Media
the car seeing the green led
so it can enter tha gate
the driver pushed the button
and crossed the gate after opening
the ir sensor detected the car then it turned the red led
the hidden circuit
the final result
i succeed in completing the smart home activity with eman
after failing in the first time at home
Title of Media
Title of Media