Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

DTMF Controlled Home Automation System Using 8951

By Salman Khan

This project based on DTMF (Dual Tone multi frequency) which is generated in cellular phones. Here, by using a cell phone we controls the home appliances from anywhere in the world (In Network Area). Below you can see the diagram of DTMF keypad. When we press any key then it generates a frequency after mixing two frequencies. And then send it to the receiver end over communication channel.

Image of DTMF Keypad with alloted frequencies
             Fig.1: Image of DTMF Keypad with alloted frequencies
 
User can activate their devices using this DTMF keypad as he/she want to activate. The encoder encodes the user input and sends via a communication channel. The receiver receives the modulated signal and demodulates it and the user input. In this system, we are going to make a DTMF based home/office appliance. Block diagram of this system given below-
                                   Block Diagram of 8051 Microcontroller based Home Automation System
  Fig. 2: Block Diagram of 8051 Microcontroller based Home Automation System
 
Block Diagram of DTMF based Home Automation System
              Fig. 3: Block Diagram of DTMF based Home Automation System
This system is designed for controlling the devices, it includes a cell phone which is connect to the system via head set. To active the cellular phone part of the system a call is to be made and as the call is answered, in response the user would enter a three/four(as he/she want) digit password to access the system to control devices. As the caller press the specific password, it results in turning ON or OFF specific device. The device switching is achieved by Relays.

Image Showing Appliances Controlled by a Mobile Phone on DTMF based Home Automation System
Fig. 4: Image of DTMF and 8051 Microcontroller based Home Automation System

 

Circuit Designing

Circuit:

In this system we made circuit in three main parts one is DTMF decoder  secondly transmitter which accepts the output of decoder and third one is receiver which accepts the input of transmitter and the we connects our controlling devices like TV, Fan, AC, Mixer, Bulb etc as we want to controls. In this circuit we used serial communication between 8951 microcontrollers for transferring the encoded from transmitter to receiver. This means in circuit one second part of circuit made serial transmitter which send encoded data serially and the third part of circuit made serial receive  which receives the serially transmitted data serially. Some password already defined in the third part of circuit. When receiver receives any input from transmitter then it compares the input data with stored or defined data. If any match found then it activates related or particular device we can see the particular operation In the 16×2 LCD. In this circuit I used led’s in place of home appliance. In the code we stored data of length 4.
 Eg.
       ·         4201 for on first relay or device.
       ·         4202 for on second relay or device.
       ·         4211 for off first relay or device.
       ·         4212 for off second device.
       ·         4205 for on all devices.
       ·         4215 for off all devices
 
       Cirucit Images
Image Showing Appliances Controlled by a Mobile Phone on DTMF based Home Automation System
                   Fig. 5: Image showing appliances controlled by a mobile phone on DTMF based Home Automation System
 
Prototype of 8051 Microcontroller based device for Smart Home
         Fig. 6: Prototype of 8051 Microcontroller based device for Smart Home
F
Prototype of 8051 Microcontroller and DTMF based Home Automation System
                               Fig. 7: Prototype of 8051 Microcontroller and DTMF based Home Automation System
 
Image showing Home Automation Board integrated with house appliances
                    Fig. 8: Image showing Home Automation Board integrated with house appliances

 PCB Images

       PCB Images
Image of PCB used in DTMF based Home Automation System
             Fig. 9: Image of PCB used in DTMF based Home Automation System
 
Image of PCBs used in DTMF based Home Automation System
               Fig. 9: Image of PCBs used in DTMF based Home Automation System
 
Image of PCB used in DTMF based Home Automation System
        Fig. 10: Image of PCB used in DTMF based Home Automation System
 
Image of PCB used in DTMF based Home Automation System with holes drilled for components
       Fig. 11: Image of PCB used in DTMF based Home Automation System with holes drilled for components

 

Project Source Code

###

****************************DTMF RECEIVER************************* #include<reg51.h>
#include<string.h>
#define all_on P2=0xf0			  
#define all_off P2=0x00
#define dataport P0
#define cmdport P1
#define output P2

char y;int k;
sbit rs=cmdport^0;
sbit rw=cmdport^1;
sbit en=cmdport^2;
sbit tv=output^0;
sbit fan=output^1;
sbit light=output^2;
sbit ac=output^3;

char compare1[4]="4211"; // TV ON
char compare2[4]="4212"; // FAN ON
char compare3[4]="4214"; // LIGHT ON
char compare4[4]="4204"; // AC ON
char compare5[4]="4210"; // TV OFF
char compare6[4]="4212"; // FAN OFF
char compare7[4]="4213"; // LIGHT OFF
char compare8[4]="4214"; // AC OFF
char compare9[4]="4205"; // ALL ON
char compare0[4]="4215"; // ALL OFF
char input[4]; //input string

