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.
-
1\$\begingroup\$ Just FYI. There is now a stack dedicated to Arduino arduino.stackexchange.com \$\endgroup\$Nick Alexeev– Nick Alexeev2014年04月11日 22:38:24 +00:00Commented Apr 11, 2014 at 22:38
-
\$\begingroup\$ Where you say "less" do you mean LEDs? \$\endgroup\$David– David2014年04月11日 22:47:28 +00:00Commented Apr 11, 2014 at 22:47
-
\$\begingroup\$ @david context says yes. I blame auto core ect. \$\endgroup\$Passerby– Passerby2014年04月11日 22:54:33 +00:00Commented 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– Passerby2014年04月11日 22:58:41 +00:00Commented 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– mrmurmanks2014年04月11日 23:43:53 +00:00Commented Apr 11, 2014 at 23:43
2 Answers 2
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
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).
-
\$\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– mrmurmanks2014年04月11日 22:34:39 +00:00Commented 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– jippie2014年04月12日 10:16:33 +00:00Commented Apr 12, 2014 at 10:16
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.
-
\$\begingroup\$ so i can turn on several less using several ports... nice, thanks. \$\endgroup\$mrmurmanks– mrmurmanks2014年04月11日 22:31:00 +00:00Commented Apr 11, 2014 at 22:31