0

Sorry for having (again) a beginners question, but I was wondering something.

If I would want to drive like 20-30 LEDs from an Arduino (Uno), and I want to use an external adapter (12V, 1A), going into the Arduino, in what way I should drive the LEDs?

Problems I see:

  • I cannot connect too many LEDs per pin (max 20mA per pin)
  • I cannot connect too many LEDs per 'group' (I have to find out which pins are connected to what groups)
  • I cannot connect too many LEDS in total because of the max. 200 mA per VCC/GND (there are 2 or 3 GNDs, so that should be ok)
  • Using a relay/transistor etc, but how do I get the power? (there are also only 2 VCCs for 200 mA max)

So my basic question: how can I use the 1A from my adapter?

  • 1
    How precisely do you want to control the LEDs? – Majenko Jun 13 '17 at 14:28
  • 1
    Have you considered using a driver that works with 12V? – Ignacio Vazquez-Abrams Jun 13 '17 at 14:33
  • 1
    Using relay module if you don't want to controle every single led could be a good aproach like this one - arduinobasics.blogspot.com.br/2014/09/relay-module.html – Andrew Paes Jun 13 '17 at 14:35
  • 1
    drive each control group with an n-chan mosfet disconnecting the ground; cheaper than relays and silent. be prepared to use resistors to balance R,G, and B LED's "brightness" – dandavis Jun 13 '17 at 14:37
  • 1
    I don't mean what hardware you think you want to use - I mean what do you want the LEDs to do? – Majenko Jun 13 '17 at 14:42
1

The simplest thing you can do is group the LEDs together into chains that almost add up to the voltage of the power supply.

If you have LEDs with a 2V forward voltage (typical red LEDs) you could have up to say 5 per chain.

Each chain, since it only has 20mA or so maximum, can be driven with a simple small transistor.

schematic

simulate this circuit – Schematic created using CircuitLab

Connect the 12V to either VIN or the barrel jack, and also drive the LED chain through a suitable resistor (R=V/I = (12 - (Num LEDs * Forward Voltage)) / 0.02). You can have as many chains as your supply can provide current for.

  • That sounds good ... would it be useful to use the ULN8023 (instead of the transistors)? – Michel Keijzers Jun 13 '17 at 15:01
  • (and where does the maximum of 20mA per chain comes from? I would say 20 mA (per LED) * 5 LEDs = 100 mA) – Michel Keijzers Jun 13 '17 at 15:02
  • 1
    Being darlingtons you get a larger voltage drop than just a transistor. You may not get it quite as bright. Other than that, it could be a convenient way of reducing component count (a chip instead of transistors) – Majenko Jun 13 '17 at 15:02
  • 1
    Components in series have the same current but sum the voltages. Components in parallel have the same voltage but sum the current. The LEDs are in series, so they share the same current - 20mA, but sum their voltage - 2V each is 10V, leaving 2V for the transistor and the resistor. – Majenko Jun 13 '17 at 15:04
  • Oh off course (now I feel really stupid). – Michel Keijzers Jun 13 '17 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.