void delay(int time)
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
} // delay funtion

void lcddata(char item)
{
dataport=item;
rs=1,rw=0,en=1;
delay(5),en=0;
} // funtion to send data to lcd

void print(char cmd, char *str)
{
dataport=cmd;
rs=0,rw=0,en=1;
delay(5),en=0; // funtion to send cmd and print data to lcd
while(*str!='')
{
lcddata(*str);
str++;
}
}

void LCD_clear()
{
delay(50);
print(0x01,0);
}
// funtion to clear lcd
void LCD_Init() // funtion to LCD initialize
{
print(0x38,0);
print(0x06,0);
print(0x0e,0); // print introduction on lcd
print(0x80," A PROJECT BY ");
print(0xc0," SADDAM KHAN ");
LCD_clear();
print(0x80,"DTMF CONTROLLED ");
print(0xc0,"HOME AUTOMATION ");
LCD_clear();
print(0x80," SYSTEM READY ");
}

void serial_init()
{
TMOD=0X20;
SCON=0X50;
TH1=0XFD;
TR1=1;
} // funtion to initialize serial communication

void main() // main program
{
all_off;
serial_init();
LCD_Init(); // initiaze lcd and serial communication
while(1)
{
print(0xC0,"ENTER CODE "); // enter a string of length 4 by using for loop
for(k=0;k<4;k++)
{
while(RI==0);
y=SBUF;
input[k]=y;
lcddata(input[k]);
RI=0;
delay(40);
}


if(strcmp(compare1, input)==0) // compare input strings with stored strings
{LCD_clear();print(0x80," TV ON ");tv=1;}
if(strcmp(compare2, input)==0)
{LCD_clear();print(0x80," FAN ON ");fan=1;}
if(strcmp(compare3, input)==0)
{LCD_clear();print(0x80," LIGHT ON ");light=1;}
if(strcmp(compare4, input)==0)
{LCD_clear();print(0x80," AC ON ");ac=1;}
if(strcmp(compare5, input)==0)
{LCD_clear();print(0x80," TV OFF ");tv=0;}
if(strcmp(compare6, input)==0)
{LCD_clear();print(0x80," FAN OFF ");fan=0;}
if(strcmp(compare7, input)==0)
{LCD_clear();print(0x80," LIGHT OFF ");light=0;}
if(strcmp(compare8, input)==0)
{LCD_clear();print(0x80," AC OFF ");ac=0;}
if(strcmp(compare9, input)==0)
{LCD_clear();print(0x80," ALL ON ");all_on;}
if(strcmp(compare0, input)==0)
{LCD_clear();print(0x80," ALL OFF ");all_off;}}
}
******************DTMF TRANSMITTER******************

#include<reg51.h>
sbit led=P2^0;char k;

void delay(int time)
{unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<1000;j++);}

void serial_init()
{TMOD=0X20;
SCON=0X50;
TH1=0XFD;
TR1=1;}

void transmit(char k)
{SBUF=k;
while(TI==0);
TI=0;}

void main()
{
P1=0xff;
serial_init();
delay(500);
while(1)
{P1=0xff;
if(P1==0xf1){transmit('1');while(P1==0xf1);delay(20);}
if(P1==0xf2){transmit('2');while(P1==0xf2);delay(20);}
if(P1==0xf3){transmit('3');while(P1==0xf3);delay(20);}
if(P1==0xf4){transmit('4');while(P1==0xf4);delay(20);}
if(P1==0xf5){transmit('5');while(P1==0xf5);delay(20);}
if(P1==0xfa){transmit('0');while(P1==0xfa);delay(20);}
}
}

###

 


Circuit Diagrams

Circuit-Diagram-8051-Microcontroller-DTMF-Based-Home-Automation-System

Project Datasheet

https://www.engineersgarage.com/wp-content/uploads/2019/10/HEX-files-and-PCB-layout.zip


Project Video


Filed Under: Electronic Projects
Tagged With: 8051 microcontroller, dtmf, home automation
 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)
  • An Embedded Developer’s Perspective on IOT (Internet of Things)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Need help to choose accelerometer
  • Pic 16f877A Hex file
  • 7 segment display connections
  • finding attenuation coefficient in CST
  • Effect of variable gain amplifier and LNA on the input RF signal's phase

RSS Electro-Tech-Online.com Discussions

  • How to designing a battery charging indicator circuit for 18650 battery pack
  • NOR gate oscillator in LTspice not working
  • ICM7555 IC duty cycle limit at high frequency?
  • I've DESTROYED 3 piezo buttons :((((
  • led doorbell switch
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering