OT: LCD backlight control

Go To Last Post
70 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you guys handle the LED backlight on typical LCDs ? For example, one project I have here uses a nice Optrex DMC16202 display, 16x2. Not too big, just right.

The backlight takes 150mA at 5V, no resistor ... That's a chunk. I have it controlled right now via a 2n3904 to turn it on and off as needed, but it really sucks the power through the regulator, heating it up. A lot.

This particular project is in vehicles, so there's about 12-13V powering it. I think it's possible to switch the LCD backlight power from the direct 12V instead of the regulated 5V, cutting the power through the regulator down to around 70mA or so instead of 220mA. Much better.

Except that it needs a honking big resistor. 150mA at 5V is less than 1W, which is bad enough. Pulling that from 12V is almost 2W. Have to drop 7V through the resistor at that 150mA, and it really heats it up. Even going to larger resistors (220 ohms) it still gets way hot, besides which the backlight is too dim. Forget 100ohms, fingertip sizzle-city ...

Any ideas ?

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. Use a PWM signal ?

2. Use 4 resistors parallel so it devides the power.
4 x 470/1watt parallel at 13v supply ?

3. or an extra adjustable regulator... LM317?

4. Or a strings of diodes (8/0.7= about 12)

5. Use a zener ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hrm. Very little room on pcb, so I can't really use a stack of resistors or diodes. An LM317 would need a couple of caps and a couple of resistors. Since the backlight is really sensitive when at lower voltages (3.8-4.2V) adjustment would be very fine, so it would probably require a trimpot.

I'm thinking pwm is a good idea. The on/off control is on pin18 of the mega8 right now, so it's easy layout to move it to pin17 to use OC2 via timer1. That will twiddle the base of the 2n3904, controlling the backlight.

Should work. I hope :)

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you do it with PWM you can do very impresive "fade in - fade out" effects with the light... like the mobile phones :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would love to do PWM for backligthing also (am also an AVR newbie).

Is there anyone that can present (point me to) a schematic for that , and maybe some pwm source skeleton , or give a hint on the frequency that would be optimal for a LCD (100HZ ?? , ie. 200 cycles).

I can prob do the source my selve but would love a hint on how to interface it.

Im puzzeling with PWN also for the contrast , but i guess thats just plain PWM , and an RC at end connecting to the LCD (DA conv).
Would a higher frequency be better here (more stable output) ???

Any help or hints would be much appreciated ....

I hope i then can release a MatrixOrbital clone to the projects section ..

