Bulb controller

Thread Starter

meththas

Joined Feb 26, 2010
16
Hi guys,

I am trying to control a tungston halogen bulb (6V, 20W) using a PIC. I want to ramp up the current gradually till its fully on - then when switching it off, ramp down the current again in a controlled manner.

Now, the first design that came to my mind is to use a transistor and to control it with a PWM signal. However I am worried about the bulb life in this design - the PWM will continusously switch the bulb on and off right?

Does anyone know of a better way to acheive this?

The reason I want to ramp the current up and down is to ensure the bulb doesnt heat up unnecessarily and to not introduce sudden currents. The bulb will be on for maybe a minute before being switched off again.

Any help would be much appreciated.

Thank you!
 

Jaguarjoe

Joined Apr 7, 2010
767
You could try doing it with a Triac and 12V AC power. I never used a Triac at 12V, but it ought to work.
You could also try high frequency PWM. Maybe 20kHZ or so. At that rate, the lamp will never be turning on or off, it will see the average voltage dependent upon the duty cycle.
 

retched

Joined Dec 5, 2009
5,207
You may look into soft start circuits with pics.

Soft start is basically what you are doing. Depending on how quickly you ramp up and down the lamp.
 

Thread Starter

meththas

Joined Feb 26, 2010
16
Thanks guys for the suggestions - just a quick question... does the current stay constant in this type of circuit or is it likely for voltage and current to fluctuate?

I need the bulb to have a constant current of 3.3V at 6V so that the intensity remains as constant as possible
 

retched

Joined Dec 5, 2009
5,207
Im guessing you meant 3.3 AMPS at 6V.

Are you trying to say you don't want to change the brightness of the bulb while you ramp it up and down?
 

Thread Starter

meththas

Joined Feb 26, 2010
16
Sorry - what I meant was, when its fully on, I want the current and voltage to be constant 3.3Amps (yes sorry not volts) @ 6V. So the brightness stays constant when fully on. Not during the ramp up and down periods.

Is this even possible with a transistor - or should I add an opamp with feed back (maybe) for this purpose?
 

Jaguarjoe

Joined Apr 7, 2010
767
The current through the lamp will be determined by the applied voltage and the resistance of the lamp. The applied voltage will be determined by the PWM duty cycle and the resistance of the MOSFET used to drive the lamp assuming that the power supply is constant. The duty cycle is determined by the PIC and its code, it shouldn't vary if done right. The resistance of the MOSFET will change with temperature but only slightly compared to the lamp voltage.
The intensity of the lamp is proportional to applied voltage, not current. Running at a constant current could be a problem because the resistance of the filament will change over a ratio of 10 or 20:1. This could put some really high voltage across the lamp.
 

timrobbins

Joined Aug 29, 2009
318
Is your power source AC or DC?

If you're after constant light output then as well as electrical power control, you may need an optical feedback loop to manage bulb aging (filament metal coating glass, and filament getting thinner).

Apart from aging variation, I would have thought that the temperature of the filament dictated the 'light' output level (intensity and spectrum) - as such you may want to calculate power input to the bulb and regulate on that parameter, and ramp on that parameter in a slow response manner. However you will be limited by digital quantisation of the PIC.

You could use either the pwm output of the PIC directly to control the bulb, or you could use the standard PIC technique to achieve a DAC output to give an analog reference voltage for use with a current controlled series regulator (FET) circuit for DC powering.

If you set the source voltage at the rated voltage of the bulb, and then use hard-switched pwm, then yes the current will reach the typical 'turn-on' level when pulses are initially applied and the filament is cold. Is that a problem? Good question. The higher current at cold filament temp is an extra stress, but then again it may not materially reduce bulb life until a long way into service lifetime when filament is thinner. So you could use a two step approach - with a switched in series resistor during initial power up stage.

If the PWM frequency is too low then you will introduce thermal cycling effects, which may be a both an extra stress on the bulb, and show up in the light output intensity as a ripple.

Ciao, Tim
 

tom66

Joined May 9, 2009
2,595
Filament bulbs are damaged by switching them on and off but only if they are allowed to cool down. Cooling down then up again causes thermal contraction and expansion and leads to the eventual failure of the lamp. However, if you're using PWM at 20 KHz, this cycle does not happen (or only happens on a minute scale) so the bulb will not be damaged.
 

jpanhalt

Joined Jan 18, 2008
11,087
Just put a low-pass filter (resistor-capacitor) on the output of the PWM. That will effectively convert the PWM to variable DC to allow your slow start.

