You have no items in your shopping cart.

Subtotal: 0.00

Abstract

Smart Home is a house that uses information technology to monitor the environment, control the electric appliance and communicates with the outer world. Smart Home is a complex technology, at the same time it is developing. A sample house environment monitors and control system that is one branch of the Smart Home is addressed in this paper. The system is based on the embedded system and can act as a security guard of the home. The system can monitor the temperature, humidity, gas density, water immersion of the house.

The whole system is a cheaper one, but it provides the full-scale home device monitor and control function. By using the embedded system technique, it is convenient to use and allows simple installation in existing homes, it provide a safe, convenient home to us. The shortage of the system is only can turn on/off the electric appliances and the lack of the wireless function. With the Development of the smart electric appliances, the system must make much progress.

This Project is used to control the AC Machine controlled according to the temperature and it also indicates the temperature. The system will get the temperature from the Temperature sensor and fed it to microcontroller. When temperature exceeds normal level then it automatically enables/Turn’s on AC Machine.

Block Diagram


Block Diagram
Description

Every Home Automation box is a stand-alone device. It is connected to the mains and controls the power outlet of the electrical device that is plugged into it. There will be a receiver and transmitter in each of the box, so they can exchange information with the master (a computer). People can control power supply of electrical devices in order to create an interactive home environment to facilitate the control without changing any home appliance. People can enjoy the high technology and simplicity modern life style.

Each device will be with standard setup and while adding it into network, it can be given an address and tasks to do. All the setting will be easily resettable to default value, so people can move the devices between different electrical devices and networks. Home Automation boxes will be put into different rooms at home, depending on the needed functionality. Various different sensors could be attached to the boxes. The sensors are used as triggers for actions, that user can set up in the computer program.

Hardware requirements

  • ARM 7 (LPC 2148) Microcontroller (ARM7 Evaluation Board)
  • Power Supply (9V Adaptor, 5V Adaptor)
  • Bluetooth Modules
  • Relay interface (user can interface any devices according to their needs / Application)

Software requirements

  • Programming Language: Embedded C
  • KEIL U Vision IDE
  • Flash magic
  • Orcad 16.3

Source Code

#define CR 0x0D
#include 
#define BUZZ 7
#define LED 1
void init_serial (void);
int putchar (int ch);
int getchar (void);
void lcd_initialize (void);
void delay (unsigned int);
void lcd_cmd (unsigned char);
void lcd_data (unsigned char);
unsigned char test;
const unsigned char msg[] = ("PS-ARM EVB KIT "); //msg
const unsigned char msg1[]= (" ::LCD DEMO:: "); //msg1
const unsigned char cmd[4] = {0x38,0x0c,0x06,0x01}; //lcd commands
unsigned char ch, I = 0;
//----------------------------------
// LCD Initialize
//----------------------------------
void lcd_initialize (void)
{
 int i;
 for(i=0;i<4;i++)
 {
 IOCLR0 = 0x00FF0000;
 lcd_cmd (cmd[ I ]);
 delay(15);
 }
}
//----------------------------------
// LCD Command Send
//----------------------------------
void lcd_cmd(unsigned char data)
{
 IOPIN0 = data << 16;
 IOCLR1 |= 0x100000; //RS
 IOCLR1 |= 0x200000; //RW
 IOSET1 |= 0x400000; //EN
 delay(15);
 IOCLR1 |= 0x400000; //EN
}
//----------------------------------
// LCD Data Send
//----------------------------------
void lcd_data(unsigned char data)
{
 IOPIN0 = data << 16;
 IOSET1 |= 0x100000; //RS
 IOCLR1 |= 0x200000; //RW
 IOSET1 |= 0x400000; //EN
 delay(15);
 IOCLR1 |= 0x400000; //EN
}
//----------------------------------
// LCD Display Msg
//----------------------------------
void lcd_display(void)
{
 char i;
 /* First line message */
 IOCLR0 = 0x00FF0000;
 lcd_cmd(0x80);
 delay(15);
 i=0;
 while(msg[i]!='\0')
 {
 IOCLR0 = 0x00FF0000;
 lcd_data(msg[i]);
 i++;
 delay(15);
 }
 delay(15);
 }
//----------------------------------
// Delay Routine
//----------------------------------
void delay(unsigned int n)
{
 int i,j;
 for(i=0;i<n;i++)
 {
 for(j=0;j<0x2700;j++)
 {;}
 }
}
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Code Begins Here >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
int main(void)
{
 char *Ptr = "*** UART0 Demo ***\n\n\rType Characters to be echoed!!\n\n\r";
 PINSEL0 = 0;
 PINSEL1 = 0;
 IODIR0 = 0XFFFFFFFF; //PORT [P0.16--P0.31] output
 IODIR1 = 0X00Ff0000; //PORT [P1.20--P1.23] output
 IODIR0 |= 0xFF << LED; //Configure P1.24 - P1.31 as Output
 delay(10);
 lcd_initialize(); //Initialize LCD
 delay(10);
 VPBDIV = 0x02; //Divide Pclk by two
 init_serial();
 delay(15); 
 lcd_display();
 delay(15);
 while(1)
 {
 while (*Ptr)
 {
 putchar(*Ptr++);
 }

 ch=getchar();
 switch(ch)
 {
 case 0x33:  IOSET1 |= 0x30080; break;
 case 0x34:  IOCLR1 |= 0x30080; break;
 }
 lcd_cmd(0xC0 + i++);
 if(i==16) i=0;
lcd_data(ch);
 }
}
//<<<<<<<<<<<<<<<<<<<<<<<<< Serial Initialization >>>>>>>>>>>>>>>>>>>>>>>>>>>>
void init_serial (void)  /* Initialize Serial Interface */
{  
 PINSEL0  = 0x00000005; /* Enable RxD0 and TxD0 */
 U0LCR  = 0x00000083; /* 8 bits, no Parity, 1 Stop bit */
 U0DLL  = 0x000000C3; /* 9600 Baud Rate @ 30MHz VPB Clock */
 U0LCR  = 0x00000003; /* DLAB = 0 */
}

//<<<<<<<<<<<<<<<<<<<<<<<<<<< Putchar Function >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
int putchar (int ch)  /* Write character to Serial Port */
{ 

 if (ch == '\n') {
 while (!(U0LSR & 0x20));
 U0THR = CR;  /* output CR */
 }
 while (!(U0LSR & 0x20));
 return (U0THR = ch);
}
//<<<<<<<<<<<<<<<<<<<<<<<<<<<< Getchar Function >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

int getchar (void)  /* Read character from Serial Port */
{
 while (!(U0LSR & 0x01));
 return (U0RBR);
}

Conclusion

Home Automation is undeniably a resource which can make a home environment automated. People can control their electrical devices via these Home Automation devices and set up the controlling actions in the computer.