LED Light source

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Rochey

Well-known member
White Market Member
Joined
Jul 2, 2004
Messages
2,699
Location
Dallas, TX - Formerly UK
Folks,

following a thread recently, I got more and more interested in CCS (Constant Current Supplies).
As I've recently remodelled the lab a little, I thought it might be cool to investigate LED light strips under some of the shelves I have. (just so it'll look real purdy!)

I'm using this circuit from wikipedia
Const_cur_src_113.gif


Some thoughts...
R1 gets quite warm (from a 12V supply, I guess I'm dropping 9V through it)
Light intensity is controlled with R2.

Then I started thinking about how I'd like to control the intensity of light. I could do this using L2, or, i could PWM a control signal into it. That's the point where I need to think a little deeper. I think that the PWM side of things is simple. I'll just use a micro in a loop with a few counters (e.g. 50 cycles ON, 50 cycles OFF).

I think what I'll do is tie an NPN's Collector and Emmitter between the terminals of LED1.

If I'm not crazy or stupid, that should short out LED1, and draw the base of Q1 down to GND.
The only issue then is that I'll be driving 12V (or 24V if I upgrade) through a resistor, which will likely get quite warm! ;)

Maybe I'd be better using a PNP as a high side switch at the top of the circuit?

any thoughts?

/R
 
You can do better than that.

Google led light controller chips.  They do all kind of cool chip stuff.  Buy an evaluation  board

FWIW it looks like a LED street light was installed across the street from my house.  Stuff is all over the place look at Audis and other cars with white led lights.

NS has app notes.  Does TI make any LED controller chips?

For simple PWM use a 555 and low side switching device(mosfet, NPN) size the max current resistor for 100% on time for the led string number and power supply voltage.  With low side switching you can have a higher voltage at the top of the series LED string(s)

I have thought about building and installing LED lighting for my house the only thing that holds me back is insurance.  What will the house insurance company pay if there is a insurance problem and you DIYed some of the lighting in your home?

Look for the SSLtech posts about led dash lighting and dimming in a VW.
 
yeah, TI makes a slew of devices that do that... but I just fancy the challenge.

(plus, after a recent shopping blitz in china, I have 3000 NPN transistors ;) )

I think I can make it simpler by removing LED1 and the resistor, and tying the base input of Q1 to the microcontroller, and PWM'ing that way.
 
> any thoughts?

Are you interested in CCSes? Or in LEDs? Your intro seems to lead to using an LED to control an LED. Doesn't seem much use.

> R1 gets quite warm

Are there numbers (or colors) on that thing? This week where you are, EVERYthing is "warm as hell", so without an objective clue I dunno how long is long or how warm is warm.

And R2 is warm but Q1 isn't?? That suggests you waste more power making a reference than doing the actual work. Anyway: the LED is probably 20mA at 2V, 40mW. If you get this from a 12V supply the most efficient simple way, you eat 12V*20mA or 240mW. The missing 200mW (5 times more than LED power!) appears in the LED resistor or, in the example, mostly in Q1.

That R1 is most notably hot says that you have larger "waste" power in the biasing.

> better using a PNP as a high side switch

Why? The electrons don't know which end is "high". As a practical (and market) matter, there are many systems with a "ground". Cars are a stunning example: half the wires are omitted by using the frame instead. Then "high side" has practical consequences.

But as an abstract concept, or as a Vero tacked to a shelf on wall-wart power, "high" is unimportant.

Your basic LED drive is a voltage much larger than 1.7V plus a resistor. This is constant enough for your practical purpose. Sticking Zeners and BJTs in there does not add anything. For one or a dozen LEDs where power comes out of the wall, this is adequate.

I think it will be too dim to work in until you get to a hundred LEDs.

If you do want dimmer, increase the series resistor or chop it. The efficiency is the same either way: (LED voltage)/(wart voltage), but the total power does drop as time is chopped away. Put the chopping device high side, low side, anywhere....

....but NOT across the LED. Input power is not reduced (rises a bit) though light output falls. That's jamming the throttle down and controlling speed with the brake.

The way around the (LED voltage)/(wart voltage) bad efficiency is to start with a lower voltage. But with a simple resistor, current and light varies more with wart-volt change. Here's the first place you want a current limiter. With understanding and care, you can gimmick a BJT to hold 18mA-22mA for any excess voltage from maybe 0.3V up.

When voltage is "and up", you turn to further tricks. And they get mighty tricky. Your competitor's newsletter is full of pre-thought solutions. It is probably not worth your strain to understand these things, just copy the datasheet.

