LED array clock--power questions - Page 1
Forum section: electronics / projects

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 02:25:50 am
content: So my project that I want to make is a LED clock, with the month, day, day of the week, and hour/minute/second time represented with 1 led per unit (194 leds total.) This would take 25 74HC595 shift registers. I want to control it with an arduino, and I just need to know how to power it all, and what resistors to put on the leds.(Sorry if this is newbish, this is the biggest thing I've ever tried. Most of the time, I'm a programmer.)

author: jeroen79
author_rank: Frequent Contributor
timestamp: July 16, 2015, 02:37:08 am
content: For power you need a DC powersupply that can deliver the voltage and current needed by the LEDs and controller.5V can be used.You determine which resistors to use based on their forward voltage, current draw and the supply voltage.Or use an onlineled calculator.You can reduce the number of shift registers by setting the LEDs up in a matrix rather than giving each a dedicated output on a shiftregister.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 02:50:24 am
content: Thanks, I used one of the calculators, and it said it would be 3880 mA. Also, I need to be able to control each led individually.I found a decent 5v 4A supply on amazon, but the arduino requires 7-12v in.Also, is there some way to do it with a 18.6v 6.5A laptop supply?

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 03:02:09 am
content: Quote from: xdbx on July 16, 2015, 02:50:24 amThought questions:1. How many LEDs do you need to turn on at once?2. What are the current and power ratings of the Arduino's onboard 5V regulator?3. Can you bypass that Arduino regulator?

author: Whales
author_rank: Super Contributor
timestamp: July 16, 2015, 03:07:59 am
content: Most Arduinos (eg Uno, Mega) are 5V devices. You can power them with 5V directly or with above ~7V through their regulators.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 03:13:49 am
content: Quote from: edavid on July 16, 2015, 03:02:09 am1. In theory, the maximum would be 193 leds for one second. (Sunday, 31 December, 23:59:59).2.http://www.amazon.com/gp/product/B00E5WJSHKThis is the board, I can't see the part number, but the description implies it is 500mA.3. What do you mean by bypass?

author: dadler
author_rank: Unknown
timestamp: July 16, 2015, 03:29:13 am
content: As has been mentioned, you should consider scanning through, say, each digit in sequence. That is, only light a subset of the LEDs at any one time, and scan through them in your code. If scanned fast enough, you can take advantage of persistence of vision to offer the appearance of all LEDs being on at the same time. Further, you drastically reduce the current requirements and will not need that crazy number of shift registers.

author: dadler
author_rank: Unknown
timestamp: July 16, 2015, 03:30:46 am
content: Check this video out for an implementation of this type of approach:http://youtu.be/Ov27rac0tP0

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 03:39:01 am
content: Quote from: xdbx on July 16, 2015, 03:13:49 amOK, that wasn't clear, since it would be just as valid to only turn on e.g. the Sunday LED.QuoteSo obviously you can't power a 4A project that way.QuoteDon't use it. (Although there's no reason why you couldn't use separate power supplies for the Arduino and the LEDs.)

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 03:40:35 am
content: Quote from: dadler on July 16, 2015, 03:29:13 amSince LED brightness is proportional to average current, multiplexing does not reduce the current requirements. In fact, if he really needs 20mA DC to get the brightness he wants, multiplexing won't even work.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 03:51:02 am
content: Quote from: edavid on July 16, 2015, 03:39:01 amI figured it would have to be separate supplies, and yes, I need decent brightness,so I would need most of the 20 mA.

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2015, 03:54:37 am
content: Modern high efficiency LEDs are usually bright enough for nearly all applications with If in the 4 to 10 mA range. If you keep If under 9mA, a 5V 2A adapter will power it, and 5V 2A USB chargers are as common as dirt.Hook up a sample of a couple of the LEDs you intend to use, with a resistor chosen to pass 8mA and see if its bright enough for you.I suspect that if you run them at 20mA, 193 of them would be bright enough to illuminate a large room!

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 04:06:22 am
content: Yeah, they are actually quite bright at that level!

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 04:24:22 am
content: And to make sure, I could put separate +5v and ground into the 595s and the arduino, right?This schematic from the arduino example looks like the only necessary connections to the microcontroller are the data, latch, and clock.

