Wiring l.e.ds to "chase"
Topic: Wiring l.e.ds to "chase"
(Read 2262 times)
Old And In The Way
I learn a bit every time I visit the forum.
Re: Wiring l.e.ds to "chase"
Feb 15, 2012, 12:13 am
The resistors are there to keep too much current from going through the leds. For a straight 5V to ground with a standard 5mm red led the normal answer is use 220 ohm but I find that bright and go with 470 ohms.
And there's a bigger reason to use the resistors. For the current to be drawn through a led it comes from a pin. Arduino pins can take having 40 mA drawn through their circuitry but 20 mA as a practical limit is smarter. 5V / 220 Ohms = 22.7 mA. You can take that straight to ground without burning your pin up. More resistance only makes less current draw.
Until you learn Ohm's Law and some corollaries I think you will be between cookbook and experiment. In that case, more resistance makes the light dimmer and much less resistance might make it real bright for a very short time.
Here's a lot of already typed info on using leds:
Not all leds are the same. It's best to check. If you can't and don't have a meter then start out with a high value resistor and go to less resistance until the led is bright enough. If it needs to be massively brighter then look at ultrabright leds and then the big high power leds that need heat sinks.
If the led chase is to be a simple pattern like for every 5 leds in a row, only one is on then you only need 5 pins, 5 transistors with 1 resistor each and a resistor for every led. You'd connect each pin through a resistor to a transistor powered by external power supply with enough Amps to power 1/5th of your leds at once and the output from each transistor go to the 1st, 2nd, etc, led and resistor in every group of 5. Your Arduino would turn 1 pin on at a time in sequence, wait long enough for the light to be seen (1/10th of a second?) and switch to the next, over and over. I chose 5 because your number of leds divides well by 5.
Nick Gammon on multitasking Arduinos: