Pages: [1]   Go Down
Author Topic: Are Resistors Mandatory?  (Read 1015 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged


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

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

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)

Logged


Offline Offline
Edison Member
*
Karma: 29
Posts: 2448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For driving leds directly from arduino yes... always
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 146
Posts: 5507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, is a resistor required in this case?

YES!
Logged

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

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

For driving leds directly from arduino yes... always
except when pin was placed in INPUT_PULLUP mode.
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12179
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Offline Offline
Edison Member
*
Karma: 29
Posts: 2448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Heaven forfend.
Logged

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

Offline Offline
Edison Member
*
Karma: 29
Posts: 2448
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: