Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

230VAC PWM LED bulb dimmer

Status
Not open for further replies.

Cortezz

Junior Member level 3
Joined
Jan 9, 2020
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
332
Hi!

I designed a dimmer for 230VAC 50Hz for a few GU10 LED bulb with the classic 555 PWM circuit.
It basically works but I have some major issues could you help me to improve it?

schematic-sections.png

The basic concept:
  • 555 based PWM tuned around 500Hz
  • rectified AC for the LED bulb (the 10k on the circuit)
  • a high voltage BJT (BUX 87) for switching
  • a (darlington) opto for separating the two
  • 15V zener to protect the opto from high voltage
  • at the very first design R9, C7, C8 werent there at all
  • R10 is just there for LT Spice

First problems were:
  1. at zero pot level the bulbs were glowing already
    thought: even at zero level the 555 produces some spikes and with the darlington opto it simply turns the BJT on
  2. the dimming was working partially but there was some shimmering in the light level
    thought: as the PWM has some different frequency and phase as the mains 50Hz they were interfering
    scope.jpg

Trials for problem #1:
  • adding R9 to make the BJT less sensitive to low currents
    result: worked partly: but wans't stable the min and max level was moving continuesly with temperature
  • adding C7 to speend up the BJT switching
    result: not much

Trials for problem #2:
  • adding C8 to smoothing the rectified mains voltage to avoid the 50Hz vs PWM phase interfering (attachment)
    result: works

Remaining issues:
  • I can't achieve a stable zero, intermediate and max state with the dimming
  • at max level the dimmer starts to blink at ~2Hz the bulbs for some reason (BJT temperature oscillation?!)
  • at higher level the BJT gets very hot

Questions:
  • Is it possible somehow to achieve a perfect zero PWM level using this 555 layout?
  • How should I change the working to a more digital kind of operating?
    I mean now it's more like an analog type as the BJT starts to turn on even a low current.
    And the LED bulbs are very sensitive so I guess that's why they glow already on the min pot level.
    There should be a hysteresis maybe. Or should I use some other digital opto rather then this darlington type?
  • Should I use rather a MOSFET (IRF730) for switching? (faster switching, higher turn-on-voltage-threshold, etc?)
  • Do you have any other suggestions to improve this circuit?

Thanks in advance!
 

You can't dim with PWM a device which is connected to the power line.

You do phase control.
In its simplest terms, you synchronize to the zero crossing and delay the triggering a few milliseconds. That delay sets your brightness.
And the semiconductor device is a Triac, not a transistor. Can also be done with a pair of SCRs.

And the optocoupler has a Triac output, not a transistor output.

Google "Triac dimmer".
 

Firstly, make sure the GU10 LED bulbs are truly dimmable. Most already have a switching current regulator in them which will interfere with the drive signal from your circuit.

I think it is unlikely you have sufficient base current in the BUX87 to provide reliable switching. Because most of the base current comes from C7 discharging, you may need a much bigger value and possibly a lower value for R7. Increasing C7 alone may work at low PWM ratio because it has longer to charge but at full brightness, all the base current has to flow through R7 and the optocoupler. A MOSFET might be a better option simply because at low frequency it requires little gate current.

The NE555 will not give you a complete 0% to 100% pulse/space ratio anyway. A small MCU with an ADC feeding a PWM generator will give you full range with fewer components but you will need some simple software. (read ADC --> write PWM)

It would be wise to add some resistance in series with the 'PWM PS' 220nF capacitor in case it goes short circuit!

Just my thoughts....

Brian.
 

You can't dim with PWM a device which is connected to the power line.

You do phase control.
In its simplest terms, you synchronize to the zero crossing and delay the triggering a few milliseconds. That delay sets your brightness.
And the semiconductor device is a Triac, not a transistor. Can also be done with a pair of SCRs.

And the optocoupler has a Triac output, not a transistor output.

Google "Triac dimmer".
I started with the classic triac dimmer and while it's good for a conventional bulb
it's not good for a few W LED bulb as triacs are working properly only if they have
a specific current which gives you a sudden snap on with LEDs and even some
shimmering as well due to low currents.
And as I said it's very promising just have to improve it with the above issues.

- - - Updated - - -

Firstly, make sure the GU10 LED bulbs are truly dimmable. Most already have a switching current regulator in them which will interfere with the drive signal from your circuit.

I think it is unlikely you have sufficient base current in the BUX87 to provide reliable switching. Because most of the base current comes from C7 discharging, you may need a much bigger value and possibly a lower value for R7. Increasing C7 alone may work at low PWM ratio because it has longer to charge but at full brightness, all the base current has to flow through R7 and the optocoupler. A MOSFET might be a better option simply because at low frequency it requires little gate current.

