Project Home Automation System
Joses Paul2014 Chennai, Tamil Nadu, India

Project Home Automation System
Programming Language : C
IDE: Ardunio 


Abstract:

It is rightly said that “Necessity is the mother of invention”.
The idea sparked from the simple fact that we do sometimes forget to switch of the lights and fans while we leave the room. So the main objective of this project is to automatically switch the supply off.

The idea involves two infrared LEDs on one side of the door frame that shoot two invisible beams of light across the doorway to the other side. On the side opposite of the infrared LEDs there are two infrared receivers that detect when the light is present or not.

The logic for determining when someone crosses a door frame, and what direction they went will be handled by an atmega168 microcontroller. By sensing which of the two beams “breaks” first as someone crosses the door frame, it can detect the direction they travel in. The microcontroller then uses logic to keep track of the number of people in each room based on how many enters the house and from what rooms they travel to from there.

Lights come on in a room immediately upon entering. If you are the last person in the room the lights immediately go off when you leave. The microcontroller knows how many people are in the room, so if two people walk in and one leaves, the lights remain on until the last person leaves. The number of persons in the room can be monitored. Here the microcontroller uses the ARDUNIO platform to communicate to the system.

The greatest problem faced while using IR is the effect of Sunlight but here as the IR transmitters and Receivers are shielded sunlight does not affect them. The system is designed in such a way that handshakes, Object flying across the sensor will not be considered into account. The switching Output from the controller is given to the Relay which thereby switches the AC signal.

Since the counter Output is made available in the computer it possible to develop this project to send data to your mobile using Gsm Modules and Android apps can be developed to monitor the whole system.

ARDUNIO CODING: ( C Language)

Source code:

#include                          //Library include lcd
int c=0;                                                       //Initialize counter
LiquidCrystal lcd(8,9,10,11,12,13);            //Initialize pins for lcd

void setup()

{
pinMode(16,INPUT);                                 //declare pin 16 as input (tsop-A)
pinMode(17,INPUT);                                 //declare pin 17 as input (tsop-B)
pinMode(11,OUTPUT);                             //declare pin 11 as Output(LED RED)
pinMode(12,OUTPUT);                             //declare pin 12 as Output(LED Blue)
pinMode(13,OUTPUT);                             //declare pin 13 as Output(LED WHITE)
pinMode(2,OUTPUT);                               //declare pin 2 as Output (RELAY)

Serial.begin(9600);                                      //serial communication with computer
lcd.begin(16,2);                                           //declare LCD as 16×2 type
lcd.clear();                                                  // clear Garbage values on the screen
lcd.write(“calibrate sensor “);
delay(4000);
lcd.setCursor(0,1);                                       //set lcd cursor to second line
lcd.write(“please wait..”);
delay(5000);                                                //delay in ms
lcd.blink();                                                   //cursor blink
delay(2000);
lcd.clear();
lcd.write(“System Ready…”);
delay(1000);
lcd.blink();
}
void loop()                                                   //program logic starts
{
a:
if(c>0)
{  digitalWrite(2,1);  }
else
{  digitalWrite(2,0);   }

digitalWrite(12,0);

digitalWrite(13,0);
digitalWrite(11,0);
if(pulseIn(16,0)==LOW)
{
digitalWrite(11,1);
if(pulseIn(17,0)==LOW)

{digitalWrite(12,1);

digitalWrite(13,1);

c++;
Serial.print(“Total persons Inside  “);
Serial.println(c);
lcd.print(“Motion detected”);
lcd.clear();
lcd.print(“Total persons:”);
lcd.setCursor(0,1);
lcd.print(c);
}
else
{
digitalWrite(11,0);
digitalWrite(12,0);
digitalWrite(13,0);
goto a;
}
}
else
{
if(pulseIn(17,0)==LOW)
{
digitalWrite(12,1);
if(pulseIn(16,0)==LOW)

{
digitalWrite(11,1);
digitalWrite(13,1);
c–;
Serial.print(“Total persons Inside  “);
Serial.println(c);
lcd.print(“Motion detected”);
lcd.clear();
lcd.print(“Total persons:”);
lcd.setCursor(0,1);
lcd.print(c);
}
else
{
digitalWrite(11,0);
digitalWrite(12,0);
digitalWrite(13,0);
goto a;
}
}
}
delay(10);
}

//End of program

/*
Credits:
Joses Paul P
Akshay Kumar
Kiran Devakumar
*/















Author
About Joses Paul I am a technology enthusiast, I have a great passion for technology and I love learning, designing and developing new technologies. I love speaking about technologies in conferences and summits.I have a great passion for contributing in Technology Outreach programs.
Older Posts Older Posts

Contact Form

Name

Email *

Message *