Go Down

Topic: 12 LEDs on Arduino Uno (Read 561 times) previous topic - next topic

Nevris

Hi, I read few topics here and got informations that only 10 LEDs can be controlled on Arduino without any chips just output pins. I know that 1 output pin have 40mA and LED about 15-20mA, 2 LEDs = 30mA or 40mA so I can handle 2 LEDs on 1 pin, how could I do it exactly ? Use transistor, 2 zener diodes or some other solution ? If you can inster some image as well it will help me a lot, thanks.

CrossRoads

An Uno can do 20 LEDs, one on each IO pin if you want. If you want them all once, you need 20 current limit resistors to limit the total current to 200mA, or 10mA/LED. The 328P in 28-pin DIP package has only one VCC and one GND pin and they are limited to 200mA.
If you have 2.5V Vf LEDs, then (5V - 2.5)/.01A = 250 to 270 ohm current limit resistor per LED.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nevris

Im using 270 ohm resistor per LED, not sure of their voltage but probably they have 2.5V.
2 of the LEDs in my circuit are connected like this:

270 ohm resistor from positive to LED anode and cathode to GND, from this LED anode and cathode I placed 2 wires to second LED anode and cathode to connect them together then 270 ohm resistor to positive. I have them connected like this 6 times. I tried to change a resistor of one LED but the brightness stays the same and chip on Arduino get a little hot.

CrossRoads

Sounds like you have 3 LEDs connected in parallel. If the Arduino microcontroller is getting hot, that usually indicates a pin has been overcurrented, and it's just a matter of time until the entire chip fails.

Draw a picture, take a picture with your phone and Attach it. Post your code using the </> button so it ends up in a code box.
Code: [Select]
like this
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nevris

#4
Nov 17, 2017, 04:37 am Last Edit: Nov 17, 2017, 06:15 am by CrossRoads
Image attached, but if it comes to my code, I don't want to publish it for this time. I can send you in PM.

CrossRoads

Looks like too many LEDs being driven from too few pins.
A schematic would make it clearer as to the wiring.
12 LEDs, 3  buttons, put each one on it's own pin, and digitalWrite 2 or 3 or 4 pins as one set of directions to turn them on/off at the same time. Will occur so fast,microseconds apart, that it will look simultaneous.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nevris

Like I said, 2 LEDs on 1 pin. I cant use 1 pin for 1 LED because i need them to connect LCD display and 2x LM35 temperature sensors.

Go Up