Externally powering LEDs so Arduino doesn't fry

See how you justify your behavour, by claiming you are saving the world from bad people that are trying to trick people into hurting their precious electronics.

Mike, im just trying to save the world from closed minded people. Some people think that their way is the only way, and when the only thing that matters is that they get their way, its ok to mistreat others to get your way, right?

There are no laws that say that I cant slowly (like it may take years slowly...) erode my leds, or show others how to slowly erode their LEDs. Sadly, I cannot guarantee that that I have any damage going on, or how much.

OK, I think i see how what current rating is so confusing, There are 3 primary choke points, all of which must be observed. It looks like there are many ratings (100ma, 200ma, 300ma, 400ma), but after examining the image, you can see that 400ma comes from 2VCCs, 300ma comes from the ports current restrictions combined (but I think you could do 350ma, if are clever), and the 100ma is from sinking on a single port. It sorta looks like several specifications for one thing, but its many separate things, and conditions that have some relationships to each other.

So, You can run 400ma through the chip, but through the io ports you shouldnt do more than 350, or 300, depending on how you source/sink, and you still have to be careful not to overload any one port, or more than 40ma through any single pin.
I found a website with both schematics:

on the TQFP:
Pins 2-6 are VCC or GND. There is additional AVCC and GND on pins 18,21. It would look like 600ma though the chip, but if the ports are the same, then im not sure what the benefit is.

Hippynerd:
There are no laws that say that I cant slowly (like it may take years slowly...) erode my leds, or show others how to slowly erode their LEDs.

No laws, no, but how about common decency and not wasting people's time by having them constantly correct you when you tell others things that might break their components?

Hippynerd:
So, You can run 400ma through the chip, but through the io ports you shouldnt do more than 350, or 300, depending on how you source/sink, and you still have to be careful not to overload any one port, or more than 40ma through any single pin.

Nope.

To quote the datasheet (again...):

"DC Current per I/O Pin ............................................... 40.0 mA

This is a stress rating only and functional operation of the device at these conditions is not implied. Exposure to absolute maximum rating for extended periods may affect device reliability."

ie. 40mA isn't a design goal and it is NOT OK to draw 40mA for any length of time.

Did you get confused when I said not more than 40ma meaning you should use 40ma?

I think that having common decency includes designs that may cause extra wear, what I find indecent is people discouraging people from doing things. Scaring people into doing things only the way that you want them do to things isnt cool.

There is nothing wrong with designing in higher reliability, but if you make it your highest criteria, then you are limiting your world, which is fine if you want to do that, but telling others that they have to do that is selfish, and not really helping others.

Did you know that a battery has an internal resistance, and under the right circumstances, can safely power an LED without a current limiting resistor? Every situation is not the same, every person is not the same, and every project is not the same, so why make rules that dont work for everyone, in every situation?

It's not as if we're telling you to drink Pepsi instead of Coke, drive Ford instead of Chevy or what your preferences in the bedroom are. Those things are personal choices.

What we're saying is more like telling you to drive on the correct side of the road. Arguing to death that it's OK so long as nobody is coming the other way is completely missing the point.

Which side is the correct side? left, right, or it depends on the circumstances?

Hippynerd:
Which side is the correct side? left, right, or it depends on the circumstances?

Whichever side means you're not constantly swerving to avoid trucks.

If you were proposing some smart way of driving cross country to arrive sooner and use less fuel then we might listen but you're not. You're just saying that driving on the wrong side is possible under some circumstances.

Maybe so, but:
a) You're constantly dodging trucks (and one day they will get you)
b) You're not going to arrive at your destination any sooner, so why bother?
c) You're using more gas and wearing out more brake pads and tires. You'll get through more cars than people who just drive properly.

1000 beginners follow your advice, 900 are happy it works, 100 quickly fry their circuitry and 50$ x 100 dollars get wasted. they cant afford a new one and are very unhappy and never touch ardu again. are you a mean person?

Going back to the cloud example: http://www.instructables.com/id/IR-Remote-Controlled-Color-Changing-Cloud-Arduino/

LEDs without resistors. Attaching four LEDs to a single Arduino pin to "make them dimmer"?

That's bound to wreck some people's LEDs/Arduinos, yet it would only cost pennies to put 7 resistors in there.

