Arduino Forum

Using Arduino => Project Guidance => Topic started by: dblejeune on Jan 18, 2013, 04:11 pm

Title: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 18, 2013, 04:11 pm
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
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 18, 2013, 05:22 pm
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)
Title: Re: Can Arduino Mega power led flicker candles?
Post by: pylon on Jan 18, 2013, 06:01 pm
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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 18, 2013, 06:09 pm
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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: pylon on Jan 18, 2013, 07:01 pm
Quote
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 :).
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 18, 2013, 07:09 pm
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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 18, 2013, 07:29 pm
Look at http://www.kpsec.freeuk.com/trancirc.htm
Title: Re: Can Arduino Mega power led flicker candles?
Post by: Chagrin on Jan 18, 2013, 08:19 pm
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 (http://evilmadscience.com/component/content/article/1893) 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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 18, 2013, 08:34 pm
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?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: Chagrin on Jan 18, 2013, 09:44 pm
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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 18, 2013, 10:21 pm
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?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 21, 2013, 04:15 pm
So, will the 3v provided on the board be enough? Or is it subject to the same limitations as the outputs?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 21, 2013, 04:47 pm
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.
Title: Re: Can Arduino Mega power led flicker candles?
Post by: retrolefty on Jan 21, 2013, 05:01 pm

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
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 21, 2013, 05:03 pm
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?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 21, 2013, 05:26 pm
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...?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: dblejeune on Jan 21, 2013, 09:41 pm
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?
Title: Re: Can Arduino Mega power led flicker candles?
Post by: 3dprinter on Jan 21, 2013, 10:01 pm
We are talking about http://www.ti.com/lit/ds/symlink/tlc5917.pdf ?

It says on the front page: The constant sink current for all channels is set through a single external resistor. So I flip forward to a pinout spec - page 4 - where it says R-EXT External Resistor - Connect an external resistor to ground to set the current for all outputs. The diagram shows that as pin15. Zipping forward looking for a curve or formula for R-ext (it is a PDF and there is a search function in the Reader) - where I find on page 15 a nice chart and a summary: the default current is approximately 52 mA at 360 ? and 26 mA at 720 ?. At least unless you program the VG (Havn't bothered to find out how)

SO if you put a 1K resistor it is down to 20mA.

Yes, reading spec sheets is difficult, one needs to try it, often, re-read it several times.