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.
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
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)
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...
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...
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...
you are just using more components to shift the problem somewhere else