DimSwitch icon indicating copy to clipboard operation
DimSwitch copied to clipboard

Arduino library to control dimmable ballasts for fluorescent light tubes

DimSwitch

This is an Arduino library to control electronic dimmable ballasts for fluorescent light tubes.

It works with ESP8266, Arduino UNO, Micro, MEGA, DUE and other compatible Arduino boards.

For description of API and application examples, please refer to documentation section. You will find there also description and graphs of state machine sequence, wave-forms of control signals as well as sample user interface in openHAB.

This library is a spin-off of project esp-lamp-in-sw written in C language. Check it out if you are not convinced with using C++ for embedded systems.

Warning: Hazardous Voltage!
Hazardous Voltage Warning Building and testing hardware for this project involves working with mains power that is dangerous to your life. Do not connect this project to the mains power without proper training and certification! Please read Safety Guidelines for High Voltage and/or Line Powered Equipment

Tested with

  • Philips HF-REGULATOR Touch and Dim HF-R T 236 220-240
  • OSRAM QUICKTRONIC - INTELLIGENT QTi DALI 2x28/54 DIM

Functions

  • Switch the lamp on / off
  • Dim to specific light intensity
  • Read back on/off status and intensity
  • Calibrate

Required

  • ESP8266 or other Arduino compatible board
  • Relay connected to one of outputs
  • Light sensor connected to one of analog inputs
  • Touch and dim lamp connected to the relay

Application Example

DimSwitch Application Example

Sample Control Screens

This library features example sketches and openHAB code to show options to control the lamp using:

  1. Arduino IDE Serial Monitor
  2. Web browser with simple HTML code
  3. OpenHAB with MQTT binding
  4. OpenHAB with HTTP binding

The last three option are presented on screen shoots below.

Web browser with simple HTML code openHAB with MQTT binding openHAB with HTTP binding
Web browser with simple HTML code openHAB with MQTT binding openHAB with HTTP binding

Contribute

Feel free to contribute to the project in any way you like!

If you find any issues with code or descriptions please report them using Issues tab above.

Author

krzychb

Donations

Invite me to freshly squeezed orange juice.

Credits

Software for this project has been prepared thanks to great work of the following teams and individuals:

License

GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999