# Can Arduino Mega power led flicker candles?

I'd like to try using the mega to power about 50 of these types of LED candles: http://www.amazon.com/Lilys-HomeTM-Everlasting-Tealights-Battery-Operated/dp/B00466VDJQ/ref=sr_1_2?ie=UTF8&qid=1358521666&sr=8-2&keywords=led+flicker+candles So that I'm able to control the power to each one independently. If I just pull the battery and run an output to the power contacts of the candle, will the Mega be able to supply enough power to run these? And be able to power all 50 simultaneously? If not, can anyone point me in the right direction for pulling this off? Thanks

What voltage does the battery supply (how many are in series)?
Do you have a multimeter capable of measuring the current? (That is really the key question to if the Mega can supply all.)

Otherwise it is fairly easy to use a driverchip (one that is a simple "amplifier" for each pair of wires)

The manufacturer claims that the candle lights work for 120 hours with one CR2032 battery. Such a battery has a capacity of about 225mAh which means the average consumption must be below 2mA at 3V. Driving 50 of them results in 100mA of current which should be possible for the Mega, even on 3V3. You cannot drive them by the GPIO (digital outputs) directly because they supply 5V and not 3V, you have to use at least a transistor for each.

Nice bit of detective work, pylon. So now dblejeune just needs to use a LED-Resistor calculator to limit the current (and thus drop the voltage)and hope that works. At least it is worth a test.

So now dblejeune just needs to use a LED-Resistor calculator to limit the current (and thus drop the voltage)and hope that works.

If the candle light is just one LED, this is correct. It's claimed that they flicker in some kind and that sounds like an electronic circuit controlling multiple LEDs. That would mean the current consumption is probably not constant and you cannot just use one resistor to have a constant voltage. Just my two cents :).

So, one of you said resistor, I understand how that works. The other said transistor, which I don't understand. Could you elaborate please? Thanks a lot guys.

Look at Transistor Circuits

I was at a get together at a friend's house and he had a bunch of these lights (paid ~\$8 at Sam's Club for 24, plus an extra battery for each!) and suffice it to say disassembly was a top priority. Inside it's just a battery, a switch, and the LED. The LED contains whatever circuitry/design is required to make it flicker.

I can't find any of these LEDs with a datasheet for more detail, but I see that EvilMadScience sells them .. as well as eBay, pretty much everywhere...

50 LEDs at 20ma (total 1A) is going to be too much for the Arduino to power. If you want to switch them individually then you should use something like a 74HC595. If you want to put them into a few large groups then Msquare's link above is a good choice.

So, the shift register actually looks like a really nice way for me to accomplish what I want to do. Basically all lights are on, then they go out in a chase sequence. So, each of my shift register outputs would have a transistor that feeds power to the candles from a separate power source?

If you use a TPIC6B595 then you will not need any external transistors (chip is capable of 150ma per output or 500ma total). You still need a resistor. If you use a TLC5916 then you will not need any output resistor (one resistor per chip sets output current).

There are lots (LOTS) of "shift register" type chips to choose from.

Cool. Checking those out now. Would the voltage input for the shift register need to come from a different power supply, or would I be able to use the 3v from the Arduino?

So, will the 3v provided on the board be enough? Or is it subject to the same limitations as the outputs?

There are other pages on this site, other than the forum, you know. One, quite easily to get at from the front page, "Products" show the basic specifications: 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.

Msquare:
There are other pages on this site, other than the forum, you know. One, quite easily to get at from the front page, “Products” show the basic specifications: 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.

Actually the maximum current draw specification for a shield’s 3.3vdc pin is a little complex due to legacy history. The current uno and meg2560 boards have a on-board 3.3vdc voltage regulator that is certainly able to supply more then 50ma of current, 100-150ma is probably possible without issue. However older arduino boards that used FTDI USB serial converter chip used the build in 3.3vdc regulator inside the FTDI chip which did carry a 50ma maximum current specification and the FTDI chip could be damage if one drew more then that amount of current from the shield 3.3vdc pin.

So what is a poor commercial shield developer to do? If they design a shield that draws more then 50ma from the attached control board’s 3.3 pin then it would work for current Uno boards but might very well break older arduino boards that used the FTDI chip. That is why you will see that most commercial shield boards that require the use of 3.3vdc have their own on-shield 3.3vdc regulator, rather then draw current from the 3.3 pin.

So the Arduino folks are taking the prudent position by stating that the maximum current to be drawn from the shield 3.3 pin should be limited to 50ma or less, more for legacy compatibility then a actual technical limitation on current arduino board designs.

Lefty

Fair enough. I have practically no experience with this, so sorry if I'm coming off a bit noob-ish. Is it possible to just split off of the 5VDC power supply that is running the Arduino, and feed the input of the shift registers with that?

Specifically which 5V? The VIN pin is a copy of the "raw" supply, ie what you put into the barrelconnector (minus a diode). You should use 7V - 12V there, but my experience is that 5V works (even though that means the 328P chip gets lower voltage, but it seems to run fine). So if you meant "split off" the WallWart/External supply, you can do so at this pin.

The 5V pin is after the regulator or the USB supply. There is roughly 500mA available there (less is preferable). We still do not know how much mA those LEDs actual do require...?

Gotcha, that’s what I was looking for, thanks. I haven’t gotten the LEDs yet, but the diodes that Chagrin linked pull 30 mA, so I’ll probably be dealing with something similar. I looked at the TLC5916 chip, and can’t find any mention of how/where to use a resistor for output current, but I’d prefer to do it that way for simplicity. Any insights on how that works?