Sunday, February 1, 2015

Traffic lights-->Red, Yellow, Green

This week let’s try our hand at a simple digital application which has one of the most widespread uses all over the world. Yes, I’m referring to the ubiquitous traffic light!
traffic light controller
It’s a silent part of everyone’s lives doing its part in maintaining order on the road throughout the world. The traffic light system is one of the systems which over the years have improved ever so slightly. It still has – and will – its three lights, red, yellow and green. Each light is lit for a certain period of time and in a certain sequence. The yellow light is lit in between the red and green. When the red is lit in one lane the green is lit in the other lane stopping traffic in one lane while allowing traffic in the other. What we are talking about is a ‘traffic light controller’. So let’s design a circuit keeping this simple logic in mind.
The image below shows the digital equivalent for the traffic light controller.
traffic light controller circuit
Click on the image to load the circuit or click here.
The above circuit can be used to signal the two sets of traffic lights – named R1,Y1,G1 and R2,Y2,G2 where the R, G and Y stand for red, green and yellow respectively. We have used logic probes in place of the lights. The D flip-flops are connected in series as a 10 bit ring counter. A clock signal is applied to each flip-flop which transfers a ‘1’ bit across each flip-flop. This results in initially G1 on and R2 on. As the bit shifts through the counter, this in turn shifts traffic lights G1 to R1 and R2 to G2. And the process continues. Thus when traffic in one lane is stopped by the lights the traffic in another lane is allowed to pass. Analyze the circuit according to the logic. The output plot is as shown below:
traffic light controller waveforms
But it would be nice to see the lights of your circuit in action right? Just after clicking on “Run” to simulate the circuit, come back to “Build” and on the circuit you can see the lights shifting in sequence.
But how will this traffic light controller be in real life? Although the lamps will be more powerful, the logic to run the system will be pretty much the same. A 555 timer will be used to generate a clock signal of the required time delay. Then a decade counter IC 4017 (this has 10 bits and each bit goes high with a clock signal in a round-robin fashion) performs the function of the ring counter in this circuit. And a NOR gate IC would be used for the NOR gates.
Hope you had fun designing and learning about your own traffic light controller!

3 comments:

  1. Titanium Bike Frame - Fit the bike frame in your home
    › cycling › titanium-bikes › cycling › titanium-bikes Nov 10, 2019 — titanium earrings sensitive ears Nov 10, 2019 ecosport titanium This frame is designed with the best shape of an upright, short handle bike that titanium hip can take your titanium nail bike to the next level. titanium gr 2 The perfect combination of

    ReplyDelete