0
\$\begingroup\$

Can an Arduino turn on multiple leds at the same time?. I want make a home made lamp with several less controlled with an Arduino UNO light sensor and i already have the light sensor, also i know how to turn on one led.

But do not know if i can power several less.

Any advise?, thanks in advance.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Just FYI. There is now a stack dedicated to Arduino arduino.stackexchange.com \$\endgroup\$ Commented Apr 11, 2014 at 22:38
  • \$\begingroup\$ Where you say "less" do you mean LEDs? \$\endgroup\$
    – David
    Commented Apr 11, 2014 at 22:47
  • \$\begingroup\$ @david context says yes. I blame auto core ect. \$\endgroup\$
    – Passerby
    Commented Apr 11, 2014 at 22:54
  • \$\begingroup\$ For a lamp, you don't want to use an Arduino to drive the leds, you want the arduino to control an LED DRIVER. Which is as simple as a NPN Transistor. \$\endgroup\$
    – Passerby
    Commented Apr 11, 2014 at 22:58
  • \$\begingroup\$ yes it is leds and yes… it is the autocorrect T.T, thanks guys. I want to make an small tutorial "easy and cheap to do", so i do not want expensive things involved and maybe led driver will be a little bit more expensive. \$\endgroup\$
    – mrmurmanks
    Commented Apr 11, 2014 at 23:43

2 Answers 2

3
\$\begingroup\$

The Atmega328 chip used in many Arduinos has a limit on the amount of current it can provide directly. You can find this in the datasheet section 28.1 page 313.

  • A limit per pin - 40 mA max.
  • A limit per IC total - 200 mA max

schematic

simulate this circuit – Schematic created using CircuitLab

If you are using the Atmega IO pins to turn on transistors (FETs or BJTs) and use the 5V or 3.3V supply to provide current to the LEDs through these transistors then there is no problem with the Atmega328 current limits.

schematic

simulate this circuit

FET circuits are simpler. For larger numbers of LEDs it may be better to use a suitable LED-driver IC instead of using large numbers of transistors.

The voltage regulator on the Arduino board that is providing regulated 5V or 3.3V power will itself have a limit which may also prevent you using it to drive a large number of LEDs (or a lower number of high-power LEDs).

\$\endgroup\$
2
  • \$\begingroup\$ I was searching on the arduino web i found that info (40mA for every port), searching for some leds at the local web store i found a high brightness led (20mA ech one), i will try to attach one led ( checking the brightness ) and later try to attach to less on series (40mA). The transistor thing will be nice and useful i will research a little bit more. \$\endgroup\$
    – mrmurmanks
    Commented Apr 11, 2014 at 22:34
  • \$\begingroup\$ Be careful not to draw too much current from the on board voltage regulator. As Klaus Warzecha strikingly wrote over on Arduino.SE: "The Arduino is just the brain, not the power station." \$\endgroup\$
    – jippie
    Commented Apr 12, 2014 at 10:16
-1
\$\begingroup\$

Yes, an Arduino can turn on multiple LEDs (nearly) at the same time. The code you have to write is probably very similar to what you have now. Just attach the other LEDs to the other ports on your Arduino.

\$\endgroup\$
1
  • \$\begingroup\$ so i can turn on several less using several ports… nice, thanks. \$\endgroup\$
    – mrmurmanks
    Commented Apr 11, 2014 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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