+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Member level 2
    Points: 328, Level: 3

    Join Date
    Feb 2017
    Posts
    44
    Helped
    0 / 0
    Points
    328
    Level
    3

    Digital dimmer with microcontroller

    Hi, I have found below circuit for a digital dimmer by microcontroller. Can anybody analyze this please? How does triac changes the amount of bulb's intensity?

    Click image for larger version. 

Name:	4402156800_1385532477.jpg 
Views:	21 
Size:	36.6 KB 
ID:	139534

    •   Alt21st June 2017, 19:12

      advertising

        
       

  2. #2
    Super Moderator
    Points: 68,087, Level: 63
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    11,139
    Helped
    3675 / 3675
    Points
    68,087
    Level
    63

    Re: Digital dimmer with microcontroller

    As it is, it can only turn the lamp on or off but not dim it. To allow dimming it would use phase control and need to synchronize the microcontroller signal with the AC input.

    The usual method is to use zero crossing (ZC) detection, this is simply means a signal is produced so the microcontroller knows the point where the AC waveform reverses polarity, in other words when the AC voltage passes zero as it changes from positive to negative or negative to positive. Remember that a triac like the BT136 has to be triggered but once it has been triggered it stays conducting until the current through it drops to almost zero. So if you trigger it just after zero crossing, it stays conducting for the whole period until the next zero crossing. If you delay triggering it, the first part of each cycle will pass without it conducting so the effective power it can pass to the load (the bulb) is reduced.

    Knowing when the zero crossing occurs, the microcontroller can calculate a trigger delay from almost immediate to almost the end of the half cycle so from almost nothing to full power can be passed to the load.

    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.

  3. #3
    Member level 2
    Points: 328, Level: 3

    Join Date
    Feb 2017
    Posts
    44
    Helped
    0 / 0
    Points
    328
    Level
    3

    Re: Digital dimmer with microcontroller

    Quote Originally Posted by betwixt View Post
    As it is, it can only turn the lamp on or off but not dim it. To allow dimming it would use phase control and need to synchronize the microcontroller signal with the AC input.

    The usual method is to use zero crossing (ZC) detection, this is simply means a signal is produced so the microcontroller knows the point where the AC waveform reverses polarity, in other words when the AC voltage passes zero as it changes from positive to negative or negative to positive. Remember that a triac like the BT136 has to be triggered but once it has been triggered it stays conducting until the current through it drops to almost zero. So if you trigger it just after zero crossing, it stays conducting for the whole period until the next zero crossing. If you delay triggering it, the first part of each cycle will pass without it conducting so the effective power it can pass to the load (the bulb) is reduced.

    Knowing when the zero crossing occurs, the microcontroller can calculate a trigger delay from almost immediate to almost the end of the half cycle so from almost nothing to full power can be passed to the load.

    Brian.
    Thanks for your answer. But I have a problem with this. When I set to near zero the delay for triggering triac the bulb doesn't have the full power and full light!! What is the problem!?

    •   Alt11th August 2017, 20:37

      advertising

        
       

  4. #4
    Super Moderator
    Points: 68,087, Level: 63
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    11,139
    Helped
    3675 / 3675
    Points
    68,087
    Level
    63

    Re: Digital dimmer with microcontroller

    It should have full power except for a tiny amount lost in the Triac itself but that is so small you wouldn't notice it.

    Divide the problem into two. If you disconnect the trigger signal from the micro and wire the input pin directly to the micro supply (5V/3.3V) what happens then?
    With the optocoupler LED lit all the time it should give full power to the lamp, if it doesn't, you have a problem on the AC side of the circuit. If it does, there is something wrong with the trigger signal. Try the experiment to see which is responsible.

    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.

  5. #5
    Super Moderator
    Points: 51,995, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,442
    Helped
    2485 / 2485
    Points
    51,995
    Level
    55

    Re: Digital dimmer with microcontroller

    Hi,

    There is a lot of information missing.
    Do you use zero cross detection?
    Where is your code, or at least a flowchart?

    Thanks for your answer. But I have a problem with this. When I set to near zero the delay for triggering triac the bulb doesn't have the full power and full light!! What is the problem!?
    You talk as if you use a transitor that can be switched ON and OFF at random times...but you use a triac, you have to synchronize to mains frequency.

    Klaus

  6. #6
    Member level 2
    Points: 328, Level: 3

    Join Date
    Feb 2017
    Posts
    44
    Helped
    0 / 0
    Points
    328
    Level
    3

    Re: Digital dimmer with microcontroller

    Quote Originally Posted by KlausST View Post
    Hi,

    There is a lot of information missing.
    Do you use zero cross detection?
    Where is your code, or at least a flowchart?



    You talk as if you use a transitor that can be switched ON and OFF at random times...but you use a triac, you have to synchronize to mains frequency.

    Klaus
    Yes I have a circuit for detecting zero crossings. in the code after any rising or falling edge of the output of zero crossing I set a delay and after that delay I enable the trig signal for a while to switch on triac.But when this delay is near zero I should have the full power delivered to the bulb but it doesn't!

    •   Alt12th August 2017, 11:13

      advertising

        
       

  7. #7
    Super Moderator
    Points: 51,995, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,442
    Helped
    2485 / 2485
    Points
    51,995
    Level
    55

    Re: Digital dimmer with microcontroller

    Hi,

    do you have a scope? (If not: sooner or later you need to buy one)
    --> measure zero cross signal and triac firing signal in one scope picture.

    Klaus

--[[ ]]--