author: P_Doped
author_rank: Contributor
timestamp: July 16, 2015, 04:51:24 am
content: If you plan on driving 20mA potentially from each output of a 74HC595, I think you'll run into supply current limits.Looking at an NXP version of the part, even though a single I/O can source/sink 35mA, the whole chip can only handle +/- 70mA.If you are serious about this drive level, you may want to place some type of intermediate driver (the Darlington type ULN series used to be quite popular; I'm sure there's a better modern version more appropriate if one looks) between the 74HC595 and the LED circuit.

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 05:03:14 am
content: Quote from: xdbx on July 16, 2015, 04:24:22 amNo. You definitely need a common ground. It's better to use the same supply for the Arduino and the 595s or whatever.You would normally drive the LED cathodes, since the 595s and most other drivers have more drive in the low state.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 05:49:51 am
content: No, I'll be using it at 8 mA.

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2015, 06:04:57 am
content: You may do better to look at dedicated multi-channel constant current LED driver chips. That way you can loose all the LED series resistors except for one per chip on older LED drivers to sert the current, and you get 16 or more individually LEDs per chip so the total part count will be much lower. Unfortunately, PDIP package LED drivers are getting rather rare so you'll need to find ones on a breakout board or with a package that is hand-solderable.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 06:16:33 am
content: Quote from: edavid on July 16, 2015, 05:03:14 amOh, okay. Thanks.