The "AV'R-Bit display".

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Generation of voltage to control the contrast is best done by using the pwm to generate a negative supply which conterbalances the Vcc so that you can generate close to 0 volts or negative, as some LCD's require.
Mike

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, the Mega8 will do hardware PWM, and can toggle the OC2 pin, all with no software intervention. You just set up the registers (there's the rub :) correctly, and let the hardware do all the work.

I have to re-read the datasheet a few times, as it can be a little obtuse sometimes. As far as I can tell, it looks like you can use Fast-PWM mode, and set it up so that OC2 is CLEARED on CompareMatch (using OCR2 register), and SET when the timer reaches MAX (0xff).

So by simple adjusting the CompareMatch/OCR2 register between 0 and MAX, you can adjust the duty cycle. Pin17/OC2 goes via a 1k resistor to the base of a 2n3904 npn, which controls the GND pin of the backlight.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how is PWM used to control the fade-in/fade-out of the LCD backlight? i use the output compare pin of mega16 to time when to turn the backlight off, but haven't thought of doing the fade-in/fade-out of the backlight.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Say you're using an npn transistor to control the backlight, controlled via the OC2 pin. LO on the base turns the backlight off, and HI turns it on.

Use the Fast-PWM mode, and the COM21/COM20 bits set as 1:0. This sets (backlight on) OC2 at the start of the count, and clears it (backlight off) when the count reaches the value in OCR2.

So if you set OCR2 to 16 the backlight will be on for 16 counts, and off for 240 counts, very dim. As you increase the value in OCR2, the longer the backlight will be on for each full count of the timer, so the brighter it will be.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

im using the timer1 of mega16, that is a 16-bit timer. so does that mean that i have to increment the value at the OCR register so that the backlight will go from dim to bright? and then decrement the register value so it will turn from bight to dim?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's it exactly. The hardware PWM will keep cycling the count, turning the OC2 pin on and off according to the value in the OCR2 register. You will need your own software routine to change that OCR2 register in a pleasing/fading/whatever way.

Probably use another timer for a steady interrupt and change the OCR2 value in the interrupt service routine or something similar.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chancy99 wrote:
How do you guys handle the LED backlight on typical LCDs ? For example, one project I have here uses a nice Optrex DMC16202 display, 16x2. Not too big, just right.

The backlight takes 150mA at 5V, no resistor ... That's a chunk. I have it controlled right now via a 2n3904 to turn it on and off as needed, but it really sucks the power through the regulator, heating it up. A lot.

This particular project is in vehicles, so there's about 12-13V powering it. I think it's possible to switch the LCD backlight power from the direct 12V instead of the regulated 5V, cutting the power through the regulator down to around 70mA or so instead of 220mA. Much better.

Except that it needs a honking big resistor. 150mA at 5V is less than 1W, which is bad enough. Pulling that from 12V is almost 2W. Have to drop 7V through the resistor at that 150mA, and it really heats it up. Even going to larger resistors (220 ohms) it still gets way hot, besides which the backlight is too dim. Forget 100ohms, fingertip sizzle-city ...

Any ideas ?

I've been using an IRFL110 (low side connection) directly connected to the PWM output pin on the AVR with no problems yet. My designs use a CL resistor, but the IRFL110 should be able to handle the currents you need, and it comes in a nice small package.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would be better. The 2n3904 is only rated at 200mA continuous, so 150mA is pushing it.

Hmm, I have a bunch of 2n4393 jfets here. That should work.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think that the PWM thing will work so easily. You say that you have 12V and you want to use a PWM to lower that to 5?. Sorry, but you will need to make a step-down regulator or buck-converter for that. The problem is that when the PWM transistor is on, you will get full 12V ( or a bit less ) on the LCD backlight. This is not good. So you will need to add a coil, schokty diode and a capacitor to do your task. There is also a problem with a the bear pwm based step-down regulator. The output voltage is dependand on te input, so you will also need to messure the input ( supply ) voltage, if it is unstable, in order to get constant backlight brightnes.

Please someone correct me if I am wrong!

Best regards
George

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

George wrote:
I don't think that the PWM thing will work so easily. You say that you have 12V and you want to use a PWM to lower that to 5?. Sorry, but you will need to make a step-down regulator or buck-converter for that. The problem is that when the PWM transistor is on, you will get full 12V ( or a bit less ) on the LCD backlight. This is not good. So you will need to add a coil, schokty diode and a capacitor to do your task. There is also a problem with a the bear pwm based step-down regulator. The output voltage is dependand on te input, so you will also need to messure the input ( supply ) voltage, if it is unstable, in order to get constant backlight brightnes.

Please someone correct me if I am wrong!

Best regards
George

Right. The heat from excess power dissipation can't be avoided without a switching regulator. And instead of all the trouble with building one just for the LCD backlight, a far better solution is to replace the 5V linear reg.

Mark

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would seriously consider a second 5v lin reg.
If a 7805 type is used you can just connect it parallel to the first one. All the dissipated power will be split (almost) equally between the two.
Its a cheap solution and does not require any extra capacitors and such.

It may not be a problem but you might consider a low-pass RC network to the transistors base to limit the bandwith of the switching you are doing via the PWM-pin. Steep edges have high frequency components in them and when switching 'power' you increase its power content as well. This may be a EMC problem.

Good luck!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When feeding that backlight straight unadulterated 5V, it takes about 150mA to be nice and bright. I set the bench power supply for 5V, unlimited current, and it takes about 420mA and it's blinding. As I reduce the current limit down to 150mA, the output voltage drops to 4.3V

The AN7705 regulator (1.2A) can easily handle the full 230mA that the whole project sucks down, which includes the 150mA for the backlight. It just gets annoyingly hot. I already have a 2n3904 and base resistor in the layout for on/off control. A 2n4393 jfet is also in a TO92 type package, so that will fit fine - no layout shuffling needed.

Hrm. I was trying to avoid dissipating the additional power - that's why the pwm bit sounded good. Remember, this isn't so much lowering the voltage down from 12V to 5V, it's limiting the current through the LED backlight of the LCD.

I thought that PWM would essentially give you an average current. So if we PWM a 12V supply to the LCD backlight at a high freq with a low duty cycle, won't that work ? Might have to add in a cap on the output ...

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It takes space (actually, surface area) to dissipate power, and there's no relief. PWM from 12V doesn't directly reduce the power dissipation, it just concentrates everything into smaller portions of the PWM period.

PWM or switching an LCD backlight can have its own problems.... we had a design that used a buck regulator for the backlight. The LED switcher frequency and the LCD scan rates produced an annoying 'beat'.

If you have room for a 47 microhenry inductor and 200 mA diode, I can provide a switcher topology which uses the PWM. You just need to add those two parts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike -

Thanks for the offer - I would like to see it. Are those two components in addition to the base resistor and npn/jfet ? How critical is the layout ? I have two mounting holes and a pair of box caps in the area. The caps can move, but not the mounting holes ...

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yeah, i wanna see them too. :shock:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An "upside-down" buck converter can be implemented simply with four parts.
Starting from "ground up", a npn transistor or, preferably, a n-channel fet.
Source grounded, gate to pwm output of avr, drain to one end of inductor.
Other end of inductor to neg terminal of "load", pos terminal of load to +14v
supply. Cathode of Schottky diode to +14v, anode to fet's drain. Capacitor
across "load". This setup works quite sweetly when the neg end of the load does
not have to be tied to actual ground. Another advantage is the switch being on
the "low" side, making the gate easy to drive directly form the port pin.

Now, that said, all this is completely unnecessary to vary the
brightness of the led backlight, unless it is desired to actually *regulate*
the voltage or current, to prevent visible flicker if the vehicle's 14v supply
fluctuates. In this case you would also add a differential measurement of
the voltage delivered to the load, and control the pwm with it.

To just be able to vary the brightness while running the led off the 14v
system, pwming a simple on-off switch, like the OP already has hooked
up, is fine. No filtering with Ls and Cs is needed because the eye does
the integration of the light pulses being emitted, as it does with a multiplexed
display.

Three things I would check, is make sure that the led backlight itself has, or you
add at least a small resistance, to prevent destructive current levels during
the "on" pulse. Maybe 10 ohms. Next, be sure your "switch" is turned
on good and hard, or it may over heat. I would use a fet with nice low
on resistance. Lastly, make sure during start-up of the mcu, that the
leds are not inadvertantly turned on before your pwm takes control of the
port pin, and put a safeguard in your software to prevent commanding the
pwm to overdrive the light.

Quote:

Posted: 31 May 2004 12:41 am Post subject:
It takes space (actually, surface area) to dissipate power, and there's no relief. PWM from 12V doesn't directly reduce the power dissipation, it just concentrates everything into smaller portions of the PWM period.

PWM does indeed reduce power dissipation. In this case, running a 5 volt 150 ma
load from 15 volts, pwm would eliminate almost 1.5 watts, which otherwise
would be heating up a resistor or linear regulator. A higher current is drawn
during shorter periods, but the idea is for that current to be drawn through
a minimum amount of resistance, which reduces total power dissipation.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's the circuit, maybe later I'll draw it and post a picture. For now, I'd like to include the math.... these are approximations.

For an input of 16V or less, the frequency needs to be 40 KHz or higher for a 47 microhenry inductor. Larger inductors will allow lower frequencies and if you want a smaller inductor, raise the frequency proportionally.

The inductor, switching transistor, and Schottky diode need to be rated at the maximum current that you'll be putting into the LEDs. Exceeding the rating of the inductor and saturating it will cause the full input voltage to appear across the LED without limit.

The on-time percentage is approximately the percentage that the load voltage is, compared to the input voltage. The 'load voltage' for this calculation is the sum of the LED and Schottky forward drops.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tom, Mike -

Great explanation, thanks. Sounds like I can replace the simple base resistor and 2n3904 with an inductor, diode and fet. I have a bunch of 2n4393 jfets here, which don't have an integral diode, so I would assume the external one to be absolutely required. Agh, wait. They won't work, their on-resistance can be as high as 100ohms per the datasheet. OK, find another n-ch fet ...

Analog isn't my strong suit here (no kidding :). I would plan to use the hardware PWM on the mega8 on the OC2 pin to control the fet gate. Since the mega8 is running at 16MHz, that's the max clock input to the pwm hardware, and at 256 counts per cycle, that's a freq of 62.5kHz.

Right ?

This sounds good. I have some Coiltronics ctx100-1 inductors here. 100uH open-circuit inductance, and 58uH under full load which is 440mA.

Tom mentioned putting in a small series resistance, to protect against destructive current levels if the backlight doesn't already have it. As far as I can tell from the datasheet, it doesn't (DMC16202). That would have to be a fairly big 10ohm resistor to handle the current though, wouldn't it ?

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pondering this in a little more depth, efficiency would be best using no
additional series resistance at all with the "buck converter" arrangement.
The led brightness is due to the current through them rather than a
particular voltage. In this switching converter arrangement, when the
transistor is switched on, current in the inductor and series led starts at
zero, and then ramps up with time. The inductor is being "charged" with
energy. At some point the pulse modulator turns off the switch. An inductor
always trys to maintain the current that is flowing in it, so when the switch turns
off, current now will flow through the diode back to the led. This current will
flow until all the energy stored in the coil has been transferred to the led.
So, in this setup, the current through the led is already being "limited" by the
inductor and the level of magnetic flux that the pwm allows to build up
during each pulse. The key is to make sure the system starts up cleanly
when power is applied to the mcu. An avr's port registers are all zeros during
reset, so the pwm pin starts out in a high-z state. I add a pull down resistor
from the pin to ground to guarantee the fet is held "off". Next I initialize
the timer registers for my desired pwm characteristics, along with everything
else. When all is as it should be, I activate the pwm output by setting the
DDR bit to one. All this makes sure the switch does not get turned on until
the pwm gives it an intentional and proper width pulse. What you could do
is go ahead and tack in say, a 20 ohm 1/2 watt resistor, as a "smoke limiter"
while you program and test the circuit, then take it out when correct operation is
verified. I truly love pulse modulators, but I have learned "the hard way" to
make sure it puts out the proper pulse width and frequency when connected
to something expensive 8-)

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would stick with the 2N3904.. Although it's only rated at a continuous 200 mA, it'll only be on about 1/3 of the time.