The page has had 24000 views and 215 people have favorited it. Is he doing them a favor or not?

PS: Wonder if he reads these forums? :slight_smile:

Grumpy_Mike:
OK I will try one more time, but this is a triumph of hope over expectation because you have ignored facts in the past.

I used to do this for a living so I have been involved with this process professionally.

Look at how reliability of a circuit is measured, calculated, worked out. An link, this is one of the first I found:-
Topic: Electronic/Electrical Reliability
Look at the bath tub curve. This shows that you can get a failure at any time but there is more chance of getting one early or late.

Read the bit about stressing components.

Now the more a thing is subjected to stress, the shorter is it's life, this applies for lots of things including electrical circuits.
[..shortened..]

Now do you understand why one sample tells you nothing about the reliability of a system design?

I see that this thread is "tense", but it continues to reveal itself very educational afterall !!

Now the more a thing is subjected to stress, the shorter is it's life, this applies for lots of things including electrical circuits

best part is you dont only learn something about electronics but about laws of nature and physics: cars, animal populations, bacterial cellmembranes or even relationships
:slight_smile:

fungus:

Hippynerd:
Which side is the correct side? left, right, or it depends on the circumstances?

Whichever side means you're not constantly swerving to avoid trucks.

If you were proposing some smart way of driving cross country to arrive sooner and use less fuel then we might listen but you're not. You're just saying that driving on the wrong side is possible under some circumstances.

Maybe so, but:
a) You're constantly dodging trucks (and one day they will get you)
b) You're not going to arrive at your destination any sooner, so why bother?
c) You're using more gas and wearing out more brake pads and tires. You'll get through more cars than people who just drive properly.

Have you noticed that all your analogies paint me as reckless? dodging trucks, and driving on the wrong side of the road. I would prefer it if you try to make up analogies that are less biased, because I dont like it when people try to passively insult me.

In your car analogy, do you drive half the speed limit, because its safer? it is safer isnt it, so why dont you drive half the speed limit. Are you unconcerned with safety? Are you a reckless person driving the maximum speed limit, or are you interested in safety, and drive half of the recommended maximum speed limit?

In the case of the charlieplexed RGB cube that uses no current limiting resistors (I assume this is what we are all talking about here...)
Its more like avoiding the traffic entirely, by taking the train instead. You can build this cube, and get it running in a very short period of time, it does not require any math, knowledge of ohms law, watts law, and you dont have to pour over dozens of datasheets making tons of calcualtions. It uses 2 different parts, LEDs and 1 microcontroller, so there are only 2 datasheets needed for the entire cube. Its not like dodging trucks, or driving on the wrong side of the road, its more like taking the train or flying.

Im not going to try to answer questions about someone elses project, its not my business, I dont have all the info and details that they have, so you should ask them, instead of me.

lax123:
I would love to see 1000 beginners building charliecubes, we could have a lot more data to help build better cubes. Right now, I've only seen a few charliecubes on the internet, so there is very little data.
Making up numbers based on nothing but your feelings isnt really any data. I have 2 cubes that have been running for months, one has resistors (now...) the other still doesnt. Its a very small sample, but the only data I have looks pretty good so far. Durable enough to sustain thousands of hours of service makes this design viable in plenty of circumstances.

Right now, I am planning on setting up a test rig to run some LEDs with some transistors, because I cant figure out what size base resistor to use with a sot23 2n2222 transistor, yes very common part, being used in a very common way. I have researched and calculated, and come up with too many different answers, and very little confidence that any of it is accurate.
so, I'll spend the day building some stuff, measuring, changing, measuring, until I get a good idea of what the real world statistics, which are often end up very different than the calculations.

Have you noticed that all your analogies paint me as reckless?

What you? You are a model of caution and good sense.

In the case of the charlieplexed RGB cube that uses no current limiting resistors

Oh that well maybe, tell me again what limits the current through the LED? If you think it is the constant switching on and off then tell me what the current is when it is on. Have you measured this or calculated this? Or heaven forbid have no idea at all, I am sure it can't be that as that would make you reckless and as you have said you are not reckless.

Everyone starts off being ignorant, that is no problem, it is how it has to be. I used to tell my students that ignorance was the prerequisite of learning. However choosing ignorance and forsaking learning, is what I can only describe as being supremely differently clever. Surley you are not that clever are you?

Hi Hippynerd,

I understand your desire for taking risks and having fun but I dont understand why you try to avoid to acknowledge fundamentals of physics or biology, atleast it seems to me this way.

The more you increase sheer stress on bacterial cellmembranes the probability for cracking their membrane increases. The more you poison someone with alcohol you increase the likelyhood of lethality. Of course there is always someone who withstands this pressure, if this was a common event natural selection comes into play.
All you are doing is gambling about probability, if it works its fun times, if it fails its "putting something into the garbage" times. Id rather not recommend someone to drastically increase chances to put something into the garbage, just because of 30cents or whatsoever.
The good part about maximum ratings is that you dont have to let build someone 1000 pieces of something as developers already did that for you and tell you at this point it might fail, it might not but chances drastically increase. I dont like to gamble to loose 50$ because of saved 30cents, you might, thats up to you.

Grumpy_Mike:

Have you noticed that all your analogies paint me as reckless?

What you? You are a model of caution and good sense.

In the case of the charlieplexed RGB cube that uses no current limiting resistors

Oh that well maybe, tell me again what limits the current through the LED? If you think it is the constant switching on and off then tell me what the current is when it is on. Have you measured this or calculated this? Or heaven forbid have no idea at all, I am sure it can't be that as that would make you reckless and as you have said you are not reckless.

Everyone starts off being ignorant, that is no problem, it is how it has to be. I used to tell my students that ignorance was the prerequisite of learning. However choosing ignorance and forsaking learning, is what I can only describe as being supremely differently clever. Surley you are not that clever are you?

Im pretty sure that you are intentionally making all the wrong assumptions, maybe you just chose to ignore what i've written. I have mentioned that I think the LEDs are not getting 5v (probably closer to 4.5v, and that maybe the other reversed LED in the circuit is having some current limiting effect. There is a limit to what I can measure, but I have made every attempt to measure things to the best of my ability.
You can take your subjective and defaming assumptions (clever/forsaking learning/ignorant...) and go politely choke on it, your interjections are all about you, and not about me.

Nobody is saying that you should never use a resistor, transistor, or other components, Im just saying that there are circumstances that using less parts can be more better, unless you think reliability is the only important thing. If thats how you think, then you wont find any value in using less parts.

Lax123, please tell me more about my desires, I always find interesting when folks want to tell me what im thinking and feeling.

Also, its not just about 30cents worth of parts, sometimes there are space or time constraints that may make things impractical. If you are trying to set up thousands of LEDs and you need to hook up thousands of resistors, that can more than double your build time, and make many other complications. Less parts is less complex, and less chances for failures, and reduced troubleshooting.

When something works, when its not supposed to work, it is interesting, and worthy of investigation, unless you find that scary, then you should let someone else mess with it.

Its been months, and im still waiting to put something in the garbage. but eventually I expect it will make it, I sadly have no idea how long that will take. I had expected it to last no more than a week.
The current game, only one part survives.

