Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Periodic lamp fader

Status
Not open for further replies.

jelliott

Member
I recently built a slight variation on Bill Bowden's "Automatic 12 Volt Lamp Fader" and have a few questions that I was hoping the experts on this forum might be able to help me with.

Background: My brother's electric car lacked any kind of visual indication that it's plugged in and charging. And I've always admired the way Apple computers of the last 15 years fade the power light in and out at ~0.2 Hz when they're in sleep mode. So I thought it'd be neat if the electric car would do the same with its parking lights when it's on the charger. However, the parking lights are wired with +12 V switched, rather than switched ground, so I needed a circuit that would accommodate the load being downstream of the transistor. I emailed the proprietor of the web site where I found the schematic, and got a prompt response indicating that the circuit (in its BJT incarnation, anyway) would work in that configuration without any further modifications. Mr. Bowden's response is as follows:
What you might do is use the circuit as shown with the 2n3053 and connect
the load from emitter to ground and collector to +12. The MOFET will also
work with the load in the source, but the load voltage will only be around 8
volts since the MOSFET needs about 4 volts more positive on the gate than
the source to turn on. So, you would only get 8 volts or less to the load
since when the gate goes to +12 the source will only go to +8 volts. And the
LM324 will not switch all the way from ground to +V. It will go to ground,
but maybe 2 volts less than +V. So, you might only get 6 volts or less using
the MOSFET.
The four (LED) parking lights draw a total of 100 mA and instrument panel illumination that's on the same circuit draws maybe 350 mA, so with the USA-spec corner markers disconnected, I thought the 2N3053 would be adequate (I was forgetting 800 mA for the license plate illumination).

Questions:

1) Something must be wrong with the circuit as I built it because the transistor gets VERY hot; not just hot enough to burn a finger, but hot enough to discolor the metal case of the transistor, even when it's providing a paltry 85 mA to a single light bulb. When installed in the car it doesn't provide enough current to provide even a hint of illumination. Tested on the bench, the (open circuit) voltage ramps up and down as intended, and it works fine (heat dissipation notwithstanding) with a 1 W load, but with a 5 W bulb it only ramps up to ~5 V. Is there something wrong with the circuit design? Is it likely that I got something wrong in the course of assembling it that could lead to this behavior? Could it be a faulty transistor? Are there other transistors I could use to avoid this? (And if I'm going to drive multiple transistors in parallel, e.g. to account for the license plate lamps, can the LM324 handle that? Do I need to halve the resistance between the op-amp and the transistor base to maintain the same base current in a second transistor?)

2) The circuit works fine with load limited to 1 W, but only if it's powered by a 12 V battery, but not on the available rectified +12 V power. I thought this would be easy because the car's charger has a disused +12 V output, but when my circuit is connected to that power source, the load just just comes on at a constant partial brightness and doesn't fade at all. I assume this must be related to AC ripple on the rectified +12 V supply, but I don't know what to do about it (I'm a mechanical engineer by training, after all). Can I stick a capacitor somewhere to resolve this issue?

3) As designed, the Bill Bowden circuit switches the load completely off for a portion of the cycle. Ideally, I'd prefer that it never fade below a ~5 V level. Is this as simple as adding a resistor between +12 V and the transistor base? Or does it need to be a voltage divider sort of arrangement?

Thanks,
Joe Elliott
 
Last edited:
This is a terrific idea!

There are THREE problems doing it the way you suggest - the first is simply that the drive transistor is starved for base current. In that common-collector mode that 2.2K resistor is limiting almost all the current from the tiny voltage differential you have driving it that way. Try shorting it out. Seriously. Hook pin 14 from the LM324 straight to the base of the 2N3053. The LM324 output is short-circuit protected, and it can only develop about 40ma total which won't hurt the 2N3053. You need all the base current you can get. The transistor should run cooler and you should get some light.

Other two problems are that the LM324 can't switch all the way to +12V, and common collector drives just generally stink. But first try simply reducing that 2.2kΩ to 0Ω.
 
