EmbeddedRelated.com
Forums

PWM LED Array

Started by Gene May 22, 2011
Hi Rich,

On 5/22/2011 6:14 PM, Rich Webb wrote:

>>>>> The array configuration is one of the things that I'm uncertain on. >>>>> I would think that it'd be configured based on the end method of >>>>> driving said array. I'd need all on at the same time, with at least >>>>> a few intensity levels (5 or so would be plenty) for all LEDs. >>>> >>>> Well, let's back of the envelope this. Figure a nominal 2 V drop per LED >>>> and you've got 5 V to work with so run two in series, 32 times. You want >>>> to PWM so figure a BJT switch with, say, 0.5 Vce at saturation, so a >>>> swag is 4.5 V per pair, and 32 pairs. (If you really want 63 and not 64, >>>> put some electrical tape over the 64th, or throw some regular diodes >>>> there in its place.) >>>> >>>> For 500 mA max at the USB port, assuming a proper dialog with the port >>>> to get permission to draw more than 200 mA, you can push about 15 mA >>>> through each pair. Less, really, since the processor will want some and >>>> some will be lost in other ways. So, say you look for LEDs that are >>>> adequately bright at no more than 10 mA. A 47 ohm current limiting >>>> resistor for each pair might be a starting point. >>> >>> PIC32 (min 64 pins) has only 5 PWM outputs. So, you need transistors >>> to buffer more than 18mA (max) per port. PIC24 has 9 PWM, BTW. >> >> If the OP is only interested in 5 light levels, you don't >> need a "real" PWM channel (do it "old school") > > [Crazy usenet. I can see posts from linnix timestamped before and after > that one but... not that one. %!#$! ::sigh:: ] > > Yes, I was imagining one PWM channel driving one transistor that then > tickled the bases of all of the 32 LED string transistors in parallel. > Rather a brute force approach, of course. Since they're operating as > saturation switches, minor differences in the transistor characteristics > should be mostly a wash.
If the OP wants to treat them as *one* lamp, I would seriously consider a small DC-DC converter to kick the 5V (assuming it wants to be entirely powered off the USB) supply up to "whatever" @ 10mA. Note that you could design the supply so that *it* does the intensity control (current mode output that tracks something from the MCU). I would be more concerned about having enough Icc from the USB port to deliver what the lamps will consume. (high efficiency lamps?)
On 5/22/2011 5:39 PM, linnix wrote:
> On May 22, 5:17 pm, D Yuniskis<not.going.to...@seen.com> wrote:
>> Wait -- you want to treat them all AS IF they were a single lamp? >> I.e., two states: all on (at some "dimness level") or all *off*? >> *Not* 1 on, 2 on, 26 on, etc.? >> >> (which begs the question, why not use "some number on" to give you >> your variable intensity? unless you need illumination over a >> wider area, etc.) > > Sound like LCD backlite. It he said so originally, we wouldn't have > to go through all those guessings.
<grin> Welcome to USENET!
On Sun, 22 May 2011 18:33:13 -0700 (PDT), linnix <me@linnix.info-for.us>
wrote:

>On May 22, 6:14&#4294967295;pm, Rich Webb <bbew...@mapson.nozirev.ten> wrote: >> On Sun, 22 May 2011 17:19:34 -0700, D Yuniskis >> >> >> >> >> >> >> >> >> >> <not.going.to...@seen.com> wrote: >> >On 5/22/2011 4:31 PM, linnix wrote: >> >> On May 22, 4:22 pm, Rich Webb<bbew...@mapson.nozirev.ten> &#4294967295;wrote: >> >>> On Sun, 22 May 2011 15:34:58 -0700 (PDT), Gene<profii...@gmail.com> >> >>> wrote: >> >> >>>> On Sunday, May 22, 2011 4:58:42 PM UTC-4, D Yuniskis wrote: >> >>>>> [grrr... how about learning to break your lines at something like >> >>>>> 70 characters?? &#4294967295;I've taken the liberty to *chop* off everything that >> >>>>> extends beyond the width of my window... no fun, eh? &#4294967295;:>] >> >> >>>> Sorry; my netiquette has gotten rusty it seems :( >> >> >>>>> Is this a 1x63 array? &#4294967295;3x21? &#4294967295;How many lamps do you intend to >> >>>>> have lit concurrently? &#4294967295;how many "intensities" do you seek? >> >> >>>> The array configuration is one of the things that I'm uncertain on. >> >>>> I would think that it'd be configured based on the end method of >> >>>> driving said array. I'd need all on at the same time, with at least >> >>>> a few intensity levels (5 or so would be plenty) for all LEDs. >> >> >>> Well, let's back of the envelope this. Figure a nominal 2 V drop per LED >> >>> and you've got 5 V to work with so run two in series, 32 times. You want >> >>> to PWM so figure a BJT switch with, say, 0.5 Vce at saturation, so a >> >>> swag is 4.5 V per pair, and 32 pairs. (If you really want 63 and not 64, >> >>> put some electrical tape over the 64th, or throw some regular diodes >> >>> there in its place.) >> >> >>> For 500 mA max at the USB port, assuming a proper dialog with the port >> >>> to get permission to draw more than 200 mA, you can push about 15 mA >> >>> through each pair. Less, really, since the processor will want some and >> >>> some will be lost in other ways. So, say you look for LEDs that are >> >>> adequately bright at no more than 10 mA. A 47 ohm current limiting >> >>> resistor for each pair might be a starting point. >> >> >> PIC32 (min 64 pins) has only 5 PWM outputs. &#4294967295;So, you need transistors >> >> to buffer more than 18mA (max) per port. &#4294967295;PIC24 has 9 PWM, BTW. >> >> >If the OP is only interested in 5 light levels, you don't >> >need a "real" PWM channel (do it "old school") > >Just one channel. The issues were unclear before. > >> >> [Crazy usenet. I can see posts from linnix timestamped before and after >> that one but... not that one. %!#$! &#4294967295;::sigh:: ] >> >> Yes, I was imagining one PWM channel driving one transistor that then >> tickled the bases of all of the 32 LED string transistors in parallel. >> Rather a brute force approach, of course. Since they're operating as >> saturation switches, minor differences in the transistor characteristics >> should be mostly a wash. > >I was thinking just one tiny metal can (2N2222) that can handle 500mA >collector current. One of my first transistor and still as good as >any.
Would work, but I'd be concerned with process variations between the LEDs leading to the pair with the lowest forward voltage drop hogging all of the current. Less of a problem (and likely a non-problem) if they're all from the same batch, of course. A current mirror is probably the best approach for balanced control. Also opens the possibility of controlling the brightness by controlling the current directly (and avoiding flicker or beat frequencies). -- Rich Webb Norfolk, VA