Tuesday 14 July 2015

DTMF based home automation system

Source Code:

#include<avr/io.h>
#include<util/delay.h>

void main()
    {
    unsigned char val=0;
    DDRB=0x00;     // configure PORTB as input (DTMF outputs are connected to lower nibble)
    PORTB=0xff;    // enable pull-up resistor of PORTB
    DDRD=0xff;     // configure PORTD as output
    PORTD=0x00;    // PORTD low
    while(1)
        {
        val=PINB;

        switch(val)
            {
            case 0xf1:
                PORTD=0x01;    // relay 1 ON
                break;
              
            case 0xf2:
                PORTD=0x00;    // relay 1 OFF
                break;

            case 0xf3:
                PORTD=0x02;    // relay 2 ON
                break;
              
            case 0xf4:
                PORTD=0x00;    // relay 2 OFF
                break;

            case 0xf5:
                PORTD=0x04;    // relay 2 ON
                break;
              
            case 0xf6:
                PORTD=0x00;    // relay 2 OFF
                break;

            case 0xf7:
                PORTD=0x08;    // relay 2 ON
                break;
              
            case 0xf8:
                PORTD=0x00;    // relay 2 OFF
                break;

            default:
                PORTD=0x00;    // all realy OFF
                break;
            }

            }
    }

Microcontroller Used : Atmega16
IDE: AVStudio 4
Compiler: AVR GCC.

Schematics:





Bill of materials:

9 Volt battery (Hiwatt) with snips
7805 voltage regulator
AT89S52 with ic base
11.0592 MHz Xtal22pf cap - 2
DTMF MODULE with 3.5 mm audio jack (male)
Uln 2003 with Ic base
6Volt relay - 4
5 Led
Perfboard/Zero PCB  (Silver coated big size)
Jumper wire for soldering
Solder Wire
Soldering Iron
Soldering iron stand



4 comments:

  1. sir please sent source code or hnts n yes if u dont mindf circuit diagram

    ReplyDelete
  2. I will post it within an hour. Sorry was little bit busy for last two days.

    ReplyDelete
  3. Just updated it.... Check it out.

    ReplyDelete
  4. Thank you so much for your wonderful blog. Keep updating | Home Automation in Bangalore

    ReplyDelete