This project can also be found at

Save Energy Beautifully !!

By using a light dimmer in one’s living room, it’s possible to completely alter the mood and ambience of a room at the drop of a hat.
The Internet of Things is set to disrupt the way we live and work. Smart homes filled with connected products are loaded with possibilities to make our lives easier, more convenient, and more comfortable.

With Wi-Fi connectivity present in the dimming controller, the above benefits get reflected in this module. However, this actually carries with it a host of less obvious but equally favorable benefits such as reduced energy consumption and improved longevity - longer the bulbs are dimmed, lesser the energy they use and longer they last.

This project aims to

● Control the intensity of the dimmable lighting appliances via a trailing edge dimmer.

● Provide the user , ability to control lightsindependently and wirelessly over the Wi-Fi network and the Internet!

Project Demo:


Nice..,isn't it you too can make one for yourselves!!,I have spent a few months understanding and making this dimmer module.

You will find all the source files,step by step instructions and things I experienced while making this project compiled in this instructable.

I hope you would learn a lot and enjoy as you proceed further!!

Understanding Light Dimmers

There are two main categories of traditional AC dimmers (also known as 'phase-cut' dimmers)

These vary the brightness of the lighting appliance by varying the rms voltage applied to the load.

This design uses a Trailing Edge Dimmer

They provide a 'soft start', increasing the voltage to the lamp relatively slowly.

With incandescent lamps, this almost eliminates 'thermal shock' - that brief period at switch-on where the lamp draws around 10 times the normal operating current.
By including the soft-start feature lamp life is increased, but it doesn't help CFLs or LED lamps much.

Trailing edge dimmers commonly use a MOSFET, as these require almost no control current and are rugged and reliable.

Another option is to use an IGBT (insulated gate bipolar transistor), which combines the advantages of both MOSFET and bipolar transistor. These are generally more expensive than MOSFETs.


Each subsection of the schematic has been explained in detail further.

Zero Crossing Detection Unit:

12V DC Supply:

To minimize the switching losses in the mosfet IRF740, the gate control signal from the mcu is scaled to 12V.

Note: Each Channel needs it’s own dc supply.

MOSFET Driver:

DC supply to MCU is provided by 220V AC to 5V DC 3W PCB Mounted Plastics Enclosed Isolated Switching Step-Down Power Supply Module (HLK- PM01) having compact form factor.

Putting Everything Together:

After understanding each of the sub units,functioning of the entire circuit is illustrated here.

Designing the Web App:

Programming the ESP8266:

Arduino IDE is used to program the NodeMCU ESP8266 module.

  • To use ESP8266 with arduino IDE follow the steps given below,
  • Please refer following link for getting started with Arduino IDE for ESP8266
  • Download the source code from the link provided,
  • The Source contains following files
  • Using long delays is highly discouraged while using ESP8266 as there is a lot of code that needs to run on the chip besides the sketch when WiFi is connected which may lead to frequent WDT resets.Hence we use hw_timers to save ourselves from this trouble.

  • PCB Design

    -Installation and Setup

    -Using eagle schematic

    -Using eagle board layout


    Please place the components(especially diodes,4N35 and other polarity sensitive components) in proper orientation while soldering.You may want to lay the silkscreen (if possible) for the same.


    Now that the PCB is ready it is extremely important to take the following precautions before testing the module for the first time (Don't be overwhelmed have some patience!!!)

    Now you are ready to test the design safely,always remember SAFETY FIRST,especially for newbies..

    (Henceforth, you may remove the series bulbs and test the pcb directly from mains supply)

    If things go fine you have successfully made a dimmer module, Congratulations!!!

    Else check your soldering work again with a DMM.

    Final Product!!

    The finished Dimmer module can be used to control the ambience of your room conveniently.

    I have added some videos to demonstrate/explain working of the prototype and an image showing it's installation in my home.

    Now it's time to make yours!!!

    If you happen to do some creative work do let me know.