Electronic – Arduino To Control Light Intensity

arduinocircuit-designdimmingtriac

So I want to build a circuit that can control the intensity of a light bulb (powered by 220V AC, 60 Hz) through the output voltage of Arduino.

I know I must use Triac but the question is, is the output voltage/current of Arduino good enough to control the Triac current such that I can get different levels of light intensity?

The block diagram of the whole system is given below, the whole purpose is to control the intensity of light through the output voltage of Arduino only, I don't need any kind of light sensor or anything else…

[Arduino] –> [Light dimmer circuit] –> [light bulb]

I'm honestly new to this Triac thing and don't want to blow up things, so I need some guidance from experts like you 🙂

Best Answer

Capability wise, yes arduino running at 16 MHz is more than capable of dimming your incandescent bulbs by phase control method.

The logic goes like this: You sense the exact time when sine wave crosses zero. You wait for some time (0-10 milliseconds depending upon the brightness you want), turn the triac ON for like 100 uS and then turn it OFF.

Now 0-10 ms should depend a bit on exact components chosen and you might want to make this range 1-8 ms or so. Having some buffer saves you from running into edge cases which will cause flicker in the bulb.

100 uS is a good number but you can reduce it as well. Check it before you mark it ready for production.

To keep things safe, I (and everybody else) recommend using an optocoupler for zero cross sensing as well as triac driving.

Use this circuit to sense the zero cross: (3.3V will be 5V for you if you are using arduino UNO. No need to change anything due to that.)

zcd

And you can drive the triac using this circuit:

triac

From my experience, I recall that arduino running on 8MHz at 3.3V wasn't that good. I saw very slight flicker when focusing too hard but again it could be due to code. It was using less efficient functions like delay and delayMicroseconds. Use interrupts for better performance.