John
 

Thread Starter

meththas

Joined Feb 26, 2010
16
Thank you for your help.

I am using a DC source.

When you said use a FET to control the current - did you mean a MOSFEt to be used in the same configuration - but to replace the BJT?

Also, could you please explain a bit more about the switched in series resistor?

I am sorry for all the questions - I am new to doing practical electrical circuits - and now learning as part of the work I do.


Is your power source AC or DC?

If you're after constant light output then as well as electrical power control, you may need an optical feedback loop to manage bulb aging (filament metal coating glass, and filament getting thinner).

Apart from aging variation, I would have thought that the temperature of the filament dictated the 'light' output level (intensity and spectrum) - as such you may want to calculate power input to the bulb and regulate on that parameter, and ramp on that parameter in a slow response manner. However you will be limited by digital quantisation of the PIC.

You could use either the pwm output of the PIC directly to control the bulb, or you could use the standard PIC technique to achieve a DAC output to give an analog reference voltage for use with a current controlled series regulator (FET) circuit for DC powering.

If you set the source voltage at the rated voltage of the bulb, and then use hard-switched pwm, then yes the current will reach the typical 'turn-on' level when pulses are initially applied and the filament is cold. Is that a problem? Good question. The higher current at cold filament temp is an extra stress, but then again it may not materially reduce bulb life until a long way into service lifetime when filament is thinner. So you could use a two step approach - with a switched in series resistor during initial power up stage.

If the PWM frequency is too low then you will introduce thermal cycling effects, which may be a both an extra stress on the bulb, and show up in the light output intensity as a ripple.

Ciao, Tim
 

Thread Starter

meththas

Joined Feb 26, 2010
16
Filament bulbs are damaged by switching them on and off but only if they are allowed to cool down. Cooling down then up again causes thermal contraction and expansion and leads to the eventual failure of the lamp. However, if you're using PWM at 20 KHz, this cycle does not happen (or only happens on a minute scale) so the bulb will not be damaged.

thank you for that tip. Will keep in mind when writing up the PIC code.

Do you know how may steps should be taken when ramping the voltage- or will it not matter? I was thinking of around 1024 steps so at 20kHz, it will take around 51 ms to switch on the bulb.
 

Thread Starter

meththas

Joined Feb 26, 2010
16
Just put a low-pass filter (resistor-capacitor) on the output of the PWM. That will effectively convert the PWM to variable DC to allow your slow start.

John
wow - that's a good solution I had not thought of. However, as the PIC will be at 5V, and the bulb at 12V - I am guessing I cant use this solution?? Or can I ?
 

budo

Joined Sep 23, 2010
5
The lamp current will be much higher when the lamp is cold (~5-10x). This effect is unavoidable and PWMing it will not help, it will only slow the time required to reach temperature. Adding a current limit could be a solution, but selecting it too low may prevent it from lighting.
 

jpanhalt

Joined Jan 18, 2008
11,087
Hi guys,

Now, the first design that came to my mind is to use a transistor and to control it with a PWM signal.
I assumed you would keep the transistor to provide adequate current and voltage. It's output will still be PWM'd. It is that output that you could add the low-pass filter to.

You could also use a filter to drive a transistor as a variable resistor, but then you potentially will be creating quite a bit of heat in the transistor. I would prefer the first option.

John
 

timrobbins

Joined Aug 29, 2009
318
A power mosfet can be used with a current sense source resistor and an opamp and a reference voltage to regulate the power into the bulb - the bulb current passes through the FET and the sense resistor. The reference comes from a DAC output, based on program calculations. Such a circuit will use the FET to dissipate power in a linear mode (not switchmode), but has the advantage of limiting the peak current in the bulb.

You can also use a bjt or FET to regulate the power in the bulb using PWM. Such a circuit will use the FET to dissipate power in a switchmode manner, but has the disadvantage of not limiting the peak current in the bulb.

PWM and DAC techniques and code are regularly discussed on PIC forums, eg.
http://www.picaxeforum.co.uk/showthread.php?t=15331

You could use a bjt/fet to pass current through the bulb and a series resistor. You could use multiple such switches, and their series resistors, to regulate the total current through the bulb. You could set up the resistor values to give you pseudo binary step levels of current. The more DO's from the PIC, the better the resolution of power regulation you can achieve. Such a circuit will use the bjt/FET to dissipate power in a switchmode manner, with the advantage of limiting the peak current in the bulb.

Ciao, Tim
 
Top