You should provide at least 5 mA of base current; 820 ohms sounds good.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How critical is the inductor and diode to this ? I've seen other designs that just modulate/pwm the transistor which handles the cathode end of the LEDs.

I understand how it works with the inductor ... that keeps feeding current after the npn turns off. That would be most necessary at a slower pwm freq.

What about at much higher freqs ? One could use CTC mode, and set OCR2 to a small value, and toggle the OC2 pin on compare-match. For a 50% duty cycle, one could get an 8MHz freq out of it. For a 33% duty cycle, it would be about 5MHz. Would that be fast enough to obviate the need for the inductor and schottky diode ?

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PWM without energy storage gives you control over the brightness but doesn't save any power. :roll:

Example: If you have your 4.3V LED in series with a 100 ohm resistor and a 14.3V supply, the resistor will dissipate 100 mA x 10V = 1.0 watt. 8)

However, if you have the same 4.3V LED in series with a 10 ohm resistor and 14.3V supply, and 10% duty cycle (for the same average current), the resistor willl dissipate 1A x 10V x 10% = 1.0W. (Note that the PWM transistor needs to handle 1.0A peak.) :oops:

Much higher frequencies allow much smaller inductors... that should be good news. :P

But some form of energy storage is the easiest way to save power. :o Sorry.

