I recently embarked on an exciting DIY project to dim traditional incandescent lamps using OpenHAB, and I wanted to share my journey and results with the community. This project was inspired by a query from another member, which reignited my interest in integrating classic lighting with modern smart home tech.The Challenge Dimming incandescent bulbs isn’t as straightforward as with LED or CFL lights. I knew it involved phase-cutting using a TRIAC, but I wanted to understand the theory better before diving in. The key concept is detecting the zero-crossing point in the AC waveform to control the TRIAC’s activation, thus regulating the light intensity.The Solution I decided to build a simple circuit using an optocoupler to isolate the mains voltage from my control circuit. This setup detects the zero-crossing and uses a timer to determine when to trigger the TRIAC. I opted for an Arduino Uno with an Ethernet shield for connectivity, allowing integration with OpenHAB via MQTT.Hardware Setup The circuit was straightforward, comprising a zero-crossing detector and a TRIAC trigger. I sourced ready-made modules to simplify the build, ensuring safety and reliability. The hardware was connected to an Arduino Uno, which communicated with OpenHAB through an MQTT broker.Software Implementation The Arduino code detected zero-crossing signals and used a timer interrupt to control the TRIAC. The dimming level was adjusted by varying the delay before triggering the TRIAC. OpenHAB handled the user interface, with a slider in the sitemap allowing smooth dimming control.Results and Reflections The project exceeded my expectations! The dimming is smooth, and the system integrates seamlessly with my smart home setup. I was particularly impressed by how the TRIAC handled the varying grid conditions without issues. This project not only solved a practical problem but also deepened my understanding of phase-cutting and zero-crossing detection.Safety Note I cannot stress enough the importance of safety when working with mains voltage. If you’re unsure about any part of the project, consider consulting a professional or using pre-made modules designed for safe operation.Final Thoughts This project was a rewarding blend of theory and practice. It’s incredibly satisfying to see a classic lighting solution brought into the 21st century with smart home technology. I encourage anyone with an interest in DIY electronics and smart home integration to give this a try—it’s a fantastic way to learn and innovate!If anyone has questions or suggestions for improvements, feel free to reach out. Happy tinkering! ![]()