I have mentioned that I think the LEDs are not getting 5v (probably closer to 4.5v, and that maybe the other reversed LED in the circuit is having some current limiting effect.

I thought so you don't have a clue about what is limiting the LED current.

Let me tell you then, although given your track record you will probably not understand this.
The peak current is limited by the source impedance of the arduino output pins. This in effect is your resistor. The bad bit about this is that from my experiments I have found that you can get about 240mA from a single arduino pin. See this, these are real measurements and they surprised me as well.
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html
So that is more than the limit for a whole 328 chip going through one pin. I have pointed you at this web site before.
Oh an while we are on the topic of you not understanding things having read my decoupling tutorial:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
You come to the conclusion

Hippynerd:
I looked over mikes decoupling page, and things are still rather complicated and hard to understand everything, but its good to have that as a reference. As I understand it, if the caps arent quite right, there can be a lot of RF noise, and I guess its common for folks to just throw some caps at it, and be unaware of the noise issue. I dont like solving problems by making other problems, which is what im trying to avoid, while learning...

How on earth any one can come to the conclusion that using caps that are not quite right will GENERATE RF noise. That is a totally wrong conclusion and further underlines your credentials for giving advice to anyone about anything electronic.

Grumpy_Mike:

I have mentioned that I think the LEDs are not getting 5v (probably closer to 4.5v, and that maybe the other reversed LED in the circuit is having some current limiting effect.

I thought so you don't have a clue about what is limiting the LED current.

Let me tell you then, although given your track record you will probably not understand this.
The peak current is limited by the source impedance of the arduino output pins. This in effect is your resistor. The bad bit about this is that from my experiments I have found that you can get about 240mA from a single arduino pin. See this, these are real measurements and they surprised me as well.
LEDs
So that is more than the limit for a whole 328 chip going through one pin. I have pointed you at this web site before.
Oh an while we are on the topic of you not understanding things having read my decoupling tutorial:-
De-coupling
You come to the conclusion

Hippynerd:
I looked over mikes decoupling page, and things are still rather complicated and hard to understand everything, but its good to have that as a reference. As I understand it, if the caps arent quite right, there can be a lot of RF noise, and I guess its common for folks to just throw some caps at it, and be unaware of the noise issue. I dont like solving problems by making other problems, which is what im trying to avoid, while learning...

How on earth any one can come to the conclusion that using caps that are not quite right will GENERATE RF noise. That is a totally wrong conclusion and further underlines your credentials for giving advice to anyone about anything electronic.

As usual, you are just looking for ways to try to make me look bad. I did not say that caps will "GENERATE RF noise", but rather that I have read that if you dont have the right size cap, the result can be a noise issue, and I have also read that designers will just guess and stick a cap in, not notice any problem, and move on, but they may have a noise issue that is not being dealt with properly (like it would be with the correctly part). That post was over a week ago, are you digging through my post hoping to find some bit of dirt? LOL.

My "track record" as you put it, is only in your mind, its a fake construct that you have made to try to convince me that Im stupid and reckless, it only serves you, projecting it on me is just you being grumpy mike. I accept none of your projection, you get to keep that one.

But while we are on the topic of decoupling, Why dont the arduino tutorials have decoupling caps? It seems to me they should have a tutorial on decoupling caps, and include them in the tutorials that need decoupling caps.

whats your point ? sry im not english so i maybe missed this.

using no resistors in that construction is within specifications or beeing above max ratings is a fun place to be?

@Hippynerd

As usual, you are just looking for ways to try to make me look bad.

I am trying to illustrate to you that you don't know enough to offer anyone any advice because you do not know what you are doing.

I did not say that caps will "GENERATE RF noise", but rather that I have read that if you dont have the right size cap, the result can be a noise issue,

The noise issue already exists without adding any capacitors. When you add capacitors you reduce this. If you do not use the right type then you will not reduce it enough.
Your comment

I dont like solving problems by making other problems,

Is totally nonsensical, even more so if you are saying you don't believe it will generate noise, so what other problems were you referring to that you think is caused by the wrong type of decoupling capacitor. You seem to understand even less that I thought, which is going some.

My "track record" as you put it, is only in your mind,

Odd that, so I can copy an paste from my mind - cool. Your track record is just that, a record and it is on the forum for all to see, I don't have to make anything up.

I accept none of your projection, you get to keep that one.

No I don't expect you do, it is a trait of the self delusional.
I expect these suppliers were impressed when they posted those parts to
Hyppynerd Institute for Tech and Science - how many employees do you have in that institute then.
And why post a picture showing what a little boy you are?

That post was over a week ago, are you digging through my post hoping to find some bit of dirt? LOL.

The group 'Radiohead' - the song 'Just', work it out.

Why dont the arduino tutorials have decoupling caps?

A very good question and one that I do not know the answer to. See I don't claim I know everything.

Hippynerd:
In your car analogy, do you drive half the speed limit, because its safer? it is safer isnt it, so why dont you drive half the speed limit. Are you unconcerned with safety? Are you a reckless person driving the maximum speed limit, or are you interested in safety, and drive half of the recommended maximum speed limit?

I always felt the safest speed to drive at is the same speed everybody else is doing. Driving half speed causes unexpected circumstances for other people.

OTOH you just broke the original analogy by taking it too far.

PS: You still didn't answer about the 'cloud' guy, he resembles you in many ways. Yes he's lighting up some LEDs, but his 'designs' are going to break people's parts. What's your opinion on that?

Have you noticed he is more interested in peoples perceptions of him than the actual technical aspects of electronics.