AC Light Dimmer || DIY or Buy || Phase Angle Control Tutorial

The goal of the project was to create a digital microcontroller dimmer that can power LEDs without any external power source. The approach used a transistor with a pull-up resistor connected to the microcontroller's input, which would turn off when it reaches zero crossing point. This allowed the creation of a zero-crossing indicator from whose occurrence could be used as a timing signal. The timing signal was then used to delay the ignition of the track according to the set potentiometer value and get the desired phase angle.

The next step involved using an output of the microcontroller hooked up to an optocoupler track driver, which activated the first TRIAC and also the second TRIAC. As soon as the ignition point was reached, the microcontroller lit up the LED for small time inputs, activating the first TRIAC and thus also the second TRIAC.

However, there was a need to supply five volts power for the circuits. Initially, it was thought of using a capacitive dropper circuit, but then realized that there's a risk of having a voltage potential of 230 volts across the potentiometer to earth. Instead, a small Hi-Link five volts mains power supply was used, which could deliver more than enough current for the circuits.

The suitable SMD components were searched for and calculated according to their datasheet specifications. This resulted in a confusing hand-drawn schematic that was later edited into a more pleasant one using easy EDA software. The PCB was then designed using an EDA tool and ordered from JLCPCB, which arrived within less than a week.

The components were then added to the PCB in less than an hour, with only one minor package size problem encountered during soldering. The microcontroller was programmed using an ISP-header connected to an Arduino Uno, following a tutorial on programming the ATtiny microcontroller. The code for the project was written and uploaded to the microcontroller.

After powering the circuits, no explosions occurred, indicating that safety measures had been taken. An E27 socket with a halogen light bulb was added for testing, and it successfully dimmed its brightness. However, some other LED light bulbs did not work at all due to complex reasons.