Don't forget that I did have problems with 'beating' between PWM and LCD scanning. Beware. :twisted: And with a switcher in the system, the input power bypass requirements may change.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

If minimum power dissipation is the prime concern then you have little choice but to use a switched mode power supply.

Resistors ALWAYS dissipate power. In fact they are the only electrical element in which power is dissipated. Any device that dissipates power will include real or equivalent resistive element(s). IDEAL energy storage devices, capacitors and inductors, cannot dissipate power. Hence, to minimise power dissipation use the best quality capacitors and inductors you can find/afford so as to minimise their relevant resistive imperfections - usually series resistance, which includes skin effect in inductors and equivalent series resistance (ESR) in capacitors.

There is an article in the March 2004 issue of Design Fax, pages 14-15, entitled "Sizing A Power Inductor". While his architecture shows a 'control IC', in reality a PWM waveform generated by an AVR processor in response to a filtered ADC reading of the output voltage is all that is needed.

In this paper there is also a reference to an IEEE publication as follows -

"Practical Design of Power Supplies",
Ron Lenk,
1998
IEEE Press,
McGraw Hill

Good luck,

Gordon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using MIC4680. The 200kHz MIC4680 achieves up to 1.3A
of continuous output current over a wide input range in a
8-lead SOP.
IRLML2803 for LCD (sot23)
Alexander

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just thought I'd post the layout for the Mike/Tom (and others) LCD pwm control. Note, this board isn't done yet, but that area is essentially the room I have to play in.

