Relays are devices which allow low power circuits to switch a relatively high Current/Voltage just like a coupler. A relay circuit is a smaller switch which drives an electric switch that is capable of carrying much larger current amounts.
bulb is controlled by a mobile phone(from remote place) that makes a call to the mobile phone attached to circuitry.A tone corresponding to the button pressed is received and processed by the ATmega32 microcontroller with the help of DTMF decoder. The decoder decodes the DTMF tone into its equivalent binary digit and this binary number is sent to the microcontroller. The microcontroller is pre-programmed to take a decision(on/off bulb) to take a decision '1' for OFF and '2' for ON.
Code
#define F_CPU 1000000UL
#include<avr/io.h>
#include<util/delay.h>
#define relay PC1
int main()
{
DDRC=0xff;
DDRA=0X00;
PORTC=0x00;
while(1)
{
if((PINA&0b00000001)==1)
{
PORTC|=(0<<relay) //bulb off
}
if((PINA&0b00000010)==1)
{
PORTC|=(1<<relay) //bulb on
}
}
}
VIDEO
Category: