Hello.
I'm new to Arduino,but yet I have a project in my mind. I wanted to create something with LEDs, then I had a question in my mind about how to use as MANY LEDs as possible, in a single Pin ?
In this project I plan to link 4 LEDs in a single Pin, for all 12 PINS,which means 48 LEDs.
.
A pin Output is 5v, and its max current without damaging the pin,is 20mA. So I turn on the LEDS with a current flow by 10mA each. The LEDs will not shine so bright, still its appropriate for me.
.
So, anyone can tell me if I am correct?
Is my project Right ?
.
Down is a representation of a circuit from a single pin.
Sorry the schematic is wrong. You can not assume the current will split like that. Each pair of LEDs needs its own resistor.
Also if you want to do this on all pins be aware of the 200mA total current limit on the power input pin and also of the collective limits on each of the output ports. See the data sheet for the processor chip for these limits.
Mike.
Well, okay. I will not use only 1 Resistor, but 2 Resistors: one for each branch. And also I will use 10 pins: A total of 40 LEDs & 200mA.
I guess thats ok,isn't it?
I would not do that. You are right at the limit of the chip, which will reduce its life in the long term. Plus there are more limits for certain combinations of pins, and you might exceed those, damaging the chip.
Question: what do you want to do with the 40 LEDs? Are you connecting 4 each to 10 pins because you want to control each group of 4 individually? Or will all 10 groups be switched on and off together?
Paul.
You are right that I will be at the limit.
But for safety, i will use maybe 7-8 pins, not going to the limit.
The reason I wanna do this, is to make something cool & simple, for example a cube, or a sign or anything, switching them On and Off, in different patterns. So i guess there ll be no problem.
The could still be a problem. The limits for the groups of pins that I mentioned.
The data sheet says
Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
ATmega48PA/88PA/168PA/328P:
1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100 mA.
2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA.
3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition.
This is in addition to the total limit on the power pin of 200mA, meaning what you can draw from the individual pins should not be allowed to exceed about 180mA.
For what pin number on the Arduino corresponds to what bit on what port see this
If you want to light up lots of LEDs then use a shift register.
Use a transistor to drive all the LEDs. Wire base of each transistor through a resistor (usually 1k to 10k) to Arduino pin. Collector of the transistor connects to cathode end of the LED, emitter to ground. Anode of LED with current limiting resistor to power source.
This way you can have as many LEDs as you want.