Traffic Light Circuit using 555 Timer

Thread Starter

GammaRay86

Joined Dec 9, 2007
14
Hey all,

I would really appreciate if anyone could help me figure out how to create a traffic light circuit using a single 555 timer. I need 3 LED's that flash for one second each and then repeat that cycle. I know how to do it using 3 555 timers but I cannot figure out how to do it using only 1. Thanks in advance!
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, you'll need more than just a 555 timer ;)

Take a look at a CMOS 4017 Decade Counter. Use the square wave output from your 555 timer as the 4017's clock pulse (the CP1\ input, tie the CP0 to ground.)

The 4017 has an MR input; if that is put to a logic "1", the counter is reset.

It also has 10 outputs O0 through O9. These outputs are individually set to a logic "1" in sequence, the remainder of the time they are at a logic "0" level. You can use the O0 through O2 outputs for your green, yellow, and red LED's respectively. Tie the O3 output to the MR input; it will cause the 4017 count to re-set and start over with the green light.

The 4017 can't supply enough current to run your LED's, so you'll need something for that. A 4049 inverting buffer would BARELY supply enough for standard LED's if you were running at 10V - but it's risky to run IC's at their max ratings.

Instead, have a look at the ULN2804, which is Eight Darlington Pairs. The ULN2004 is similar, but only seven pairs. Each of the Darlington pairs can sink up to 500mA - that's quite a bit. You COULD use ULN2803 or ULN2003 IC's, but you'd need to use resistors to limit the base current if your Vcc is in excess of 5V.

You connect O0-O2 of the 4017 to the first 3 gates of the 2803/2804/2003/2004, and the output goes to the cathodes (short leads) of the LED's. The anodes of the LED's get connected to current-limiting resistors, the other side of the resistors gets connected to Vcc. Rather than having the 4017 attempting to drive the LED's itself (which it is not capable of), the Darlingtons invert the logic output of the 4017, so we're using the open-collector output of the Darlingtons to provide the ground for the LED's.

Calculating your current-limiting resistors:
Since you have three different types of LED's, they'll have different ratings for current @ voltage. You should calculate the current flow for each LED to ensure that you don't exceed the current ratings.

Since you're using Darlington pair drivers, there will be a voltage drop of roughly 0.7v across the junction, even when it's conducting - this has to be figured in with the voltage rating of your LEDs.

For example, let's say that one of your LED's is rated for 15mA @ 2.5v.
You plan on using 12V for VCC.

Ohm's Law:
R = E / I (Resistance = Voltage / Current)
R = 12V - 2.5V - 0.7V / 15mA
R = 8.8V / 15mA
R = 586.667
So, for an LED of the stated rating, you'd need a 586.667 Ohm resistor.
You could use the next highest value; the LED would not be quite as bright, but it wouldn't suffer an early demise ;)
Let's see what happens using 620 Ohms, the next higher E24 value:
I = E/R (Current = Voltage / Resistance)
I = 8.8/620
I = 14.2mA (approximately)
Safely within limits, and your LED will still be plenty bright.

Have a go at it.
 
Top