The backlight connector is on the right, the top pin being fed 12V from that top red trace. L4 is the ctx100-1 inductor, D1 the schottky diode, and Q2 is the 2n3904 transistor. The base resistor is way off on the right edge of the board. The blue is bottom layer, mainly gnd planes. Two whacking great mounting holes, and a TO220 heatsink mounting hole to contend with.

Now to breadboard it up and test it out :)

Attachment(s): 

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it me and/or my browser, but I don't see any images/attachments???

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have some space to put a 0.1 uF ceramic cap from 12V to GND as close as possible to D1? Could prevent a lot of trouble....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Is it me and/or my browser, but I don't see any images/attachments???

Lee

@Lee

No problems with viewing attachments and jpegs here Lee.

The LCD_backlight_layout was posted 10:12PM and your reply was on 10:18PM. 6 minutes in between. I had the same problem once that one posted picture wasn't available for say 5 min. after posting.

Maybe you just have to give it another go. 8)

- - big bang - -

Take a good look around. Admire our world, our galaxy, the whole universe. Then you just feel there must be a
'Theory of everything'

Maybe, someday, the human race is ready to discover it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry,

posted on 10:14PM and 10:18PM, 4 min. in between

- - big bang - -

Take a good look around. Admire our world, our galaxy, the whole universe. Then you just feel there must be a
'Theory of everything'

Maybe, someday, the human race is ready to discover it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mneary wrote:
Do you have some space to put a 0.1 uF ceramic cap from 12V to GND as close as possible to D1? Could prevent a lot of trouble....

I can move the diode to the right of the mounting holes and shift the backlight 2-pin header to the right some. That would allow the diode and a 0.1uF boxcap fit next to each other.

Easier would be to shift the 2-pin header right less, and fit the boxcap between it and the mounting holes. It won't be *right* next to the diode, just across the mounting holes.

Actually, that would be mucheasier ...

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good. I wasn't sure anyhow which was the better place for the cap. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If this project needs to pass FCC or similar agency testing, be sure to check emissions early and often. It's possible to build a quiet switcher, but most don't happen on the first try :oops:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Heh, no thankfully. This is a personal project to build a bunch of completed and kitform gadgets for vehicles for our racing group. Fast cars :) It goes into an extruded alum enclosure with alum end panels. The only openings are the LCD panel face, a non-shielded connector and 1/4" hole for a rotary encoder.

If it does wind up being too noisy, I'll change the regulator to a TO220 case and remote-mount it to the enclosure to act as a huge heatsink. Don't wanna do that though - makes moving the board around a pain in the patootie.

BTW, that number on the left there represents my top speed so far on the back straight at Pocono. Car was still pulling hard, I ran out of room and cojones.

OK, it was a squeeze, but the cap fit. Howzat ?

Attachment(s): 

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey All -

Thought I would wake this one up again. As a reminder, this discussion was about methods to supply current to an LED backlight for an LCD, ways that would be efficient. We need around 150mA or so for a good bright backlight.

I'm getting ready to do the respin of the board, and was about to go with the existing solution we have so far - using pwm to control a cap/inductor buck regulator. Should be pretty easy using the hardware pwm of the Mega8.

Then a colleague suggested using a constant current setup, using two small npn transistors. Well, what the hey, let's give it a try. Take a look at the SwitcherCAD schematic and analysis below. I've wired it up exactly as shown, and it pretty much agrees with the plot. Actual current is around 130mA, not the 145mA as plotted. Close enough. The plot is an ordinary sweep of V1 from 8V to 16V. I ran it all the way up to 50V to check, and it stayed well withing the 150mA limits.

Only trouble is the 2n3904 npns get really HOT, which is exactly what we're trying to avoid. Heat in a small unventilated aluminum enclosure ...

So, comments ? Should I pursue this a little more. Note, I haven't yet actually *checked* the cap/inductor buck regulator setup ... I'll bung that together tomorrow if I get time, air-solder the parts, or maybe dremel a small bit of pcb to make the "tracks".

Attachment(s): 

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would sure try the switcher setup- I think once you do you won't
look back. The linear setup is everything you wanted to avoid, and
that 3904 won't last long at those power dissipation levels either!
The switcher should run with almost zero temp rise.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's always other options :) Should be able to do an RC circuit that charges up a cap through a resistor & then dumps voltage from the cap into the LED's, or something similar... 1 cap 2 resistors & 1 transistor should do it...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with Tom. The transistors are just acting like the regulator of before more or less and you are getting a voltage drop across them at some current level so they are acting like resistors and getting hot. No matter how you play the linear game, you will get the same amount of heat dumped into your enclosure.

