The inspiration came from something we see every day, which is the roads especially highways and travel routes. These roads are often dark, and drivers mainly depend on their car headlights. However, that is not the best option. It would be much better to have proper street lighting that supports visibility alongside the car lights.
The problem with some regular roads, which are rarely used, is that the lights remain on all the time, leading to unnecessary electricity consumption.
My idea is to make the streetlights operate based on whether someone is actually passing through or not.
By using a sensor to detect movement on the road, the lights would only turn on when needed. This way, most roads would be illuminated at night while avoiding the significant energy waste that usually happens.
To build and verify the circuit, I relied on TinkerCAD for the simulation and Arduino IDE for code checking .
First, I built the electronic circuit on TinkerCad to test the connections and code, and to make sure everything was working without any issues.
I also tried, as much as possible, to organize the wires in order to make the connections clearer and to simplify reviewing the circuit at any time
When the LDR sensor detects darkness, 60% of the lights (connected to Pins 8, 10, 12) turn on continuously.
If the Ultrasonic sensor detects an object in front of it, the remaining lights (connected to Pins 9, 11) will turn on, making the road 100% illuminated.
When the object leaves the road, the IR sensor (connected to Pin 7) detects the change, and after 5 seconds it sends a signal to turn off the lights on Pins 9, 11, returning the illumination to 60%.
If the LDR sensor reads LOW (meaning the place is already bright), then all the lights on Pins 8, 9, 10, 11, 12 will remain off until the sensor reads HIGH again.
Note :
In the code, we will change the reading on pin 7 from HIGH to LOW, because in our setup we are using an IR sensor, while the simulation uses a PIR sensor.
Wiring ⚡🔌
First we connected the 5V and GND pins to the breadboard 🔴🟤
After that we placed the Ultrasonic Sensor on the breadboard as well
Then we connected the VCC and GND pins of the Ultrasonic sensor using a jumper gray wire 🌫️
Then we connected the Echo pin of the sensor to Pin 2 on the Arduino using a blue jumper wire.🔵
After that we connected the Trig pin to Pin 3 on the Arduino using a purple jumper wire.🟣
Then we connected the LDR sensor to Pin 6 on the Arduino using a yellow jumper wire 🟡 , We also connected the VCC with an orange jumper wire 🟠 and the GND with a black jumper wire. ⚫
Then we connected the IR sensor to Pin 7 on the Arduino using a blue jumper wire 🔵,We also connected the VCC with a yellow jumper wire 🟡 and the GND with an orange jumper wire 🟠
Additionally we extended the GND line using a black jumper wire ⚫
After that, we connected the LEDs, making sure to correctly align the positive and negative terminals ,We also added five resistors (one for each LED), connecting one side of each resistor to GND and the other side to the corresponding LED .
After that we connected a separate jumper wire to each LED, using different colors for
The first LED to Pin 8 with an orange jumper wire 🟠
The second LED to Pin 9 with a green jumper wire 🟢
The third LED to Pin 10 with a white jumper wire ⚪
The fourth LED to Pin 11 with a blue jumper wire 🔵
The fifth LED to Pin 12 with a gray jumper wire 🌫️
Finally, I built and tested the circuit, and it worked as planned.
The idea is:
The LDR sensor makes the lights turn on only at night, with 60% brightness to light the road.
If the ultrasonic sensor detects a person or a car passing by, the brightness goes up to 100%
When the car leaves, the IR sensor notices it and turns off the extra lights after 5 seconds.
This way, the road stays bright when needed while also saving energy
This week I learned how to organize the wires and use colors to review each component more easily, even with multiple sensors. I also arranged the components on the breadboard in a way that supports the task and makes it easier for me during reviewing and troubleshooting.
One problem I had was that the sensor gave different results at different times of the day. I fixed this by adjusting it with a screwdriver
I struggled a bit with adding a variable to control the sensor’s distance range, since this part was completely new to me and I’m still a beginner in TinkerCad
Gamalaaaat💅😂
Our extra session ✨🧵
Dish party 🤤🍕