# Follow-up: LED Dimmer circuit

1. May 29, 2007

### ranger

Hey all,

I posted this thread just under a year ago, but I never followed up with replies. But I've suddenly become interested in finishing it up.

Because I want to power several LEDs (say 5 @ approx. 30mA), I'll use a hefty transistor for Q2 (say TIP31) and a relatively lightweight BC108 for Q1. It even seems that a 2N2222 will suffice for Q1.

I simulated the circuit using LTSpice. And I fail to see a gradual increase in the Vr2 (base voltage), as SGT indicated in his reply.

I still don't get how the cap is suppose to make Vr2 increase gradually. Mayb its because (assuming a fully discharged cap) initially the cap appears as a short and no current flows through R2, then as the cap becomes fully charged, its open circuit nature forces current through R2?

I'm definitely at a loss here, as I dont see how to gradually increase (and decrease) the base voltage (Vr2) to provide a fading effect on the LEDs.

Thank you.

2. May 29, 2007

### waht

SGT nailed it.

Basically at initial state before you close the switch, the capacitor is discharged.
As you close the switch, the voltage divider R1 and R2 will divide 12 Volts into 1 Volts right?

1 Volt at base of Q1 is not enough to overcome two diode drops of 0.7V from base emitter of each transistor. The transistor is still off.

Since one end of the capacitor is still at 1 Volt, the other end is at 12 volts from the 4.7K collector resistor. Then it begins to charge by 11 volts first (12 - 1) through the dominant resistor R1 220K.

As the charge of the capacitor at base builds up to 1.4 Volts, LEDs begin to glow until 1.4 Volts is reached,then the capacitor overcomes two diode drops and turns on the transistors and the LEDs begin to glow at indefinitely.

When you turn off the switch the cap will discharge through the base and R2 (thus reducing current through LEDs) until it drops below 1.4V and the transistors will be off.

Hope that helps.

Last edited: May 29, 2007
3. May 29, 2007

### waht

Never mind, my explanation is not accurate, just glanced it real quick.

At initial state before the switch is closed, the capacitor is fully charged to 12 Volt through R2, and 4.7K collector resistor I'll call it R3. Therefore the voltage across the LEDs is 0V, they won't light up.

When you close the switch, the voltage divider divides the voltage to 2 volts, and turns on the transistors.

If there was no capacitor, the voltage at the collectors would be much less than 12V. But since the capacitor was charged to 12V, voltage at collector is still 12V until it gets discharged by the collector voltage which remember is much less than 12V. As the collector voltage begins to drop from 12V to a much lower voltage, a bigger voltage across LEDs will develop and they will start to glow.

When you turn it off by opening the switch, the capacitor will begin charging again, until 12 Volts develops across it, and 0V across the LEDs

Sorry for double post.

Last edited: May 29, 2007
4. May 29, 2007

### Surrealist

Use a logrithmic amplifier.

5. May 30, 2007

### Staff: Mentor

I think the 10uF cap needs to be in parallel with R2 if you want a smoothing function for turn-on and turn-off, not where it is now.

Also, usually you will put a pull-down resistor on the output transistor of the Darlington pair, at least in cases where turnoff speed is an issue. If you are smoothing the turnoff anyway, then I suppose you don't need the output base resistor.

Does it all make sense now, or do you still have questions?

6. May 30, 2007

### ranger

This makes more sense. The reason I was so confused is because I was told by several of my peers that the upon closing the switch, [a completely discharged cap] starts to charge up to 12V via 220K. So I was perplexed as to why it wont charge since there is (gnd, R2, cap, 4K7 (pot), 12V) when the switch is open.

But I have one question with regards the statement that I've bold. So the fully charged cap is holding Vce at 12V, because of this the LEDs wont light because both anode and cathode are at a 12V potential. So we need to discharge the cap to create a pot diff across the LEDs. But with regards to discharging the cap; if I understand you correctly, Vc would be much less than 12V because very little collector current is flowing when the transistors have just turned on. But with this little current, lets say Vc is now 100mV. So the right terminal of the cap has been driven down from 12V to 11.9V. And because of the huge RC time constant, the charge across the cap remains relatively the same, so the left terminal (of the cap) raises its pot diff, which in turn means more [base current and] collector current; higher Vc; lower right terminal voltage, higher left terminal voltage, more collector current, until Vce gradually diminishes to 0V.
Does that even remotely make any sense?