> removing LED1 and the resistor, and tying the base input of Q1 to the microcontroller,

Time was, any digital system sucked a million times the power of an LED. I guess times have changed.

If you don't have a resistor (or reactance) in series with LED and transistor, the current goes to infinity. Chop 10%, 10% of infinity is still infinity, or close enough to shatter.

10% chop on a series resistor is equivalent to a 10X resistor (plus flicker).

With a series reactance, current rises slowly to infinity. If you chop before it gets there, you can have a good system with controlled current over a wide range of input voltages. (However if this CPU has to do boot-init, the LED will smoke before the CPU gets chopping.)
 
Hello PRR,

Interesting feedback. I used an LED to bias, simply because that's what I had to hand, and as they don't drift etc I figured it'd work out just fine.
I also figured that getting one extra LED to shine might be useful too.

There are dozens of ready-made solutions out there in silicon, which can do all sorts of fancy fades in and out etc. This little exercise was more about thinking it through, and trying to understand CCS's better. I knew what they were since college, but never really used them for anything.
I figured some "under-counter" lighting in my new lab might be a nice way of experimenting.

As the LED was used before to give a fixed voltage to bias the base of Q1 with, I think I'm going to remove R1 and the LED, and simply replace it with a 3V3 output from a small microcontroller, and essentially PWM the LED's. I'll set R2 to give me maximum light intensity from the 3.3V base (or 2.6V once I've gone through Q1).

In addition, do you really think I need reactance (i.e. a capacitor) in my input to the base of Q1? I figured a pulldown resistor for CPU startup (i.e. the GPIO pins usually go HI-Z) would be enough. Current limiting on the base input will be done by the resistor on the emitter.

I was thinking of something like this:
currentsourcepwm.jpg





P.S - regarding devices getting warm - yes, 200mW sounds about right ;)
 
The resistor in the emitter leg might not be a good idea.  Think about it what is the drive from the Micro controller?  What is the emitter voltage with the voltage drop across the emitter resistor.  How hard will the transistor be turned on  with 3.3V from the micro pin.

A 555 is cheap and can supply a good amount of ma a at a good output level voltage (for the gate cap) for a low RDSon n channel mosfet.
 
Gus said:
The resistor in the emitter leg might not be a good idea.   Think about it what is the drive from the Micro controller?  What is the emitter voltage with the voltage drop across the emitter resistor.  How hard will the transistor be turned on  with 3.3V from the micro pin.

My discrete transistor theory is a little ropey (if you can't tell already), but my understanding is that Ib = Ic/Hfe
In other words, the current flowing into the base will be defined by the limited collector current (in in bipolar transistors, Ic more or less = Ie)

Therefor, if I want 20mA through the collector/emitter, then the current flowing into the base will be 20mA/35 (35 is the HFe of a PN2222)

I drive LED's directly from the micro already, so this shouldn't be too tough.
Emmitter voltage will be 2.6V, after 0.7 is dropped across the Vbe.

However, i could be wrong ;) and I have been... many times :)
 
You only want 20ma?  I thought you might be using higher powered leds made for lighting.

 
the batch of white LED's I have are rated for around 25mA... ;)

Again, this experiment is mostly "theoretical". Any practical use will be more for decoration, than actual lighting.

But thank you for your input none the less.

If I wanted more current, then I would probably buffer the output of the microcontroller with another npn/pnp transistor, then use a zener (or something similar) to set up a constant voltage.

That would do the trick, right?
 
You can reduce the heat dissipation in the resistor at the same current (transferring it to the transistor) by reducing the voltage across the  resistor. This is done by dropping the voltage at the base, frequently by the use of a Zener, or two forward-biased series silicon junctions, or some similar clamping arrangement. Base current can be limited by series resistance, which I think can be up to the desired collector current x hfe, counting on my thumbs.

The base current may be needlessly high without a series base resistor. remember also that the base current will flow through the emitter resistor. -You MAY have a situation where the base current is needlessly high, and dwarfing the collector current. The hfe is an UPPER LIMIT on the ratio of collector-to-base current, and not a fixed multiplier... if you stuff too much current through the base and open-circuit the collector, R2 may still be getting warm, so no, collector current doesn't LIMIT base current (think of it as a diode, for example when the collector is open) but it is the number which defines the available COLLECTOR current limit, for a given base current...

A base resistor will make life easier for the source device, and allow more LED transistor drivers to be hung off a common source without taxing it, (or the supply rail) needlessly.

Keith
 
Back
Top