# Problem with 555 timer and 4017 counter

simulate this circuit – Schematic created using CircuitLab

I'm attempting to make a circuit that flashes each LED sequentially. So far my 555 timer works just fine and gives me a pulse about 3x/second for the clock on the CD4017. However the LED's flash in random orders.

For the split second that the timer supplies voltage to the 4017, a random LED is lit up. For the split second that it stops supplying voltage all the LEDs dimly flash on.

Note that for the sake of simplicity, I only included 5 LED's in the schematic. There's ten LEDs for the 10 outputs of the CD4017.

Any idea what's going wrong here? I'm a first year student of E.E. so I'm still learning a lot. Thanks!

EDIT: This is essentially what I'm trying to create:

• You've verified that LED 0 is connected to pin 3, 1 to 2, 2 to 4, etc. as per the datasheet? – Ignacio Vazquez-Abrams Aug 18 '13 at 2:20
• Yep. It couldn't be that though since sometimes the same LED will flash two or three times in a row ocassionally. – codedude Aug 18 '13 at 2:23
• Related question: electronics.stackexchange.com/q/37248/2028 – JYelton Aug 18 '13 at 7:24
• Also note that the timer never actually "stops" supplying voltage; it supplies a high voltage, and then it supplies a low voltage, repeatedly. Supplying no voltage requires either a high-impedance output or leaving an input pin floating. – Ignacio Vazquez-Abrams Aug 18 '13 at 8:50
• @IgnacioVazquez-Abrams I didn't know that. Thanks for the heads up! – codedude Aug 18 '13 at 20:33

Do you have the datasheet for your specific 4017? It is quite possible that you need more current than the 4017 can handle.

For example, the datasheet for a Texas Instruments CD4017BE shows (graphs on page 3) that with a drain-to-source voltage of 10V, each output pin can sink no more than ~15mA:

As @Tony mentions in his answer, if the LEDs have a typical forward voltage of 2 to 2.2 volts, then the 100Ω current limiting resistors you are using drop approximately 7 volts. Using Ohm's law, I = E / R, the current each output pin would need to sink is around 70mA.

Try a higher resistor value to lower the current significantly, say 10mA. The LEDs won't be as bright, but it might be within your 4017's current sinking ability and at least allow you to determine if things are working correctly.

You can figure out the resistor value to use by rearranging Ohm's law:

$$R = \frac{E}{I} = \frac{7}{0.02} = 350\Omega$$

If that works, and you want to make them brighter, you'll need to either find a 4017 that has greater current ratings on the output pins or add some transistors.

Edit:

Note that the circuit you linked has a "1K2" resistor connecting the LEDs to ground (negative). That's equivalent to 1.2kΩ which works out to slightly less than 6mA per LED.

Edit 2:

Per @Curd's comment, I am also including the source current diagram from the datasheet.

• Hmmm. Didn't think about that. I'll give it a go and see what happens. – codedude Aug 18 '13 at 20:33
• The diagram shows the sink current. For the given circuit (current flows through LED if output is high) the source current is relevant. – Curd Sep 17 '13 at 9:42
• @Curd You are correct, I had not paid attention to the schematic properly. I added the source current graph to the answer. – JYelton Sep 17 '13 at 15:51

Your schematic doesn't match the "drawing."

Drawing shows a pushbutton between 4017 Vcc and the actual power supply that is not on the schematic. Is that switch actually there? If so, is it normally closed or normally open? If it's normally open, then that's your problem.

• That switch must be NC, since it's a power supply pin and applying voltage to an unpowered CMOS IC is usually a very bad idea. And to top it off, the CD4017 has a dedicated reset pin; hurray for edumacation... – Ignacio Vazquez-Abrams Aug 18 '13 at 8:42
• I didn't include any of the switches from the picture. That picture isn't exactly what I did but close enough that I thought it would help show what I was attempting. – codedude Aug 18 '13 at 20:31