Go Down

Topic: Are Resistors Mandatory? (Read 1 time) previous topic - next topic

dotJason

In my LED build they are connected to digital pins, illuminated with analogWrite(3,x) where x is a loop-generated PWM value between 0 and 150.  When I meter it on my bench Agilent the mA peak never exceeds 16mA.  So, is a resistor required in this case?

FWIW - The same LED when metered on analogWrite(3,255) pulls 57mA.  That's bad news I think; however, except for botched code it won't happen in the actual routine.

Thanks.

Osgeld

I know the Agilent's I use puke on their shoes if you read them faster than once a second, so ... what is your real peak current?

in a nutshell its sampling at X frequency and averaging them, in reality you are pulsing around 57ma really fast, which may be fine for your LED but is beyond spec for the AVR

and yes I would use a current limiting device regardless cause the forward voltage of the led will change with temperature and time

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

dotJason

Yea, I see your point.  I want to limit the draw to 20mA MAX, right?

Osgeld

pulsing a led usually can be quite higher than a constant on in terms of current, 40ma is the absolute max for a single pin of the avr on the arduino (250ma total for the whole thing)

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

cjdelphi

For driving leds directly from arduino yes... always

fungus

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

tock


For driving leds directly from arduino yes... always

except when pin was placed in INPUT_PULLUP mode.

cjdelphi

One solution would be to connect the pin to a transistor via a 1k resistor then you need not worry about current draw at all... using pwm to the base pin will allow analogWrite to work...

Runaway Pancake


One solution would be to connect the pin to a transistor via a 1k resistor then you need not worry about current draw at all... using pwm to the base pin will allow analogWrite to work...


Maybe you could sketch that out?
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Osgeld


One solution would be to connect the pin to a transistor via a 1k resistor then you need not worry about current draw at all... using pwm to the base pin will allow analogWrite to work...


you are just using more components to shift the problem somewhere else
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

MarkT

You need to limit the current somehow - either by a resistor or by a constant current driver of some sort.

So resistors are not mandatory if you have a constant current driver chip / circuit.
[ I won't respond to messages, use the forum please ]

cjdelphi



One solution would be to connect the pin to a transistor via a 1k resistor then you need not worry about current draw at all... using pwm to the base pin will allow analogWrite to work...


Maybe you could sketch that out?


Never used a transistor before? I'll gladly teach you....]

Runaway Pancake


Never used a transistor before? I'll gladly teach you....]


Heaven forfend.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

cjdelphi

Sorry never like Baited questions... esp when the person skips facts

Go Up