How to interface a high current TRIAC with AT89C52 microcontroller. Here we will connect a load lick AC motor in series with anode of the Triac and Gate is controlled by MCU simple C program.
Component required:
1. AT89c51.
2. Programmer.
3. Simple C Program
4. Triac BT136.
5. AC Motor.
6. Switch.
7. Keil Software to compile C program
8. 5 V DC power supply.
TRIAC INTERFACE CIRCUIT:
C PROGRAM.
#include
sfr leds=0xA0; // oupt mode
sfr SW=0x90; // input mode
unsigned int x;
int main ()
{
while(1)
{
if(SW==0xFE)
{
leds=0x01;
for( x=0;x<20000;x++);
}
else
leds=0x00;
}
}
VIDEO DEMO.
CONNECTIONS:
1. p1.0 is the input ON/OFF to control Triac.
2. P2.0 is the Output to opto-coupler to separate low voltage ground to high voltage ground.
3. Pin 4 of the optocoupler is connected wot gate
4. When the switch is open the Triac is OFF.
5. The switch is closed the Triac goes to ON.
Triac interfacing with Microcontroller
Show Comments