There are THREE problems doing it the way you suggest - the first is simply that the drive transistor is starved for base current. In that common-collector mode that 2.2K resistor is limiting almost all the current from the tiny voltage differential you have driving it that way. Try shorting it out. Seriously. Hook pin 14 from the LM324 straight to the base of the 2N3053. The LM324 output is short-circuit protected, and it can only develop about 40ma total which won't hurt the 2N3053. You need all the base current you can get. The transistor should run cooler and you should get some light.

Thanks Duffy. That worked. I thought I had tried this before (I at least tried replacing the 2.2 kΩ resistor with a much lower resistance), but now with a plain wire in place of that resistor it's working as intended.

But I'm powering it from the 12 V battery bus via a relay, with the relay switched on by the disused +12 V output from the charger with which I had hoped to power the fader circuit directly. (When powered directly by the rectified +12 V from the charger it doesn't fade correctly; the lamps just come on at a constant intensity.) Any suggestions as to how I can resolve that issue?

Thanks again!
 
I can't understand what you are asking. Something with the relay? It won't work off the battery charger? Battery chargers make lousy power supplies, the newer ones need to detect the battery first.
 
I can't understand what you are asking. Something with the relay? It won't work off the battery charger? Battery chargers make lousy power supplies, the newer ones need to detect the battery first.

I'm asking if there's something I can add to the circuit to eliminate the need for the relay. (Yes, it won't work off the battery charger; see question #2 in my original post, if that's any clearer.) The battery charger has a +12 V output that I would like to use to power this circuit, but the fader circuit doesn't fade when it's attached to this power source--the load just comes on at a constant intensity instead of fading on and off. I'm wondering if there's some kind of filter I could add to my circuit to make it compatible with this apparently-lousy power supply.
 
The charger output may just be unsmoothed rectified AC. If so, it drops to zero every half cycle and perhaps that is upsetting your dimmer circuit. Try adding a 1000uF (or more) cap across the charger output if a hefty smoothing cap isn't already present.
 
^^ Yes, try a 1000 uf cap across the +12V and ground on your board.

And please post a YouTube video when you get this awesomeness happening. I love the idea of a recharging car having that "sleep" kind of effect with the lights.
 