See above. I sure hope I'm not confusing myself here

Thanks again guys.

Last edited: May 30, 2007
7. May 30, 2007

### Staff: Mentor

I didn't re-read the original thread in detail, but tell me again why you want to have a 2 second time constant on this LED drive circuit? And why did you chose that position for the 10uF cap?

8. May 30, 2007

### ranger

This was a circuit that was coined by a fellow EE student. I believe that the intention was to have a very large RC time constant so that with little changes in Vc (and untimately Vce), the cap wont discharge too quickly, thus allowing from gradual change in potential difference across the LEDs.
The cap was placed there so that it will gradually bring Vce down from 12V to 0V, allowing the LEDs to glow.

I get the vibe that something is wrong here.

Last edited: May 30, 2007
9. May 30, 2007

### AlephZero

I haven't got my head round how your circuit is supposed to work (if it does work) but I tend to agree with that statement.

Taking a few steps back, wouldn't it be more logical to use the Darlington as an emitter follower not as an amplifier? You don't actually need the amplification for anything.

To control the brightness you need to change the base voltage by a large amount. The change is easy to calculate from the LED bright and dim currents. The switch can change one of the resistors in the base potential divider, and the capacitor makes an RC network for smoothing.

This brings to mind some very good advice I was given when starting out as an engineer: never try to design something that you don't know how to analyze...

#### Attached Files:

• ###### LEDswitch.gif
File size:
3.3 KB
Views:
106
10. May 30, 2007

### ranger

Well the circuit works, at least it concept it does. I havent gotten around to building it as yet.

Your design is pretty elegant (and easy to understand); letting VE follow in step with VB. But since its a Darlington pair, VE be out of step with VB by 1.4V. Not that it really matters in this case though.

11. May 30, 2007

### waht

Well actually this kind of transistor configuration acts as a constant current source to the load. The load in this example is the 4.7K resistor in parallel with LEDs and its corresponding resistors. So the collector current will always be constant Ic. (The value of Ic depends on base voltage and emitter intrinsic resistance) (In this design you can't control Ic that good here because there is no external emitter resistor which provides some feedback)

Because this is a constant current source, the collector voltage Vc will change depending on your load. But Ic will always remain constant. The capacitor here hinders the current source to reach its steady state as the cap is being discharged.

I also agree, this schematic isn't good, AlphaZero's design is much better and simpler, although I would use a PNP darlington transistor to switch a grounded load, since current can be easier to control.

12. Jun 6, 2007

### asynchronous13

@waht - this configuration is not a constant current source. If you change the load (ie the number of LEDs) then Ic will also change.

The transistor is acting as a switch (the darlington pair allows for more current draw -- therefore it can switch more LEDs in parallel)

Instead of being simply on/off, with this circuit the switch will cause the LEDs to ramp up from off to full brightness over 5-6 seconds, and ramp back down from full brightness back to off when switched off.

@alephzero - The design you posted does not do the same thing as the original circuit.

Some of the above analysis was correct, some not. So here's one more shot at it.

at t=0-
The switch is open, the cap is charged to 12V, Vb is 0V, and there's no voltage across the LEDs, and no current flowing through Q1 or Q2.

at t=0+
The switch is closed. VbQ1 wants to jump up to 2.1V (but it won't actually achieve 2.1V). Since the cap is charged to 12V, Vc wants to jump up to 14.1V (2.1V + 12V). As Vb gets higher, current starts to flow in Q2 (and Q1), initially this current comes from the cap, discharging it and lowering Vc. VbQ1 gets higher, Vc gets lower, and the current through the LEDs increases until it reaches a steady state. ~30mA per LED, Ic is 30mA x # LEDs, Vb is near 1.4V, and Vce is about 1V.

hope that helps

13. Jun 6, 2007

### ranger

Why did you say that? The potential difference across LEDs is gradually changing which provides changing current. It only reaches steady state when the resistors limit the current flow at approx. Vcc.

14. Jun 7, 2007

### asynchronous13

whoops, yeah you're right. it will be similar. The main difference I see is that the original circuit provides a linear ramp for the LED currents. In the other design, the LED currents will follow an RC curve.

(I'm just linking to this to illustrate the shape of an rc-curve)
http://www.tpub.com/neets/book2/32NE0159.GIF

This may or may not matter to you, depends on your application.