The NE555 will not give you a complete 0% to 100% pulse/space ratio anyway. A small MCU with an ADC feeding a PWM generator will give you full range with fewer components but you will need some simple software. (read ADC --> write PWM)

It would be wise to add some resistance in series with the 'PWM PS' 220nF capacitor in case it goes short circuit!

Just my thoughts....

Brian.

Yes the bulbs are of course dimmable! :)

BUX87 base current vs C7:
It works even without C7 as note the R7 is connected to 325V (almost) DC
so this means ~3mA of base current which should be simply enough to
drive a 5W LED bulb (Ic = ~20mA is needed and ß is around min 50 with this BUX87).

NE555 vs 0% to 100%: I just found this solution which I like:
https://www.maximintegrated.com/en/design/technical-documents/app-notes/4/4502.html
as it's even can be controlled via a 0 - 5V voltage level.

But anyway this is the last problem as 0% is not the main concern but my starts at around ~30%.
My hint is some transient problem for example the BUX87 gets open even from the short pulses
from the 555 and the opto and after that stays a much longer open as the original pulse
as the charging/discharging phase is not symetrical. That's why I tried to add the R9 resistor
which almost works but definitely it's not a perfect solution as the base current is depending
a lot from the temperature so a fixed value "pull-down" resistor can't be enough there.

What other solutions there can be to quickly turn ON and OFF the BUX and follow perfectly
the 555 even with the shortest pulses at around the "0%" PWM level?
Some kind of push-pull buffer stage would be required maybe after the opto and before the BUX?

Maybe something like that?
push-pull-buffer.PNG
 
Last edited:

What electronics are inside the bulb? - just LED's in series or ...? ?
 

might be a good idea to break one open and draw a schematic of the inside - could be quite helpful...
 

Yes the bulbs are of course dimmable!
A dimmable LED lamp means it has an internal control circuit that recognizes the shape of 'chopped' phase control signals or uses PWM derived from its own internal controller. It doesn't necessarily mean it responds to changes in input voltage or fast switched voltage pulses. Temporarily substitute your LED with an incandescent lamp, it that works it means your dimmable LED is the problem.

The circuit should also be producing chopped DC, C8 should be adequate to maintain a reasonably 'clean' voltage level but the waveform you show seems to imply it runs on full wave rectified AC. LED lamps contain their own bridge rectifiers that should be good to a few KHz operation but of course only half the bridge will be in operation when using a DC source. If any capacitive voltage dropping or coupling is used inside the lamp it will be very confused.

Brian.
 

Testing a LED dimmer with incandescent lamp is misleading as the loading currents are much larger and more resistor like.

Waweform: yes, it was taken before adding C8 of course.

Tonight I'll try to use a different opto for the dimmer as I found a so called "IC out" type
which is relatively cheap and designed specially for driving switching devices directly.

I'll report about the results..!
 

Attachments

  • TLP250.png
    TLP250.png
    99.6 KB · Views: 140

Dimmable LED lamp drivers are designed to work with phase control! Not with free-running PWM!

The snap that you mention is corrected with a double time constant Triac trigger circuit. Check figures AN1003.9 and AN1003.11 on the attached link.
https://fliphtml5.com/gjox/fqiu/basic

If you want to use PWM, chopping, or whatever you want to call it, then it STILL HAS TO BE synchronized with the zero crossing.
 

Hi Guys!

Good news...!!!
It is working now perfectly!
Yesterday I havent had time to investigate but tonight I jumped into it.

First I took out the BUX BJT to check to base system and I found that already
the minimum level PWM signal is too slow at the BUX base after the opto:
2 - opto output.jpg

I checked the 555 output rigth at the opto input but it was OK:
1 - 555 output.jpg

So I thought the problem was already at the opto so I tried to
increase the forward current but it didn't help so I replaced
my default TLP627 darlington output opto to a simple 4N35 one.
After that the switching times were much better...
Even at the minimum level the LED bulb wasn't glowing at all
so now it works really from 0 to 100%.
A pull down resistor was neccesary thought at the BUX base to GND.
So this is the final schematic which works now flawlessly:
sch-diff.png
I marked the relevant changes.

So now this is the waweform at the BUX base which looks ideal:
3 - final opto output.jpg

I'll try to decrease the 22uF later I guess even a 4.7uF will be enough
here for a few W LED bulbs eliminating the phase/frequency interference
between the mains 50Hz and the PWM.
 

If you ran the 555 off 12V - you could then direct drive a 700/800V mosfet with ease from the 555, - assuming you can common up the gnds on the two ckts, actually the CMOS 555 ( e.g. TLC555 ) would happily run off the 15V zener on the base drive ckt ( at 12V say for extra safety - with a 220nF across it ) - opto not then needed ...

I guess the BUX87 is very cheap