I added a 1000 µF capacitor and now the circuit (sort of) works on the rectified +12 V, but at the beginning and end of the fading cycle, when the lights are illuminated only slightly, they flicker horribly, even those that use incandescent bulbs. Do I just need a bigger capacitor? (The flicker is more like 6 Hz than 60 Hz, so if I'm still dealing with a symptom of AC ripple on the rectified +12 V supply, there's some phenomenon at work that I don't entirely understand.)

I guess I should have made a video when I had it hooked up to the battery via the relay and it worked as intended (aside from drawing power from the wrong place...)!
 
Do I just need a bigger capacitor?
That would probably help. Also, connect 10uF from pin 3 of the LM324 to ground and connect 0.1uF between pins 4 and 11.
there's some phenomenon at work that I don't entirely understand.
I'm guessing the load switching is causing slight variation in the voltage levels at the IC pins. The caps suggested above are intended to stabilise things.
 
I've changed the big capacitor from 1000 to 2200 µF and added the other capacitors as recommended, but the flickering behavior remains (albeit slightly improved from last time). I brought my oscilloscope with me this time, and I'm hoping the following screenshots may shed some light on what's going on:

Charger output appears to be unsmoothed, as we suspected (fader circuit disconnected).
**broken link removed**

What's interesting is that when the fader circuit is connected, the ripple appears on the rectified +12 V input to the circuit only when current is going to the lamps; at the brightest point in the fader cycle, it looks like this.
**broken link removed**

However, at intermediate voltages, the ripple isn't nearly so regular.
**broken link removed**

And at the very beginning and end of the cycle (when the lamps are off, or just barely illuminated), the voltage on the fader circuit input appears effectively flat.

What's going on here?
 
Last edited:
When the charger is hooked up to a battery the ripple will be gone. The battery acts like a huge cap.
So if this fader is only going to work the the car charging I would not worry so much about it working with the charger alone.
 
Last edited:
When the charger is hooked up to a battery the ripple will be gone. The battery acts like a huge cap.
So if this fader is only going to work the the car charging I would not worry so much about it working with the charger alone.

This output isn't hooked up to a battery. If it were, it would no longer serve to signal charger on/off because, well, there would be +12 V on it regardless. It has occurred to me to connect it to the 12 V bus via a diode to smooth the rectified voltage without energizing the wrong things at the wrong time, but that would still introduce a risk of overcharging those batteries, and it seems almost as inelegant as the interim relay solution described in Post #3.
 
Ok I will have to think about this one some. As you say there must be a more elegant solution.
 
It has occurred to me to connect it to the 12 V bus via a diode to smooth the rectified voltage
A diode will not "smooth the rectified voltage"
I think my point is you want the lights to flash when the charger is hooked up. When the charger is hooked up the battery's will smooth out the pulsing DC and the fader will work fine. Just how are you planing to turn the fading lights on only when the charger is hooked up?
 
A diode will not "smooth the rectified voltage"
Right, the diode doesn't smooth the voltage; the connection to the 12 V battery bus does. And the diode prevents the battery from energizing the charger circuits when the charger is off. I tested it, and a diode between the rectified +12 V and the 12 V battery bus does, in fact, solve the flickering problem. And two diodes in series knocks the voltage down enough that I'm not too concerned about overcharging as a result of this additional charging current.

Just how are you planing to turn the fading lights on only when the charger is hooked up?
As mentioned in Post #1 of this thread, the charger has a disused +12 V output that comes on when it does. Or, had a disused +12 V output, I should say. I've since repurposed it to power not only this fader circuit, but also a warning light on the dashboard, a normally-closed relay that will inhibit operation of the propulsion motor while charging, and an alternate means of turning on the cabin heater (otherwise only operable with the "ignition" switch on; now a second 'on' position on the heater switch will run it when the charger is operating).
 
And please post a YouTube video when you get this awesomeness happening. I love the idea of a recharging car having that "sleep" kind of effect with the lights.

Unbeknown to me (until yesterday), my brother apparently already shot a (poorly lit, poor quality) video of this circuit in action, last month when I had it powered from the battery (via a relay switched by the charger) for testing purposes:
[video]http://joeshouse.2y.net:8080/~jelliott/IMG_0151.MOV[/video]
 
Fantastic! That's exactly what I imagined you were talking about.
 
Maybe I know what is wrong. I suspect all the lights and "stuff" are powerd from the 12 volt tap. If that is the case 2000Ufd. is not enough to smooth an amp or 2. Try adding a diode in series with the 12 volts going to the circuit then adding the 2000Ufd on the circuit side of the diode. Attach all the high current loads to the charger side of the diode. This should give you a nice smooth 11.6 volts for the circuit and the loads won't care that there is ripple.
 
Maybe I know what is wrong. I suspect all the lights and "stuff" are powerd from the 12 volt tap. If that is the case 2000Ufd. is not enough to smooth an amp or 2. Try adding a diode in series with the 12 volts going to the circuit then adding the 2000Ufd on the circuit side of the diode. Attach all the high current loads to the charger side of the diode. This should give you a nice smooth 11.6 volts for the circuit and the loads won't care that there is ripple.

Yes, the lights, as well as the PCB, are powered by the rectified +12 V from the charger, but it only amounts to about half an amp, for what that's worth.

Do I understand the suggestion correctly that I should power the transistors' collectors directly from the charger, and everything else on the PCB via a diode?

Thanks!
 
Fantastic! That's exactly what I imagined you were talking about.

Here's a somewhat better video that I shot with my iPhone and posted to YouTube:


Interestingly, the lamps still appear to flicker in the iPhone video, even though it's not apparent to the naked eye (the rectified +12 V power is now tied to the 12 V battery bus via two diodes in series, which eliminates the flickering, at least as far as the human eye is concerned).

Another observation: When the circuit is powered by a nice, smooth, battery voltage (as in my brother's poorly-lit video I posted earlier in post #16), the cycle is 2.5 s ramping up, and 2.5 s ramping down, as intended. But when it's powered by the unsmoothed rectified signal from the charger (as in the above YouTube video), it appears to inexplicably be 2.0 s ramping up and 3.0 s ramping down. Still 5 s total, but no longer symmetrical. What causes that? Will the (other) diode solution suggested in post #18 above eliminate that behavior and make the cycle symmetrical again?
 
Last edited by a moderator:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top