author: Corporate666
author_rank: Unknown
timestamp: July 16, 2015, 07:03:10 am
content: Ditch those 74HC595 chips. Look at STP08DP05. It's also a shift register, but each line has a constant current (up to 100mA per line, 800mA for the whole chip) LED driver. You can daisy chain the shift registers by dumping the serial out of one into the serial in of the next, so you use 4 lines for your whole project. You also don't need resistors. I think there is a voltage overhead of 0.6V or something thereabout, so you ideally want your power supply to be just about 0.6 volts above your LED forward voltage - that way you aren't dissipating too much heat in the shift registers.EDIT: If you need a through-hole package, look at TLC5916. Pretty much the same as the above STP08DP05, except it's in a DIP package and supports 960mA total ground pin current, more than you need.DIP won't have the same power dissipation as TSSOP though, so again, be sure to run your voltage supply at the lowest level possible for your LED's to minimize dissipation in the chip (it's a linear device after all).

author: MarkF
author_rank: Super Contributor
timestamp: July 16, 2015, 09:11:58 am
content: I think you should check out the MAX7219 Serially Interfaced, 8-Digit LED Display Drivers and readthisArduino page.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 02:57:17 pm
content: Quote from: Corporate666 on July 16, 2015, 07:03:10 amQuote from: MarkF on July 16, 2015, 09:11:58 amIs there any real advantage to using these,other than less soldering to do? I don't need that much current, even at 8 mA the leds were quite bright, and the 595s can handle that. The 595s daisy chain as well.

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2015, 03:37:42 pm
content: It depends. Many of the constant current multiple LED driver chips offer convenient dimming, either for all the channels together or for individual channels, and ambient light level controlled dimming is a very nice feature for a LED clock to have, especially if it is used as an alarm clock.However it is possible to dim LEDs connected to '595 chips, by PWMing all the /OE pins, and if you already have the '596 chips and resistors, the only thing you wll save for a one off is board area and number of joints to solder.

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 03:46:44 pm
content: Ah, okay. In that case, I'll just use the 595s. I only plan on making 2, and they're likelygoing to be wall clocks anyways, so dimming isn't really a big deal.

author: Rolo
author_rank: Regular Contributor
timestamp: July 16, 2015, 04:01:06 pm
content: Quote from: xdbx on July 16, 2015, 03:46:44 pmYou might take a look at the WS2803. 18 pwm outputs, no resistors, cheap and can be chained. Two wires needed.

author: Corporate666
author_rank: Unknown
timestamp: July 16, 2015, 05:12:41 pm
content: Quote from: xdbx on July 16, 2015, 02:57:17 pmUpsides would be...-With the 595, you're at 64mA on the LED's (plus perhaps a little for the logic), it's rated at 70mA so you're close to it's limit. I never like running things near their limit.-With the chips I mentioned, you have higher overall brightness available to you, more than double what you get with the 595-With the STP08 or TLC5916, you don't need the resistors. All they do is generate heat and are an additional cost and take up board space.The STP or TLC are basically drop in replacements for your 595 in terms of how they are driven and the software. The only difference is you ditch the resistors, flip your LED's the other way around and run them common anode instead of common cathode.I guess I'd turn the question around... what would the reason be to use the 595's instead of the STP or TLC? Of course do whatever suits you and if you already have the circuit built or don't want to wait for free samples of the STP/TLC, then your circuit will work - I just think it has some drawbacks compared to a chip designed to drive LED's.

author: Corporate666
author_rank: Unknown
timestamp: July 16, 2015, 05:39:59 pm
content: Quote from: Rolo on July 16, 2015, 04:01:06 pmHave you used that chip in any designs? I looked at the datasheet and it seems really convenient that it has 18 ouputs and more importantly clock out! Why don't any of the other CC LED driver chips do that... it makes laying out the board SOOO much easier without traces that have to go "up and around" each chip.If you've used these, where did you source them? I can't find any pricing or availability - does WS sell direct?

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 05:48:21 pm
content: Quote from: Corporate666 on July 16, 2015, 05:12:41 pmMy only reason to use the 595s is because I can get all 50 of them for 2 boards for ~$10, and the alternatives are just more expensive. Also, in my experience, samples take a long time, and I couldn't get enough to do even 1 board, so the costs don't really balance out. I know it is a lot of soldering to do, but that's fine.

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 06:00:23 pm
content: Quote from: Corporate666 on July 16, 2015, 05:12:41 pmWhat difference does it make if the heat is generated by resistors or the driver chips?The cost of resistors is much lower than the additional cost of expensive driver chips.If he cared about board space, he would multiplex

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 06:03:17 pm
content: Quote from: xdbx on July 16, 2015, 05:48:21 pmWouldn't Chinese MAX7219s be even cheaper?

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 07:52:09 pm
content: Quote from: edavid on July 16, 2015, 06:03:17 pmNot that I see, they're somewhat more.

author: edavid
author_rank: Super Contributor
timestamp: July 16, 2015, 08:25:38 pm
content: Quote from: xdbx on July 16, 2015, 07:52:09 pmBut you can get 10 of them for $5.25, and you only need 3 per clock

author: xdbx
author_rank: Contributor
timestamp: July 16, 2015, 08:44:48 pm
content: Oh, i thought it also only had 8 outputs, not 64.

author: Corporate666
author_rank: Unknown
timestamp: July 17, 2015, 12:40:55 am
content: Quote from: edavid on July 16, 2015, 06:00:23 pmThe heat generated in the driver chip is giving you a constant current LED control. With the plain shift register, you're guessing and running on the low end because you can't account for variations in LED Vf manufacturing tolerance and temperature variation.Expensive is a relative term... STP08 is $0.44 @ Farnell. 75HC595 is $0.20 at Digikey both in qty 100. $10 more for 50 to use the right part for the job? I guess expensive is relative.... but ST and TI will both sample for free and at least in the case of ST, they send them next-day. If size is an issue, it would be better to go with WS2812 and get the shift registers and current control built in. Multiplexing always loses a substantial amount of brightness - not many (if any) LED's are rated for similar pulsed power compared to constant drive.But those are just the approaches I'd take - to each his own.

author: edavid
author_rank: Super Contributor
timestamp: July 17, 2015, 03:17:06 am
content: Quote from: Corporate666 on July 17, 2015, 12:40:55 amThe STP08 only has +/- 8% matching... I doubt he would see more variation than that anyway, if he buys all the LEDs at once.He can tweak the LED supply voltage to get the current right.QuoteThe cheapest STP08 part I see at farnell.com is STP08DP05XTTR for $0.75 qty 100 (and it's UK stock).Meanwhile, 74HC595s are $0.10 at Arrow, qty 1.

author: Rolo
author_rank: Regular Contributor
timestamp: July 20, 2015, 08:01:57 pm
content: Quote from: Corporate666 on July 16, 2015, 05:39:59 pmI have used the WS2803 in the DIP version, works perfect. I have chained up to 9 to control starburst led display's.Search for "Lumitron", that's the name of the module. You do not need resistors and V+ LED can be higher than Vcc because it's driving to gnd. So you can place led's in series on one output for bigger display segments. Also your controller does not have to spend time on multiplexing.The downside is that the power consumption will be higher with the WS2803 because you do not multiplex.In 2013 I bought these WS2803 in DIP package on Ebay, form China. Paid about $15 for ten pieces. But now it does look the DIP is getting out of fashion, I did a quick search after reading your question and indeed, only the SOP package shows up now. Should you decide to use the SOP please test it first on a breakout/breadboard before production of PCB's. There is an error in the datasheets with the SOP. What I have read on other forums is that the SOP has the same pinout as the DIP. THe datasheet says it is diffferent. I did not use the SOP myself.I see them fore sale now on Ebay Germany (my neighbour country) and China. It's not that common as some other WS chips.If you want more info please ask.

author: Corporate666
author_rank: Unknown
timestamp: July 20, 2015, 10:19:35 pm
content: Quote from: edavid on July 17, 2015, 03:17:06 amThe 8% is the worst case on one specific drive level that he would not be using. At the level he would be using, it's 3% max, 1.5% typical. An LED is going to have a LOT more variation in Vf than that, even just due to temperature variation - no way is he going to get close to 3% or even 8% with voltage tweaking. Looking at a typical 5mm Avago LED, the Vf shift is about 0.1 volt per 20 degrees. He'll want to do as little dissipation as possible, so if the Vf of his LED's is 1.9@10mA and he wants to string 6 of them in series (just as an example), and run them off 12V... that's a 60 ohm resistor. Over a temperature change of 20 degrees, that's 0.1V per LED which doubles his current to 20mA - a huge difference. And it doesn't account for inherent differences in LED forward voltage from manufacturing. Sure, you can tweak each string and pick resistors for each if you want - but who has time or motivation for that? But the light output difference between 10 and 20mA will be significant.QuoteSTP08DP05MTR - 28p (about $0.44)/100. Or no reason not to go with the 16 channel version like STP16 or similar for 60-70 cents/ea @ Verical/Mouser/Digikey... then he only needs 25 of 'em. Or if price is an issue, they can be had for 30 cents/ea w/free shipping on eBay. And not to be pedantic, but just to be pedanticthe 74HC595 is $0.10 for 50pcs - and that's actually a really good price, I checked Octopart and for some reason Arrow doesn't show up - next best price I see is Avnet $0.26/50. Lesson learned - always check the distributors directly before trusting Octopart or Findchips.Hey, I'm not saying the CC shift register is going to be cheaper than a 74HC595... but it seems a really small price difference (what, a few bucks?) for doing it the right way with several added benefits to boot.

author: Corporate666
author_rank: Unknown
timestamp: July 20, 2015, 10:23:10 pm
content: Quote from: Rolo on July 20, 2015, 08:01:57 pmThanks for the info!I've used literally tens of thousands of the ST Micro and Toshiba parts, and had been using the Allegro Micro parts for higher pin counts, but I've noticed Allegro has discontinued many of their parts. I'd never heard of World Semi before, but I have used their WS2812 LED's on a few projects with success, so I guess they are becoming mainstream enough for me to trust designing their parts into something. That's funny about the datasheet - (excuse me if it sounds rude to anyone), but that's typical Chinese supplier stuff - having a datasheet with an erroneous pinout! Too funny!I'd be using SOP parts anyway... I was mostly just curious about suppliers. For as huge as the WS2812 LED's have become in the west, I don't see any of the distributors carrying World Semi parts... I can get some samples on eBay but I'll maybe contact WS direct and see what their volume requirements are like to buy for production work.Thanks again!

author: edavid
author_rank: Super Contributor
timestamp: July 20, 2015, 11:03:39 pm
content: Quote from: Corporate666 on July 20, 2015, 10:19:35 pmI don't understand this analysis. For the OP's clock, there won't be any LEDs in series. All the LEDs will be at the same temperature. Even with 5% resistors, there won't be any significant brightness variation.Constant current drivers are neat, and I have used the STP04 and STP08 parts, but I don't see any advantage here.QuoteOP has a US flag... here's the link for STP08DP05MTR at Newark/element14/Farnell:http://www.newark.com/stmicroelectronics/stp08dp05mtr/led-driver-8bit-30mhz-nsoic-16/dp/38Y7955?ost=38Y7955&CMP=AFC-SF-T11-USThe price is $0.797 ea plus $20 handling charge for UK stockQuoteYou are right about the multiple... they fooled me by having an odd number in stock. Findchips does include Arrow.Here they are at Newark for $0.13 qty 1:http://www.newark.com/nxp/74hc595d-112/8-bit-sipo-siso-shift-register/dp/71R2679

author: Corporate666
author_rank: Unknown
timestamp: July 21, 2015, 06:10:46 am
content: Quote from: edavid on July 20, 2015, 11:03:39 pmOK, so with single LED's per output, around the same 60 ohm resistor, with temperature variation of 20 degrees he's getting a 20% difference in brightness. Noticeable? Probably. That's an order of magnitude worse than an LED driver chip. That's why LED driver chips exist, because it's the right way to drive LED's, because treating them as CV devices leads to current swings which affect brightness substantially. The other advantages are that he gets rid of the resistors, he has simple brightness control, he can achieve much higher brightness (not to say it must be used, but it's there). It's much more tolerant of ripple voltage or any other change in LED supply voltage. And he's not running the chip right at it's max rated spec. The only singular downside is the price difference.Quotehttp://uk.farnell.com/stmicroelectronics/stp08dp05mtr/led-driver-8bit-30mhz-nsoic-16/dp/2460706?CMP=GRHB-OCTOPART$0.44/ea in 100's.Or just use the 16 output version that Newark sells for $0.414http://www.newark.com/stmicroelectronics/stp16cpc26ptr/power-conversion/dp/73T2457?CMP=AFC-OP?gross_price=He said he needed 25 of the 74HC595's... $3.25 @ Newark vs. $6.60. Three bucks to do it the right way is a bridge too far? For a cheap commercial product where you're counting pennies and running on batteries fine... but for an at-home product, especially when the company will send you the actual parts for *free*, I just see no reason not to do it the right way, unless the other parts are sitting on a shelf and have an expiration date on them or something. On the other hand, he said he had the 595's on the shelf, so the debate is rather academic - but CC is absolutely the way to drive LED's.QuoteStrange... I use Octopart daily, and I ran a couple of other parts I use - CY8C21123 and MBR0520LT1 and arrow shows up on both. The search results are instant, so Octopart must be caching their database and presumably scraping or somehow getting the data from the distributor sites. Curious that some parts that are in stock at some distributors simply do not show up on Octopart.

author: PICmonster
author_rank: Regular Contributor
timestamp: July 21, 2015, 08:23:45 am
content: I would use a different approach using LEDs that have a built in controller, the WS2812B for example, these LEDs are daisy chained together, simply orient them to create the numericals on your clock.Here's an exampleThe advantages are that you can change color of any segment and alter its brightness.

author: edavid
author_rank: Super Contributor
timestamp: July 21, 2015, 04:03:59 pm
content: Quote from: Corporate666 on July 21, 2015, 06:10:46 amWhere do you get 60 ohm? 5V supply, red LED, 8mA current -> 390 or 360 ohm resistor.Why would there be any temperature variation? All the LEDs are in the same place and have the same drive current.QuoteWhy are you quoting UK prices when OP has a US flag set?QuoteSince he's in the US, it's $3.25 vs. $39.93