what is the max power of LED bulb you are going to dim?
 
Last edited:

No opto + direct drive + common GND:
Yeah, I also thought on this but I am not sure:
how to calculate the current needed for switching a MOSFET?

Let's take this example with this IRF840 Power MOSFET:
Vdsmax=500V Idmax=8A Vgs=10V Rds=0.85R
Input capacitance is 1.3nF right?

1 - datasheet.PNG

So to have the average current is this simulation correct?

2 - simulation.PNG

So there is a 0.5mA average current consumption?

Regarding the CMOS-555 datasheet it needs also a few 100uA-s
so such a PS design with 10V + 1mA capability should be enough
for the CMOS 555 supply and the MOSFET switching ON-OFF currents?

3 - power-supply.PNG
 

It doesn't actually matter in this case, but your gate drive power calculation is completely wrong. Neither gate Iavg nor Irms is significant, instead you'll put in Qg*Vgs as energy consumed per switching cycle. Gives 630 nC respectively 315 µW at 500 Hz, probably negligible compared to rest of the driver circuit.
 

Ok, thanks!
I checked the 555 consumed currents on spice (with a normal, non-CMOS 555 model)
and I realised that there is one more "big" consumer, the 1k at the discharge ping with
this standard 555 PWM layout as this node is on V+ when the output state is OFF:
555-resistor.PNG
Do you have any idea to decrease this current?
Or simply we have to use a 1Meg Pot and then it can be increased to 10k?
(And decrease the 47n to 4n7 as well of course.)

I noticed some subtle flickering on the lower dimming states with the BJT
version posted earlier, so I checked the current on the LED bulb
with a series 100R resistor, here is the result:
4 - LED bulb current on 100R 2V DIV.jpg
The scope is at 2V / DIV on the 100R resistor so it's around 20mA / DIV.
It's as 5W dimmable LED bulb so the nominal max currents should be around 22mA.
But as you can see at the turn on it takes a triple amount of
current and then it settles to the nominal value.
At max dimming level it settles also to the noninal current at all time.

One other thing which is strange for me is this ripple.
Is this some kind of oscillatiion..?
It's the dimmer circuit or some interference with the LED bulb PS circuit..?
Ok I got the idea: I'll test it with a resistive dummy load...

And I measured the BUX temperature and it's around 60C° for this 5W bulb.
Is it okay or there is something to improve and it should be around 30-40C max?
 

You can alternatively drive the 555 charge/discharge resistors by OUT pin, leaving DIS pin unconnected.

Some flickering can be expected due to 500 Hz pwm running asynchronous to 50 Hz mains.
 

I checked this resonance with a same resistance dummy resistive load + normal
5mm white led in series and the current waveform on the load was a perfect
square so I guess it's generated by the bulb or together with my dimmer.
And even the BJT wasn't so hot.
Do you have any idea how to solve this? Maybe I have to add some snubber..?
Or simply this bulb was not designed to such a PWM kind of drive..?

You can alternatively drive the 555 charge/discharge resistors by OUT pin, leaving DIS pin unconnected.
Ohh good idea...! I tried it on Spice and it works like a charm, thanks a lot..!

Some flickering can be expected due to 500 Hz pwm running asynchronous to 50 Hz mains.
I guess it's rather an issue as interfering with the bulb electronics
as it wasn't there with the resistive load + LED combination at all.
Plus I have a filter cap after rectification so I have almost 330VDC to switch for the bulbs.
Edit: now I tried my setup with a higher pull-down resistance (10k) at BUX B to GND and seems better.

And I attached a picture from my workspace just for fun... :)

- - - Updated - - -

I checked to voltage on the BUX Vbe and it looks like this:
5 - BUX BE voltage with LED load.jpg
(Sorry for the multiple signals, I couldn't stabilze it on my scope...)
I guess this slow turning off is responsible for the temperature.

Or the other thing can be that it is not fully conducting so maybe
I have to increase the base current and/or the opto currents, right?
 

Attachments

  • 5 - developing.jpg
    5 - developing.jpg
    82.9 KB · Views: 163
Last edited:

I made a ~20W resistive dummy load to check both the flickering and BUX temperature issues:
6 - dummy resistive load.jpg

But with this load the switching is perfect:
6 - resistive dummy load current 2V DIV on 100R.jpg

The BUX is cool not even warm... (around: 25 - 30C°)
And with the LED I can see that there isn't any flickering neither.

So I guess it's sucks that the dimmable LED bulb is the problem... :sad:
Maybe they dont like this squarewave like fast leading edge turn-on?
Is there any chance that some snubber can help with this?
Paralell on the LED or maybe on the BUX..?
 

If it's dimmable LED, what's the specification? Typically they use trailing edge phase control.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top