But with a switcher and energy storage, you decrease the effective R value and end up with less I2R loss and heat.

Please note - this post may not present all information available on a subject.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can emulate a switching power supply by adding an inductor and diode together with the PWM switch. You have to size the inductor based on the current and the PWM frequency. But, this is what I am planning to do in a similar system.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How are you sizing the components ? For example, if you wanted to provide 150mA (max 200mA) from a 12V supply, how would you calculate it ?

Hrm, wonder where those sample values came from :)

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chancy99 wrote:
Hrm, wonder where those sample values came from :)

It's simple calculus :twisted: :twisted: :twisted:

You start with some desired values, and plug into V=L di/dt. Choose a p-p value for current ripple. I'm going to go with 100 mA. Choose a frequency; let's start with 100 KHz (dt becomes 5 uS). Then, choose the peak to peak voltage across the coil. I'll use 12V since it's almost 9V with the switch on, and almost -3V with the switch off. Now you have enough information to solve for L. (I get 600 microhenries.) I have assumed that your LED will use a nominal 3V.

This is a current regulator, so you don't have an output cap. Sense current instead of voltage for PWM control. Warning: One reason why chipsets are so popular is that there's a whole world of issues with loop stability that I haven't mentioned.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bleah.

Heh, all I want to do is feed the LED backlight for the LCD from 12V. Without creating too much heat.

OK, below is yet another simulation :) This is using a Coilcraft ctx100-1 100uH inductor and running the pwm at 100kHz or 10uS period. The curves you see are with an ON time of 1.5uS. BTW, SwitcherCAD III is a handy-dandy little tool. Simple to use, and does most of what I need in simple simulations.

The LED current wobbles from 50 to around 240mA, with around a 1V ripple. Using a 1uF cap smooths the LED current and voltage ripples out a lot, but the freq is high enough I don't think we need to change.

The Mega8 is running at 16MHz, so it should have no problem producing a 100kHz pwm output on OC1a or OC1b ...

Attachment(s): 

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like you almost have it nailed. One thing that attracts my attention is the 2N3904. Be sure you give it plenty of base drive since you do begin to lose gain dramatically at 100 mA collector current and high temperatures.

An alternative is the PN2222A, which has good gain all the way out to 300 mA. The Pn2222A is only slightly more expensive ($0.0453 vs $0.0413).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I'll drop that 1k base resistor down to say 820 or even 560.

I need to do another Mouser order, so I'll add in 100 PN222a npns. Yow, big variety in pricing. Wonder why ?

ST Micro 2n2222a are $0.44 ea
Central Semi 2n2222a are $0.39 ea
Vishay mps2222a are $0.06 ea
Central Semi PN2222a are $0.18 ea
ST Micro PN2222a are $0.06 ea

Ah, ok. The pricey ones are in TO-18 metal case. The others are TO-92. Still, Central Semi is double. Getting 100 they only drop to $0.12, while the ST ones are $0.049.

Definitely have to shop around - Mouser is cheapest in this case. I checked Digikey, Jameco, Newark, JDR, ElecGoldmine, Meci, BG Micro, MPJA - all were more expensive.

I must say, I like http://www.findchips.com for hunting things down. Also http://www.freetradezone.com though that one requires registration.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I still wonder why the simulation showed the 2N3904 as being adequate?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure. Plotting the collector current shows it peaking at almost 400mA. Fry the finger time ... The pn2222a peaks at around 300mA.

What spice programs are you guys using ? Can anyone else drop this into their favorite one and try it out ? Be interesting to see how they compare.

Would any of the others flag the overcurrent ?

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I didn't use spice... I just took the curves straight from the FairchildSemi data sheets. 8)

Either the 2N3904 is seriously vendor dependent, or the spice model lacks some important detail. Does your spice run at 25c (77f) unless you say otherwise? At this temperature the gain looks OK up to 100 mA (and maybe beyond) on the data sheet. The curves at 125c look very troubling, but no telling where it actually goes awry. :?

Maybe the gain suddenly drops to 50, at 120 mA, and then flattens and doesn't fall further. But I wouldn't bet on that. :twisted:

Pages