Mohammad Nazmur Rahman Emon
HomeAboutSkillsProjectsExperienceEducationBlogContact
All projects
Power·Jan 1, 2023

AC Dimmer Circuit

A phase-cut AC dimmer that smoothly controls a mains lamp using zero-cross detection and an opto-isolated TRIAC.

AC Dimmer Circuit

Overview

The AC dimmer is one of those circuits where everything looks small on paper but the moment you plug it into the wall it demands a lot of respect. I built mine to actually understand zero-crossing, firing angles and TRIAC drive properly, instead of just memorising them for an exam.

Specifications

RoleCircuit designer and prototype builder
MicrocontrollerArduino-class controller
SensorsZero-cross detector
ModulesTRIACOptotriac driverPotentiometer / control input
ProtocolsGPIOInterrupt timing
Tech tagsAC DimmerTRIACZero CrossOpto-IsolationPower Electronics

Architecture

Zero-cross signal triggers the timing routine. The controller waits a programmed delay and fires the TRIAC to set delivered load power.

Project photos

AC dimmer circuit
AC dimmer prototype
AC dimmer test
Test setup

Videos

Implementation details

Firmware

Firmware detects zero-cross events, calculates firing delay, and triggers the TRIAC gate through an opto-isolated driver.

PCB

Circuit uses isolation between controller and mains trigger path. PCB/layout must maintain safe creepage and clearance for AC use.

Power

Powered from a low-voltage logic supply while switching an isolated mains load through the TRIAC path.

Components / BOM

TRIAC, Optotriac driver, Zero-cross detector, Microcontroller, Lamp/load terminal

Engineering challenges

Doing the timing reliably around the zero-cross point, and keeping the low-voltage controller completely isolated from the mains side.

Solutions

Used an opto-isolated TRIAC driver, handled zero-cross with an interrupt, and made sure the PCB layout respected the creepage/clearance rules for AC.

Results & metrics

Smooth dimming behaviour on a regular AC lamp, no flicker once the timing was tuned.

Future improvements

Enclosure, fuse, EMI filtering, a calibrated knob or small display, and proper closed-loop control of delivered power.

© 2026, Mohammad Nazmur Rahman Emon — built and broken by hand.