DONOFF iot light dimmer

Placed on

The Electronics

You can find hundreds of posts on the internet explaining how to dim a lamp using a triac by cutting off part of the sine wave.
Some describe how to truncate the sinus at the beginning (Leading-Edge)
Others describe how to truncate the sinus at the end (Trailing-Edge) and what the advantages and disadvantages of both methods are.
Elegant and simple as both solutions are, they only work for resistive loads (aka incandescent bulbs). However, it is becoming increasingly difficult to buy light bulbs, at least in the Netherlands, and in the near future you will only be able to buy LED lamps. The problem with LED bulbs is that you can't dim them using the methods described above. Dimmable LED lamps can only be dimmed with a technique called Pulse Wide Modulation (PWM). With PWM you switch the voltage on and off for a short time at a (relatively) high frequency.
DONOFF therefore uses PWM to dim the (dimmable!) LED lamp, but PWM also works excellently with incandescent lamps and even with halogen lamps!
A schematic for a mains PWM dimmer that you will find all over the internet has been designed by Ton Giesberts Countless improvements have been devised on that design, such as that of diy_block For the design of the DONOFF circuit I have used this design, and the numerous improvements to it, as a basis.

DONOFF uses a MOSFET transistor to switch the voltage on and off. A MOSFET is (simplified) an on/off switch. The switch is closed by applying a positive voltage (Vin > 10 Volt) to the Gate. If you remove the Gate voltage (Vin = 0 Volt), the switch opens. When the switch is open (Vin = 0 Volt) the internal resistance between the Drain and the Source is infinite (simplified). If the switch is closed (Vin > 10 Volt) then the internal resistance between the Drain and the Source is 0 ohm (simplified again!). In both states, the MOSFET will not draw any power and the temperature of the MOSFET will therefore not increase. However, it is important that the transition between open and closed lasts as short as possible, because power is indeed absorbed by the MOSFET during that period.
MOSFET MOSFET "Open"
MOSFET MOSFET "Closed"
Before continuing, please read the warning below!
Warning
Do not copy this design! Chances are the design will kill you and burn your house down while using it. Then the circuit will explode!
I do not make a joke! This project uses lethal voltages and you should only build it if you are a qualified electrical engineer. If you decide to rebuild it anyway, it is your responsibility to take the necessary precautions. I do not take any responsibility for your actions in carrying it out. In fact, I am NOT a qualified electrical engineer, so I make no guarantees as to the design or suitability of this design for your purposes.

The full schedule:

The design generally consists of five subsystems. I will briefly explain each subsystem.

Current Page 3. The Electronics 1. Introduction 2. Project Objectives 3. The Electronics 4. Mains AC to DC 5. MOSFET control circuit 6. optocoupler circuit 7. ESP8266 Microprocessor 8. 3v3 DC power supply 9. The firmware 10. Upload Firmware 11. First time startup 12. telnet server 13. build DONOFF Posted by Website Willem Aandewiel (1955) has a background in electronics and digital techniques. However, most of his working life he has worked in automation where he has worked in just about all disciplines from programmer to project leader and project manager. Willem was one of the first Dutchmen with a micro-computer (KIM-1, 1976) at a time when the PC had yet to be invented. Nowadays he is mainly concerned with the design and production of small electronic circuits with microprocessors. His 'mission in life' is to make people enthusiastic about making their own electronic circuits, microcomputers and programming.

Comments

Webwinkelkeur Kiyoh Trustpilot Opencircuit