Can 4017 handle this?

Hey guys,

I just wanted to run this idea past you, and make sure I haven't overlooked something...

For the circuit I'm building, I have 14 LED's of which I need to illuminate two at a time, then cycle back to the first.

To do that, I'm looking at using this 4017 IC:

Now, the 4017 can handle 25mA max. And 80% of that is 20mA. So in theory it should source 20mA at 5v from each pin, in sequence, without a problem.

I'd like to power my LEDs with 20mA each, so the plan is to connect the 4017 to the Arduino's pin via a current limiting resistor, then connect two LEDs in serial, directly to each of seven pins, and then to ground... the idea being to make full use of that 5v coming off the pin to power both leds with 20mA without exceeing the 4017's output capability, and to reduce the number of resistors and arduino pins needed to just one.

What do you think? Everything I know so far tells me this ought to work without any problems, but I'm still learning so I want confirmation. :slight_smile:

PS:
I plan to wire the eigth pin in the 4017 sequence to the 4017's reset pin, which I assume will trigger the first led in the sequence to illuminate the moment I hit the 8th clock in my sequence.

PPS:
The current limiting resistor I've calculated I'll need for the 4017 is 47 ohms, based on a 5v source, a 2.1v drop, and 20mA of current, powering two leds per pin in serial. Also, according to the LED wizard, the leds in this configuration will dissipate 84mW, which is well below the 500mW which another CMOS 4017 I found said it could handle. (The TI one doesn't list the power dissipation from what I could tell, but I assume its similar.)

Now, the 4017 can handle 25mA max

No it can't. That is the absolute maximum stress rating the data sheet says about this figure:-

CAUTION: Stresses above those listed in “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress only rating and operation
of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied.

So I would say 20mA is pushing it.

I know there is an attitude that says "well it works so it's OK" but that does not auger well for a long life of these components. There is also package power dissipation issues that are difficult to address as this chip is not designed for driving LED loads.

the idea being to make full use of that 5v coming off the pin to power both leds with 20mA without exceeing the 4017's output capability

You will probably find that at a high current you don't actually get 5V out, the voltage drops with current. You will see that the output can drop as low as 3.7V under some loads at some temperatures. This means the resistor value has to be small and with small resistors they act less like a constant current source and as so less effective at regulating current.

scswift
The other option is to use a ULN2803 which is a darlington driver.
This has an open collector, which can sink 500mA.

OR use transistors to drive the LEDs.

This would also allow connection to a higher voltage for the LEDs, rather than loading your 5v supply.

Personally I always stick to a around 10mA, as there is very little visible difference in the light output (except for different colours)

Mark

Now, the 4017 can handle 25mA max

No it can't. That is the absolute maximum stress rating

Yes, and I was referring to the absolute maximum. That's why I said 'max'. I'm aware I should not actually run that much current though it for any period of time. I quoted that figure because that was my starting point for determining what a safe current to run through it is. I'm not sure how else I'm supposed to calculate what a safe current is.

And why is 20mA pushing it? I thought the rule of thumb was to stay below 80% of the max rating.

I don't have to use 20mA. I would just like to so that my LEDs are as bright as possible.

What do you think would be a safe amount of current to put through it? What rule of thumb should I be using?

There is also package power dissipation issues that are difficult to address as this chip is not designed for driving LED loads.

This chip says it can handle dissipating 500mW:

And 20mA at 5v is way way less than 500mW. So what's the issue?

scswift
The other option is to use a ULN2803 which is a darlington driver.
This has an open collector, which can sink 500mA.

But that won't save me pins. I'll still have to use a 4017 to drive it.

And the thing is, I have to drive a display with 7 leds on it as well. So I gotta use a 4017 for that too. I don't want to have to use four chips in this prop just for the sake of making the leds a little brighter.

Besides, I just tested the leds at 10mA, and you're right. I cannot see a difference. That extra 10mA made a big difference in my led array, but those leds were kinda dim and being multiplexed. These are super bright ones.

OR use transistors to drive the LEDs.

No thanks! I'll stick with darlington arrays. Too much soldering required for discreete transistors.

This would also allow connection to a higher voltage for the LEDs, rather than loading your 5v supply.

What is with you people and multiple power sources!

Personally I always stick to a around 10mA, as there is very little visible difference in the light output (except for different colours)

What do you mean by "except for different colors"?

Okay, so based on what's been said...

Let's say I connect the 4017 to the Arduino pin via a 100ohm resistor, and connect two LEDs with a forward voltage of 2.05 in serial to each of the 4017's outputs, proving each pair with around 5v at 10mA.

Will THAT work?

(I'll also be connecting individual LEDs with a forward voltage of 1.7 to a second 4017, and connecting that 4017 to another pin on the Arduino via a 330ohm resistor.)

And why is 20mA pushing it? I thought the rule of thumb was to stay below 80% of the max rating.

No the 80% is below the recommended operating level not the absolute stress maximum.

Also, according to the LED wizard, the leds in this configuration will dissipate 84mW, which is well below the 500mW which another CMOS 4017 I found said it could handle.

Don't mix up the power dissipation in an LED with the power dissipation in a package. Remember to multiply the power dissipation per pin by the number of LEDs.

No the 80% is below the recommended operating level not the absolute stress maximum.

I’ve never seen a datasheet include a ‘recommended operating level’. The only thing I’ve seen that might be considered a reccomendation is when the manufacturer lists a ‘test coniditon’ for a part, like an LED where they usually list how it performs at 20mA.

And besides, why would you run at 20% below the operating level which is reccomended? That doesn’t make sense to me. Why reccomend an operating level if it’s not actually reccomended you run at that level?

So in the absence of any reccomended operating conditions, and with the only metric I have to go off of being that absolute maximum rating, how am I supposed to dtermine what’s safe to run at?

Also, according to the LED wizard, the leds in this configuration will dissipate 84mW, which is well below the 500mW which another CMOS 4017 I found said it could handle.

Don’t mix up the power dissipation in an LED with the power dissipation in a package. Remember to multiply the power dissipation per pin by the number of LEDs.

That calculation was multiplied by the number of LEDs.

http://led.linear1.org/led.wiz

Enter 5, 2.05, 20, and 2, and the wizard states:
“together, the diodes dissipate 82 mW”

Speaking of the LED wizard, I found this page on that site which shows the nonlinear relationship between led brightness and current:
http://led.linear1.org/how-is-led-brightness-related-to-current/

I've never seen a datasheet include a 'recommended operating level'.

Yes you have that one you posted said the drive level in terms of TTL fan out.

The only thing I've seen that might be considered a reccomendation is when the manufacturer lists a 'test coniditon'

That will do.

And besides, why would you run at 20% below the operating level which is reccomended?

It is called de-rating and is used to extend the life of a component.

Why reccomend an operating level if it's not actually reccomended you run at that level?

It looks good on the data sheet, no engineer would dream of running say a 20A FET at 20A.

"together, the diodes dissipate 82 mW"

The LED wizard can only tell you about the power dissipation of the LED it knows nothing about the driving circuit. So how much power are you dissipating in the package.

The point is you asked if this chip was up to it. My answer is NO. It was not designed as a driver and was not meant to be used in the way you are planing to use it. If you don't like the advice then pay no attention to me, I have only been in electronics 40 years what do I know.

Now, the 4017 can handle 25mA max

No it can't. That is the absolute maximum stress rating

It's also "while maintaining a particular output level", which isn't particularly important in this case.

You know, normally I'm in favor of treating data sheet "max" ratings with some respect, but the 4017 has been used in SO many hobbyist LED projects that I think it has proven itself capable in that role, and your original idea should work just fine. A carefully calculated resistor value will give you less current than you think, since the 4017 internals are NOT ideal switches; it has some internal resistance as well.

And since the 4017 only drives one output at a time, I don't think you have to worry about overall power dissipation...

It's also pretty rare (I think) to find logic ICs that fry themselves whenever you accidentally short an output pin to a supply rail, even for "moderate" lengths of time.

The point is you asked if this chip was up to it. My answer is NO. It was not designed as a driver and was not meant to be used in the way you are planing to use it. If you don't like the advice then pay no attention to me, I have only been in electronics 40 years what do I know.

Mike, don't get me wrong. I really appreciate the advice, and I'm taking what you say seriously. I just want more information. I need to understand the 'why' of things. Answering 'Can the 4017 handle this?' with 'No.' isn't useful to me. If it can't handle 20mA, I need to know what it can handle, so I know when I can use it and when I can't.

And I need to understand why what you're saying about it's power dissipation seems to conflict with the datatsheet because obviously I don't understand something important.

Also, why does it matter what it was designed to do, as long as I run it within safe parameters? If it can handle 5-10mA and I'm fine running my LEDs with that level of current, then what's wrong with using it in that instance? Current is current, right?

I'd still like more info on the 4017's capabilities, but I thought I should let ya know that I'm now looking at using the ULN2803A (or its 7 input cousin whose part number I forget) in conjunction with the 4017.

The reason for the change is I realized that if I was gonna have to use two 4017 chips anyway if I wanted to run two displays with a total of three LEDs, that I might as well make one of those chips a darlington array and shift the load onto that.

If I do that, I won't need to muck about with running leds in serial, and I can still run different colors without having to use more than three resistors.

The LED wizard can only tell you about the power dissipation of the LED it knows nothing about the driving circuit. So how much power are you dissipating in the package.

I guess I don't understand the question.

The 4017 has one output that goes high at a time. If I have two leds on each pin, then wouldn't the power it needs to dissipate always be equal to that which is required to run two leds?

4017 is a pretty old, low-tech part. There are much better options today such as TPIC6B595
Shift register in, and high-power MOSFET outputs. It seems to be everything you want in a single package.

Shift Register 8-Bit High-Power - TPIC6B595 - COM-00734 - SparkFun Electronics

That chip looks interesting. Requires three pins like the 74HC595 I take it?

Hm... I may be able to spare a couple more pins. Might be a bit cheaper than buying two chips and two ice sockets to go with them. Would definitely take up less space and space is at a preminum on this board.

Definitely something I'll consider.

I haven't read the detail of the data sheet but what can go wrong is that logic chips don't guarantee that the 'high' output voltage is a full 5v. It only needs to be high enough for another logic chip to recognise the input as high, and that can be significantly lower, maybe 4v or 3v. Especially when the output is under load and the chip has a bit of internal resistance the output voltage may drop. So to get 20mA out you may need to lower your series resistor. You might even find that with 2 LEDs in series you can't get 20mA out of a pin even with no series resistor.

It can happen that you get different voltages under heavy load from each different pin, leading to uneven brightness (I've had this when trying to make a 8x8 LED display driver using only 74hc595s without buffers; the resulting uneven brightness is particularly annoying). Different chips can give different output too, in the worst case you could find that you swap the chip and one of the outputs is overcurrent.

Ultimately if it's your own personal project it doesn't really matter, you may as well do it anyway and if it works out too dim or uneven it isn't really a problem. But if it was commercial or on display then I'd recommend using a buffer.

But if it was commercial or on display then I'd recommend using a buffer.

When you say 'buffer' you mean like a darlington array or transistor, right?

scswift
Sorry wasn't aware you question was including saving pins, or the number of IC's, when i suggested using a driver chip.

What do you mean by "except for different colors"?

I have noticed that the if you assume the same current flow, the illuminousity will change between the different colour leds. Most of this is due to the difference in forward voltage, and some in the human eye.

You are correct in your observations about the MAX current. The spec sheet does indicate an absolute maximum, and also that it is PER PIN.

What is with you people and multiple power sources!

This one relates to when the wall supply delivers a voltage greater than 5v, and you use a 5v regulator on the board.
You can opt to use a 7805 which is physically large, and drop the voltage to everything, including LEDs, etc.
OR use something like a 78L05, and run the essentials.

The latter method also removes the current switching spikes, which in digital ICs sometimes comes back to haunt the designer. (I've seen many a circuit work using a bench supply, with lots of filtering, to fail when the final unit is made)... :-?

Your approach to understanding the reasons is great.
There are many out there that just want an answer, and as a consequence always need the answer.

If you do start runnng out of pins, you can always use the select/enable line to decide what device you are sending the clock to, or displaying....

Good luck
Mark

It’s also “while maintaining a particular output level”, which isn’t particularly important in this case.

It is if he is planning to use two LEDs in series.

If I have two leds on each pin, then wouldn’t the power it needs to dissipate always be equal to that which is required to run two leds?

No. Power is the product of voltage and current. Suppose you have an LED with 2V across it and 20mA through it. The power dissipation in the LED would be 2 * 20 = 40mW.
Now suppose you switched that with a transistor that had a saturated collector emitter voltage of 1V then the power dissipated in transistor switch would be 1 * 20 = 20mA. Then suppose you switch that LED with a FET that had an on resistance of 0.5 ohm. Then with 20mA through it it would have a voltage of 0.5 * 20 = 10mA therefore the FET would dissipate 10 * 20 = 30uW.
So you see the power dissipated in the load is not the same thing as the power dissipated in the switch.
One thing about chips in general is that the maximum current rating is nearly always higher than the total power dissipation, so it is power dissipation that becomes the limiting factor. see my notes on the Darlington drivers:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html
and
http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html