We all know what an AC dimmer is; for those who don’t, it’s a kind of a circuit which can control the amount of AC voltage to be given to any device. You can see them in a fan regulator or a light dimmer switch.
But have you ever wondered of applying the same concept of regulators/dimmers using a microcontroller? If you haven’t, don’t worry, this project deals with the same stuff.
FIg. 1: Prototype of AVR ATMega16 based AC Dimmer
First of all we need to understand the importance of a triac in such circuits. A triac is a 3 terminal device which can control the amount of AC current passing through it. This can be achieved by applying variable AC potential at its Gate pin. Here I’m using BT 136 IC and its pin 3 is the gate pin. For further details please refer to its datasheet.
In our normal regulator switches, this task is achieved by using a potentiometer. But when it comes to digitally handling this situation, potentiometer isn’t a good choice.
Here come these opto-couplers and opto-isolators in action. They become a sort of a bridge between AC and Digital portions. One more important term that I should have introduced earlier is Zero Crossing Detection. This is also very important while digitally controlling the dimmer circuit.
A Zero Crossing is shown in the image below:
Fig. 2: Diagram showing zero crossing on typical sine wave AC Waveform
Fig. 3: Diagram showing clipping of AC waveform with respect to zero crossing
Fig. 4: Block Diagram of AVR ATMega16 based AC Dimmer
REQUIREMENTS:
CIRCUIT DIAGRAM:
Check the Circuit Diagram Tab for complete AC Dimmer Circuit
Project Source Code
###
#include<avr/io.h>#include<util/delay.h>#include<adc_lib.h> //for ADC purposevoid main(){ADCinit(); //initializing ADCint j=0,i=0;DDRC=1;PORTC=0;while(1){if(!(PINC&(1<<7)) && j==0) //if upper half of the sine wave detected{PORTC&=~(1<<0);_delay_ms(i);PORTC|=(1<<0);j=1;}if((PINC&(1<<7)) && j==1) //if lower half of the sine wave detected{PORTC&=~(1<<0);_delay_ms(i);PORTC|=(1<<0);j=0;}i=(read_adc(0)/105); //i=[0 to 9]}}###
Circuit Diagrams
Project Datasheet
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.