AVR Controlled Dimmer Switch




How does it work?

The triac TIC206D (BT136-600D) needs only a small current flowing through the gate to start conducting and turn a light on. This is the reason why they can be directly connected to the microprocessor, which can sink at least 10mA. Most digital circuits can sink much more current then they can source, that is why the whole dimmer works with -5 Volts. The resistors R1 to R8, limits the current to -5 mA. That it enough to get the triacs conducting in 3 out of the 4 quadrants. In the 4th quadrant the triacs need 10 mA to start conducting, but that is when the gate current is positive. That is another reason why we are using a negative voltage.

R9 in combination with C1, function as a low pass filter. They remove high frequencies caused by the fase cutting of the triacs. L1 prevents them from going back into the power grid where they spoil your radio reception.

Infrared receiver

The infrared receiver is build around standard highly integrated components. TSOP1736 is a receiver that responds best to signals transmitted on a carrier frequency of 36 kHZ like RC5 etc. Some other remote controls use different carrier frequencies, in that case use the appropiate ir receiver module.

Serial interface

The last part of the dimmer is the circuit around OK1 and OK2. These make sure that the serial interface is galvanically isolated from the power grid so that you can savely hook up your dimmer to your computer as long as it has a serial port. Through the serial port we can send or receive commands to or from the dimmer. Don’t expect speeds to be much higher then 9600 baud, but this is more then sufficient.

Software (firmware)

The software for the dimmer is written in C and partly in assembler because of critical timing. To edit and recompile the firmware download both the integrated development environment (IDE) AVR Studio 4 and the GCC compiler and C-library WinAVR. First install WinAVR and then AVR Studio 4. Double click the Avrdimmer.aps file to open the project in AVR studio 4.

Source: http://domotica.homeip.net

2 Comments

  1. Dagnis Lazdins October 29, 2012 5:12 am 

    IC1 is on the wrong place. 

Leave a Reply