DIY Trailing Edge Dimmer

Introduction: DIY Trailing Edge Dimmer

About: Awesome Electronics Tutorials, Projects and How To´s

In this project we will have a closer look at the electrical challenges AC LED light bulbs offer when it comes to dimming them. That means I will tell you a bit about how they are built and we will also determine the differences between leading edge and trailing edge dimmers. At the end I will then show you how to create a DIY trailing edge dimmer that you can even build at home for cheap. Let's get started!

Step 1: Watch the Video!

The video gives you all information you need to create your own DIY trailing edge dimmer. During the next steps though I will present you some additional information.

Step 2: Order Your PCBs/Components!

Here you can find the links to my EasyEDA files, where you can export the gerber files and thus order the PCBs:

https://bit.ly/2WHUibn

https://bit.ly/2WMFM2b

Here you can find a parts list with example seller (affiliate links):

Aliexpress:

1 x ATtiny85: https://s.click.aliexpress.com/e/_dSJ49k7

1x HI-Link 12V Power Supply: https://s.click.aliexpress.com/e/_Bfh98tiB

1x 1206 Resistor kit: https://s.click.aliexpress.com/e/_dZ3BhPt

1x 1206 Capacitor kit: https://s.click.aliexpress.com/e/_BfgJpGwj

Ebay:

1 x ATtiny85: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x HI-Link 12V Power Supply: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 1206 Resistor kit: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 1206 Capacitor kit: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

The rest of the components you can find in the schematic for the project. Feel free to order them from your favourite electronics supplier.

Step 3: Solder All the Components!

Now all you have to do is to solder all the components in place on the PCB. At this point the FL5150 circuit is done. But for the ATtiny dimmer you will need to follow the next step.

Step 4: Upload the Code!

Here you can find the code that I created for the ATtiny85. Upload it with your favourite ISP programmer.

Step 5: Success!

You did it! You just created your own DIY AC Trailing Edge Dimmer!

Feel free to check out my YouTube channel for more awesome projects: http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    30 Discussions

    0
    theboy007
    theboy007

    5 days ago

    What is the value of the fuse you use? did you picked this based on the max amount of current that is allow to flow trough the IRF840? ( from project: https://bit.ly/2WMFM2b)

    2
    sinderw
    sinderw

    1 year ago

    Hi, I wanted to know what is the point of using an optocoupler (U5) in the ATTiny version? The ground is common between the two sides and therefore the logic circuit is either riding on the neutral wire (not very safe) or on the live wire (well, not safe at all)

    2
    MrinmayD2
    MrinmayD2

    Reply 1 year ago

    True. Really dangerous with mains running through the pot.
    BTW if the circuit is running AC mains through all of it, why not use capacitor voltage dropper as power supply

    0
    oschonrock
    oschonrock

    Reply 6 days ago

    I noticed this problem too.

    The issue here is that if you're going to use the 12V Power Supply GND as the center of your MOSFETS then you shouldn't / can't use that same GND for the uC side. ie the 5V power supply must not be just an voltage regulator cut down version of the 12V with the same ground. You must have a separate isolated 5V and 12V.

    This always happens when you meed to switch high side MOSFETS I think. So you always need a whole isolated separate power supply. Alternatively there are specialist MOSFET driver ICs with bootstrap capacitors that can do this kind of thing. Not an expert on those yet.

    But this circuit is dangerous and should not be used like that.

    0
    afagard
    afagard

    Reply 8 months ago

    mains isn't running through the pot... the pot isn't even on that circuit...

    0
    afagard
    afagard

    Reply 8 months ago

    how do you plan on switching the load without an opto? what you are saying would be true if there was no opto with a digital pin feeding a mosfet directly. the opto prevents this from being the case and provides a level of isolation if properly spec'd and designed. everything to the right of the opto is isolated in this schematic. unless i'm not understanding you correctly?

    0
    TT-392
    TT-392

    Reply 8 months ago

    sinderw is right here, sure the optocoupler provides a little transistor that might help in driving the fet. But it provides no isolation because the ground and 12V of the low voltage side are connected on the mains side. This actually makes it a really dangerous circuit because you are now working with a non isolated power supply. And yes, non isolated power supplies can be done safe with proper potentiometers made for mains applications or when you are using a wireless system. But that is clearly not the case here.

    0
    afagard
    afagard

    Reply 8 months ago

    Idk what I was looking at, but you guys are totally right. Damn that is dangerous.

    0
    TT-392
    TT-392

    Reply 7 months ago

    The dangerous part isn't even really the mains going through a pot. This
    can actually be done safely with a proper pot and casing, or I guess rubber gloves. The dangerous part is that at first look, you can very easily mistake the circuit for a safe isolated one.

    0
    Puputo2
    Puputo2

    9 months ago

    Hello guys!
    In the FL5150 circuit I can see Scott dimming the bulb using just one pot, what does the other pot do?
    And would be possible to remove the leadig edge option? I mean remove the switch and every component needed for it.
    Thanks!

    0
    kurtosbrasil
    kurtosbrasil

    Reply 22 days ago

    in simple words, point zero or offset

    0
    j.tauscher87
    j.tauscher87

    Reply 9 months ago

    In the datasheet you can find it as offset pot (Roffset).

    Unbenannt.PNG
    0
    kurtosbrasil
    kurtosbrasil

    Answer 22 days ago

    I use one simillar to this one bought in Aliexpress and it works great for flowering, vegetating , it would work.

    0
    kurtosbrasil
    kurtosbrasil

    22 days ago

    Where can I find the FL5150 or the FL5160?

    0
    rmaurya1996.rm
    rmaurya1996.rm

    3 months ago

    So this question is been bugging me up, what if i use Phase pin on the MOSFET's so where the ground pin goes

    mosfet.JPG
    0
    akshay217
    akshay217

    4 months ago

    I have design the same circuit but I get flickering output at the load.
    At DRV gate pin I received 2 Square wave pulses One has Amplitude slightly Shorter than other.
    Any one know why it should happen?

    IMG_20200317_175115.jpg
    0
    Dhulfiqar
    Dhulfiqar

    1 year ago

    Excellent work Scott,
    is it possible to controll this dimmer with an Arduino instead of rotating the potentiometer ,
    like in this AC Light Dimmer Module ?

    0
    mriksman
    mriksman

    Reply 5 months ago

    I have the same query! Did you ever have any luck?

    0
    okkesozturk95
    okkesozturk95

    Reply 6 months ago

    I use the same card but it is not working i do properly what should what you need , I use attiny85