+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 39
  1. #1
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    230VAC PWM LED bulb dimmer

    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?

    Click image for larger version. 

Name:	schematic-sections.png 
Views:	21 
Size:	38.6 KB 
ID:	157452

    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
      Click image for larger version. 

Name:	scope.jpg 
Views:	10 
Size:	144.6 KB 
ID:	157453


    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!

  2. #2
    Advanced Member level 5
    Points: 15,329, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,548
    Helped
    817 / 817
    Points
    15,329
    Level
    29

    Re: 230VAC PWM LED bulb dimmer

    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".
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



  3. #3
    Super Moderator
    Points: 83,031, Level: 70
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,648
    Helped
    4535 / 4535
    Points
    83,031
    Level
    70

    Re: 230VAC PWM LED bulb 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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  4. #4
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    Quote Originally Posted by schmitt trigger View Post
    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 - - -

    Quote Originally Posted by betwixt View Post
    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/d...es/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?
    Click image for larger version. 

Name:	push-pull-buffer.PNG 
Views:	9 
Size:	16.8 KB 
ID:	157454
    Last edited by Cortezz; 22nd January 2020 at 22:53.



    •   AltAdvertisement

        
       

  5. #5
    Advanced Member level 5
    Points: 12,844, Level: 27

    Join Date
    Aug 2015
    Location
    Melbourne
    Posts
    2,106
    Helped
    769 / 769
    Points
    12,844
    Level
    27

    Re: 230VAC PWM LED bulb dimmer

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



  6. #6
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    Donno but it's definitely and finely dimmable. The error is on my side...

    Wow, that sounds great:
    https://www.radiolocman.com/news/new.html?di=157243
    (IX3180 Opto-Isolated Fast Gate Driver for Power MOSFETs)
    Click image for larger version. 

Name:	opto.gif 
Views:	2 
Size:	11.0 KB 
ID:	157455



  7. #7
    Advanced Member level 5
    Points: 12,844, Level: 27

    Join Date
    Aug 2015
    Location
    Melbourne
    Posts
    2,106
    Helped
    769 / 769
    Points
    12,844
    Level
    27

    Re: 230VAC PWM LED bulb dimmer

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



  8. #8
    Super Moderator
    Points: 83,031, Level: 70
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,648
    Helped
    4535 / 4535
    Points
    83,031
    Level
    70

    Re: 230VAC PWM LED bulb dimmer

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  9. #9
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    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..!



    •   AltAdvertisement

        
       

  10. #10
    Advanced Member level 5
    Points: 15,329, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,548
    Helped
    817 / 817
    Points
    15,329
    Level
    29

    Re: 230VAC PWM LED bulb dimmer

    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.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



    •   AltAdvertisement

        
       

  11. #11
    Advanced Member level 5
    Points: 12,844, Level: 27

    Join Date
    Aug 2015
    Location
    Melbourne
    Posts
    2,106
    Helped
    769 / 769
    Points
    12,844
    Level
    27

    Re: 230VAC PWM LED bulb dimmer

    What happens when you include C8...?



  12. #12
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    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:
    Click image for larger version. 

Name:	2 - opto output.jpg 
Views:	3 
Size:	162.6 KB 
ID:	157477

    I checked the 555 output rigth at the opto input but it was OK:
    Click image for larger version. 

Name:	1 - 555 output.jpg 
Views:	3 
Size:	148.9 KB 
ID:	157476

    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:
    Click image for larger version. 

Name:	sch-diff.png 
Views:	9 
Size:	39.4 KB 
ID:	157479
    I marked the relevant changes.

    So now this is the waweform at the BUX base which looks ideal:
    Click image for larger version. 

Name:	3 - final opto output.jpg 
Views:	4 
Size:	125.5 KB 
ID:	157478

    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.



  13. #13
    Advanced Member level 5
    Points: 12,844, Level: 27

    Join Date
    Aug 2015
    Location
    Melbourne
    Posts
    2,106
    Helped
    769 / 769
    Points
    12,844
    Level
    27

    Re: 230VAC PWM LED bulb dimmer

    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 by Easy peasy; 25th January 2020 at 00:30.



  14. #14
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    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?

    Click image for larger version. 

Name:	1 - datasheet.PNG 
Views:	3 
Size:	30.6 KB 
ID:	157480

    So to have the average current is this simulation correct?

    Click image for larger version. 

Name:	2 - simulation.PNG 
Views:	3 
Size:	39.7 KB 
ID:	157481

    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?

    Click image for larger version. 

Name:	3 - power-supply.PNG 
Views:	3 
Size:	36.9 KB 
ID:	157482



  15. #15
    Super Moderator
    Points: 264,156, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    46,156
    Helped
    14037 / 14037
    Points
    264,156
    Level
    100

    Re: 230VAC PWM LED bulb dimmer

    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.



  16. #16
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    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:
    Click image for larger version. 

Name:	555-resistor.PNG 
Views:	3 
Size:	15.9 KB 
ID:	157483
    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:
    Click image for larger version. 

Name:	4 - LED bulb current on 100R 2V DIV.jpg 
Views:	1 
Size:	170.8 KB 
ID:	157484
    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?



  17. #17
    Super Moderator
    Points: 264,156, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    46,156
    Helped
    14037 / 14037
    Points
    264,156
    Level
    100

    Re: 230VAC PWM LED bulb dimmer

    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.



  18. #18
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    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..?

    Quote Originally Posted by FvM View Post
    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..!

    Quote Originally Posted by FvM View Post
    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:
    Click image for larger version. 

Name:	5 - BUX BE voltage with LED load.jpg 
Views:	1 
Size:	67.3 KB 
ID:	157486
    (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?
    Last edited by Cortezz; 25th January 2020 at 14:34.



  19. #19
    Junior Member level 3
    Points: 138, Level: 1

    Join Date
    Jan 2020
    Posts
    30
    Helped
    0 / 0
    Points
    138
    Level
    1

    Re: 230VAC PWM LED bulb dimmer

    I made a ~20W resistive dummy load to check both the flickering and BUX temperature issues:
    Click image for larger version. 

Name:	6 - dummy resistive load.jpg 
Views:	3 
Size:	111.3 KB 
ID:	157487

    But with this load the switching is perfect:
    Click image for larger version. 

Name:	6 - resistive dummy load current 2V DIV on 100R.jpg 
Views:	2 
Size:	108.7 KB 
ID:	157488

    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...
    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..?



    •   AltAdvertisement

        
       

  20. #20
    Super Moderator
    Points: 264,156, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    46,156
    Helped
    14037 / 14037
    Points
    264,156
    Level
    100

    Re: 230VAC PWM LED bulb dimmer

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



--[[ ]]--