Traffic Control with Photosensor.

 

Concept.

The concept for this project is pretty simple. How can traffic be regulated in a smart, optimized way such that when there are more cars and fewer pedestrians, the traffic light stays green for longer? In an advanced way, could we have sensors that could calculate traffic and find an optimized way to control them? That was how I came up with this project. The photoresist represents traffic: the light turns green when more cars are stuck in traffic. Pedestrians, on the other hand, can utilize the switch to inform the system of their intention to cross. When the switch is turned on, the traffic turns red.

 

Process.

The project features two LEDs, a photoresist to check the number of traffic, a switch, jumper wires, and four 10K ohms resistors. The photoresistor keeps track of the amount of traffic (the higher the traffic), the higher the resistance, which results in the traffic light turning green.

Challenges

One of the challenges I was faced with was designing a code that would ensure one of the lights stayed on until a condition was met. It took me a while to figure out that the “switch” statement in javascript would be the most convenient way forward. That aside, figuring out how to connect the photoresistor after appropriately connecting the LEDs and the switch proved difficult. I got to a point where I assumed the photoresistor was faulty. However, it started working after I dismantled everything and reconnected the circuit differently.

Overall, this project challenged me to think more creatively, and it also helped me gain a better understanding of coming up with appropriate Arduino circuits.

 

Leave a Reply