AC Light Dimmer Module, 2 Channel, 3.3V_5V logic, AC 50_60hz, 220V_110V - dimaatmelodromru/techdoc GitHub Wiki

A RobotDyn AC Dimmer Module lets you control the amount of electrical power supplied to a 110/220V AC circuit in a very efficient way. Dimmers are used, e.g., to tune the brightness of electric lighting or control speed of an AC electric motor, etc. Whereas in a low-voltage circuit, you could use a potentiometer for a similar purpose, in a high-power circuit, it is ineffective, as potentiometer dissipates the extra electrical power in the form of heat. At the same time, a dimmer takes as much electrical power from a source as needed. This efficiency is achieved by using a powerful logically-controlled semiconductor component, Triac, that opens, i.e., becomes conducive for specific parts of time when the source AC voltage passes certain parts of its periodical change, for example, from 0 to 1/2 of its maximum voltage, and breaks the circuit when the voltage passes its higher-value phase.

Waveform of the output voltage of a thyristor dimmer set for 60 volts RMS output, with 120 V input. The red trace shows the output device switching on about 5.5 ms after the input (blue) voltage crosses zero. Switching the thyristor on earlier in each half cycle gives a higher output voltage and brighter lights.

Lately, dimmers have become a popular component of smart home systems. For example, when you need to change the light brightness smoothly. The lamp is slowly turning ON or OFF, creating a comfortable atmosphere. Dimmer works most effectively with incandescent and dimmable LED lamps. It gets less stable with low brightness dimmable LED lamps, but with moderate and high brightness, it will perform a solid job. Note that luminescent lamps (gas discharge lamps) and any devices powered through impulse AC/DC adaptors and some other types of electrical devices and circuits do not support dimming.

Features

High-voltage part of a RobotDyn AC Dimmer Module is galvanically isolated from the control (logic) part, to exclude any possibility of high voltage propagation to a microcontroller or, even worse, to user controls.

The logical level is tolerant of 5V and 3.3V; therefore, it can be connected to any microcontroller with 5V or 3.3V level logic.

This module has 2 independent dimmers.

Connection

A RobotDyn AC Dimmer Module communicates with a microcontroller via two digital pins for each of its 2 dimmers. First (Zero) informs the microcontroller of AC voltage passing zero 100 (for a 50Hz power source) or 120 (for a 60Hz power source) times every second, generating an interrupt in the microcontroller. Second (DIM/PSM) allows the microcontroller to turn the power supplied to a connected AC circuit ON and OFF.

Note that Zero must be connected to a designated microcontroller pin (which could be different for various microcontrollers like Uno, Nano, Leonardo, Mega, etc.) since it must be a pin that can generate an interrupt in the microcontroller.

Board INPUT Pin
Zero Cross
OUTPUT Pin
Leonardo D7 (NOT CHANGABLE) D0-D6, D8-D13
Mega D2 (NOT CHANGABLE) D0-D1, D3-D70
UNO
NANO
D2 (NOT CHANGABLE) D0-D1, D3-D20
ESP8266
  • D1(IO5)
  • D5(IO14)
  • D7(IO13)
  • D2(IO4)
  • D6(IO12)
  • D8(IO15)
  • D0(IO16)
  • D2(IO4)
  • D6(IO12)
  • D8(IO15)
  • D1(IO5)
  • D5(IO14)
  • D7(IO13)
ESP32
  • 4(GPI36)
  • 5(GPI39)
  • 8(GPO32)
  • 10(GPI025)
  • 12(GPIO27)
  • 14(GPIO12)
  • 21(GPIO7)
  • 24(GPIO2)
  • 26(GPIO4)
  • 28(GPIO17)
  • 30(GPIO18)
  • 33(GPIO21)
  • 36(GPIO22)
  • 6(GPI34)
  • 7(GPI35)
  • 9(GP033)
  • 11(GPIO26)
  • 13(GPIO14)
  • 16(GPIO13)
  • 23(GPIO15)
  • 25(GPIO0)
  • 27(GPIO16)
  • 29(GPIO5)
  • 31(GPIO19)
  • 35(GPIO1)
  • 37(GPIO23)
  • 8(GPO32)
  • 10(GPIO25)
  • 12(GPIO27)
  • 14(GPIO12
  • 23(GPIO15)
  • 25(GPIO0)
  • 27(GPIO16)
  • 29(GPIO5)
  • 31(GPIO19)
  • 34(GPIO3)
  • 36(GPIO22)
  • 9(GP033)
  • 11(GPIO26)
  • 13(GPIO14)
  • 16(GPIO13)
  • 24(GPIO2)
  • 26(GPIO4)
  • 28(GPIO17)
  • 30(GPIO18)
  • 33(GPIO21)
  • 35(GPIO1)
  • 37(GPIO23)
Arduino M0
Arduino Zero
D7 (NOT CHANGABLE) D0-D6, D8-D13
Arduino Due D0-D53 D0-D53
STM32
Black Pill
Blue Pill
Etc...
PA0-PA15, PB0-PB15
PC13-PC15
PA0-PA15, PB0-PB15
PC13-PC15

Software

With Arduino IDE, you can control a RobotDyn AC Dimmer module with our specially developed and maintained RBDdimmer.h library, which uses external interrupts and process time interrupts. It greatly simplifies the development of your code and helps you focus on essentials. Obviously, you can control multiple RobotDyn Dimmer Modules with just one microcontroller.

Download RBDDimmer.h library and a few browse the examples provided in the **Documents** folder from our GitHub repository or clone it. We are constantly updating our library, so we recommend to check or subscribe for the repository updates or subscribe to our newsletter.

More Useful Examples

Web-based light dimmer Remote-Control Light Dimmer

***ATTENTION:***
We do not recommend to use a [RobotDyn AC Dimmer Module](https://robotdyn.com/catalogsearch/result/?q=dimmer) with normal LEDs (Notice: dimmable LED lamps ***can** indeed be used with a [RobotDyn AC Dimmer Module](https://robotdyn.com/catalogsearch/result/?q=dimmer)), luminescent lamps or any other lamps with built-in brightness regulator!
⚠️ **GitHub.com Fallback** ⚠️