Pages: 1 2 3 [4] 5   Go Down
Author Topic: Externally powering LEDs so Arduino doesn't fry  (Read 5431 times)
0 Members and 1 Guest are viewing this topic.
Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
http://www.hobbytronics.co.uk/arduino-atmega328-pinout

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.
Logged


Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5633
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

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.


Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged


Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5633
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5633
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5633
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? smiley
« Last Edit: February 08, 2013, 08:03:36 am by fungus » Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:-
http://www.ece.cmu.edu/~koopman/des_s99/electronic_electrical/
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 !!
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
:-)
Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Manchester (England England)
Online Online
Brattain Member
*****
Karma: 631
Posts: 34502
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Have you noticed that all your analogies paint me as reckless?
What you? You are a model of caution and good sense.

Quote
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?
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 08, 2013, 03:29:24 pm by lax123 » Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Have you noticed that all your analogies paint me as reckless?
What you? You are a model of caution and good sense.

Quote
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.

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

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.

Logged


Manchester (England England)
Online Online
Brattain Member
*****
Karma: 631
Posts: 34502
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
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.
Logged

Pages: 1 2 3 [4] 5   Go Up
Jump to: