Street Lighting with Motion Sensors :
When vehicles or pedestrians pass, the road is illuminated for them.
From Real on YouTube
TinkerCad
I used it to simulate the electrical circuit before implementing it.
Software
Arduino Uno
To write the code taken from TinkerCAD and transfer it to be implemented using Arduino board
Electrical tools:
Jumper Wires
Design on Tinkercad :
1) Open tinker cad
2) Enter the components used in it.
3) Connecting Ultrasonic to Arduino.
4)Connecting resistors to LEDs with Arduino.
Code blocks on Tinkercad :
1)ChatGPT helped me build my first block using (variables )
2) use ( set.. pin )Four times the number of LEDs.
3) use (if .. else) And put the distance equation in it.
4)Place the four LED blocks in(if .. else)and adjust them (high or low) .
What does the block do? 🤔
Definition of a variable called (distance)... It will be measured by the ultrasonic sensor... with the definition of its basic PINs.
Using the if function.
If the distance = 5. .. the LED (pin2) will open. choose *high*
the other LEDs are closed .. chose *low*
wait 1 sec
Using the else .
If the distance was not = 5
all the LED will closed. choose *low*.
The same condition is made at each required distance ( 10, 15, 20) with increasing LEDs lit.
Min Logic : 🔔
*Block mode combines the required distance and sensor reading.
*When the sensor reads a distance of 5cm. only the first LED lights up. 1sec
*When the sensor reads a distance of t10cm... two LEDs light up. 1sec
*When the sensor reads a distance of 15cm... three LEDs light up. 1sec
*When the sensor reads a distance of t20cm... four LEDs light up. 1sec
Convert the block code to text code...... and enter it into the Arduino C
Build the actual electrical circuit
The idea of using an ultrasonic sensor after EOWeek Session
is brilliant.
problem:
When starting the simulation, the LED does not light up. Noticeable light.
Reason:
Error in writing the code.. I did not put a second stability (Wait ...sec).... and I also used(if..then ) instead of( if ... else ).
Title of Media
I learned more about how to operate the sensor and integrate it into the electrical circuit.🤩
The team names were creative.😂😂
Thanks Menna Asker ❤️🤝😂
Games are taking over🥳.
lovely family 😍
Making cheesecake😋