loading
Smart Home Automation let the user to control the home from his or her phone and assign actions that should happen depending on time or other sensor readings such as light, temperature or sound from any device in the Home Automation network.

WHAT CAN HOME AUTOMATION DO?
  1. Increase your independence and give you greater control of your home environment.
  2. Make it easier to communicate with your family.
  3. Save you time and effort.
  4. Improve your personal safety.
  5. Reduce your heating and cooling costs.
  6. Increase your home’s energy efficiency.
  7. Alert you audibly and visually to emergency situations.
  8. Allow you to monitor your home while you are away.

Features of our project:
  1. Control upto four home appliances wirelessly (expandable based on free IO pins).
  2. Monitor status of your home like temperature inside and outside of your home,light intensity inside and outside of your home, motion (presence) on the main entrance,LPG leak in the home and status of you main door.
  3. Open/close your main door electrically and wirelessly.
  4. As the android application is password protected ,it automatically adds security to your home as it can be controlled by the user only.
  5. Automate your indoor lightening, outdoor lightening and fan/AC to switch ON/OFF automatically when the light intensity and temperature conditions exceed the programmed threshold values.(This feature, we named it “SENSOMATE”).
  6. It automatically monitor your home against LPG leaks and cases of fire.If it detects something wrong, it automatically switches off all home appliances instantly and immediately opens the door to let the LPG/fire exhaust off your home.
  7. Has a “SLEEP MODE” , once activated will switch your light off and program the motion sensor and door sensor to raise alarm if anything goes wrong.
  8. At last, as it uses Bluetooth the user can use the android phone within a range from 10-100m .
Also, there are many disabled and aged people who always depends on others for their basic necessities. This application gives them a helping hand. With this application, user can use the electrical appliances in his room without moving anywhere or without seeking anyone's help, the user himself feels a little independent.With this application the user can monitor and operate home appliances, make themselves feel secure with the help of motion sensor, give alarm to the guardian at times of emergency, check indoor and outdoor temperatures - or use this option as a digital thermometer, Enable/Disable Automatic AC control, Enable/Disable Automatic Room light control and monitor windows/doors.

[The project shown here is more a prototype,but it is fully tested and working and ready to be implemented in realtime]
[Please vote for me,if you like my work.]

Step 1: What We Proposed : the Solution

Home automation can allow you to make the things that you need and do in your home easier to accomplish. Perhaps you want to control your security system? Or, perhaps you want to voice automate the lights in your home so that you can get into bed and then turn the lights out. Or, perhaps you want to be able to control your sound system from any place in your home. No matter what it is you are looking to accomplish, home automation products are probably available to help you to make it happen. A typical home automation system allows one to control house hold appliances from a centralized control unit. These appliances include lights, fans, air conditioners, television sets, security cameras, electronic doors, computer systems, audio/visual equipment, etc. These appliances usually have to be specially designed to be compatible with each other and with the control unit for most commercially available home automation systems.

The project Smart Home Automation, demonstrates a system that can be integrated into a home/building’s electrical system and allows one to wirelessly control lights, fans, and turn on or off any appliance that is plugged into a wall outlet. The system can be controlled from a Bluetooth or Wi-Fi enabled device such as a mobile phone or laptop, while a microcontroller powered box act as the server. Thus the installation cost and hardware cost is kept to a minimum as most users already own the requisite hardware such as a mobile phone and desktop PC.

A Bluetooth dongle or a standard Wireless Access Point is used to provide connectivity between the server and the mobile device. The system is capable of detecting when the user enters or leaves the room by measuring the change in environmental thermal equilibrium, and can accordingly turn on or off appliances such as lights and fans. The power supply for each appliance is wired through an electromechanical relay. A number of relays are used depending on the number of appliances to be controlled. All the relays are controlled by a microcontroller. The microcontroller based host acts as the mmain server.. The server can also receive connections over the internet and can be controlled from a remote location. This opens up many possibilities. For example, one could remotely turn on the air conditioner from the office before leaving so that the room is cool before reaching home. Home automation can range in complexity from the simple gadgets and gizmos that provide control over individual components to individual home sub-systems and integrated whole house systems.

The project:
  1. Use five sensors to monitor the state of home namely temperature, light intensity,motion, LPG leak and door/window status.
  2. Use a host device that will be mounted on wall and will have connection to all your home appliances like lights, fans, etc and to all the sensors.
  3. Use “ANDROID” based smartphone, tablets as the user interface and control panel.
  4. The ANDROID client will use bluetooth to wirelessly connect to the host device.
  5. Simply logging in the android application will grant access to the user to control and automate his home wirelessly.

Step 2: BLOCK DIAGRAM

The block diagram of the project is shown if figure above. The main heart of the project that do all data processing and decision making is the microcontroller. Here it serves the purpose of data acquisition from the sensors and comparing then with the programmed values stored in the microcontroller’s EEPROM and then actuating the devices accordingly. A 16x2 character LCD is used for displaying the messages,  appliance state and sensor readings. It is directly connected to the microcontroller in 4-bit addressable mode. Whenever a new action or event is raised like fire alarm, LPG leak, etc it is displayed on the LCD too. Next we have the Bluetooth UART module connected to the serial port of the microcontroller. It act as an access point for the android client on the another side and logically it act as complete serial cable replacement for the serial port. The data is exchanged serially between the two devices. A LINK status pin to the microcontroller from the Bluetooth UART tells it that the android client is successfully connected to the host. Next, to control two light one inside and other outside the home , a fan/AC and a television we have four relays connected to the microcontroller via the NPN transistor based buffer circuit. The relays consume a lot current while being activated and the microcontroller on any pin can source only 20mA of current so a buffer circuit is utmost indispensable between the relay and the controller.

There are five types of sensors used in the project those are being directly interfaced to the microcontroller. To sense the light intensity we use two LDR sensors that is light dependent resistors interfaced to the ADC input of the microcontroller. To sense the temperature we used two solid state semiconductor temperature sensors from analog devices also interfaced to the ADC input of the microcontroller. To sense the LPG leak in the home we used the MQ-5 LPG sensor and it is interface to the ADC input of the microcontroller. After them, we used a hook switch to sense the door whether it is opened or closed. This sensor is connected to the digital input of the microcontroller pulled up externally. To sense the presence and motion we used the PIR (Pyroelectric InfraRed) sensor that has a digital output and it is also connected to the digital input of the microcontroller pulled up externally. The main door is driven by the geared DC motor and as it has to close and open the door, it has to be moved bi-direcionally. To do so, we used the NPN transistor based H-bridge bidirectional motor driver circuit interfaced to the digital output of the microcontroller. The microcontroller can digitally control the motion and direction of the motor to open and close the door. A software feedback is implemented between the motor and the door hook sensor output so that when the door reaches its max position and is being shut the motor stops driving the motor to prevent any damage.

Step 3: The Circuit Diagram

The circuit diagram of the project is shown above in figure above. The starting from the power supply section, we have the 9V AC input from the secondary output of the transformer. This is the fed to the bridge rectification section that converts AC supply into DC supply. This is done by four 1N4007, 1 A diodes in bridge configuration. Then on the DC output of this section a large capacitor (1000uF, 16V)  and another small 100nF capacitor is there to filter the DC supply and remove off all AC components from it. This is because here we are operating pre digital circuitry that fails to operate on unregulated and unfiltered supply. After the DC supply is being filtered as it is unregulated is turned into a regulated 5V DC supply using LM7805 regulator. Again after that a small 100nF capacitor is there to filter the regulated DC supply. A regulated 3.3 volt supply is also derived from another regulator that is the UA78M33 whose input is fed from the regulated 5V output of the LM7805 voltage regulator. Regulated 5 volt supply is needed to drive the microcontroller, relays and all the sensors, while a regulated 3.3 volt is required by the Bluetooth UART module to operate. After that the regulated supply is fed to all the sensors ,relays and the microcontroller.

There are five types of sensors used in the project those are being directly interfaced to the microcontroller. To sense the light intensity we use two LDR sensors that is light dependent resistors interfaced to the ADC input of the microcontroller. One pin of the LDR is connected to Vcc via a 330K resistor and other tied to ground. This creates a potential difference in between of the circuit and is fed to pin A.3 and A.2 of the microcontroller respectively. To sense the temperature we used two solid state semiconductor temperature sensors from analog devices also interfaced to the ADC input of the microcontroller. The two pins are connected to the power supply to power the sensors and the third pin is the output pin is connected to the ADC7 and ADC6 channel of the microcontroller. To sense the LPG leak in the home we used the MQ-5 LPG sensor and it is interface to the ADC5 channel input of the microcontroller. When an LPG leak is detected the output of the LPG sensor decrease gradually and that is being sensed by the ADC of the microcontroller. After them, we used a hook switch to sense the door whether it is opened or closed. This sensor is connected to the digital input pin D.7 of the microcontroller pulled up externally.Whe the door is closed, the hook switch is closed and the output is logic low as it bypasses the ground. When the door is open, the hool switch is also open and it bypasses logic1 throught 10k resistor to the output. To sense the presence and motion we used the PIR (Pyroelectric InfraRed) sensor that has a digital output and it is also connected to the digital input (pinA.4) of the microcontroller pulled up externally. When a motion is detected ,the output goes high for a few seconds and comes back to low in case of absence of motion. The main door is driven by the geared DC motor and as it has to close and open the door, it has to be moved bi-direcionally. To do so, we used the four BC107 NPN transistor based H-bridge bidirectional motor driver circuit interfaced to the digital output of the microcontroller. The microcontroller can digitally control the motion and direction of the motor to open and close the door. To display messages and sensor values a 16x2 character LCD is used in 4 bit mode to portB of the microcontroller.

The H-bridge circuit is used to drive a DC motor in both the directions. It can also use relays to function but here we used the BJT based one. It comprises of four BC107 NPN transistors as shown in figure 2. The two transistor T1 and T2 are in series and those T3 and T4 are also in series. The base of all four transistors are protected y current limiting resistors R1-R4. The prevent damaging the transistors. The base signals of T1 and T4 are the same and that of T3 and T2 are also the same. The operation is simple that when Sig1 is logic 1 and Sig 2 is logic 0, it will turn ON T1 and T4 and will turn the motor in one direction same if we reverse the input logics, the motor will go in reverse direction. All four transistors are used as simple switches here.

Step 4: 5 PCB FOR THE PROJECT

The PCB for the project is designed in EAGLE layout designer. The schematic is designed in the schematic editor and the board is designed in the board editor. The simple TONER TRANSFER METHOD is used here to develop PCB at home.

Step 5: Microcontroller Code and Algorithm Used !!

The algorithm that is driving the code on the microcontroller is a multi-tasking algorithm. It has three basic functions, first is the main function to read all sensors and  actuate the actuators according to the programmed threshold values. Next is the timely updating of the LCD display and the transmission of encoded string serially to the android client if the android client is present. The last task is to check the input serial buffer for commands from the android client and process them accordingly.
When the microcontroller is powered up it reads the eeprom for recovery of all programmed sensomate values and device states that whether which device was ON/OFF the last time the power failed. Then after recovery, it read all the sensor readings and process them accordingly in meaningfull values.  After that the microcontroller checks the sensor readings against the programmed sensomate values and turns ON/OFF the appliances accordingly. The checking of fire occurance and LPG leak is done here in this main loop only. If there is a sign of fire or LPG leak, the microcontroller automatically switches off all the appliances and open the door to exhaust the gases and reduce emergency cricality. The sleep mode is also processed here in this loop. If the sleep mode is activated and motion is detected or someone open the door, the alarm fires and alert the user.
In the second loop, the microcontroller runs timer0 in interrupt mode and approx every 1.5 seconds it updates the LCD for sensor values and device states. The presence of the Bluetooth link is also displayed here. Also the microcontroller sends the encoded system status in a string serially to the bluetooth UART if the link is present. It is done every 0.8 second approximately. This loop is repeated infinitely as that of the main loop.

The third section programs the serial receive complete interrupt and thus whenever a serial command is received from the android client, it processes it here and actuate the command. This is again an infinite procedure and microcontroller keeps on sensing the arrival of new command.

The transmission and reception of commands to and from the android client is done wholesomely in ASCII code.

Step 6: The Android Application

The application for the android smartphone is wriiten completely in BASIC4ANDROID. BASIC4ANDROID is a BASIC high level language. Basic4android is a simple yet powerful development environment that targets Android devices.

Basic4android language is similar to Visual Basic language with additional support for objects.Basic4android compiled applications are native Android applications, there are no extra runtimes or dependencies. Unlike other IDEs Basic4android is 100% focused on Android development. Basic4android includes a powerful GUI designer with built-in support for multiple screens and orientations. No XML writing is required. You can develop and debug with the Android emulator or with a real device (USB connected or over the local network). Basic4android has a rich set of libraries that make it easy to develop advanced applications.

The android application so designed is fully applicable of controlling your home. There are a total of six screens including the screen containing the authors name. The application is a little bit voice acknowledged. Whenever you click on the help menus, it tells you about the particular with the voice acknowledgemnt too.

FIG 1 This screen displays a boot animation on startup when you click the Smarthome application icon. Along with the animation, an audio message and welcome can be heared in the background.

FIG 2 This is the manual appliance control screen. Here you can manually turn ON/OFF each appliance individually or can simultaneously switch all ON/OFF in one go.
The particular device so controlled manually will disable its sensomate feature automatically. The button label shown in blue shows the status of the device.

FIG 3 This is the sensors monitoring window. From here you can see all the sensor readings and also save them in a text file in the ROOT/smarthome folder of your android smartphone. You can activate/deactivate the sleep mode from here only.

FIG 4 With this window ,you can check the status of your door whether it is open/close. You can also open or close the door from here.

FIG 5,6 From this Sensomate (Sense and automate) window, you can program the threshold values for your two lights and fan. You can also program your motion sensor to raise an alarm if it detects a motion.

FIG 7 This is the settings window. From here you can turn Bluetooth ON/OFF manually. You can manually connect to the android host from the paired list. You can change the login password here and program the threshold value for the fire alarm to raise.

FIG 8 This screen displays the author involved in developing the application.

The android app currently supports 320x240 resolution screens,but with a simple designer code script it can be modified to suit any screen size.
<p>Its awesome ! Abhishek, can u do this for me one ?</p>
<p>Great work.Thanks for your generosity</p>
<p>PIN 17 of MCU connect to CTS or RTS of LM9838? Plz help me</p>
<p>Dear Abhishek,</p><p>Please have a look on the error message and guide to solve the issur.</p><p>Best regards</p>
<p>after installation application required a login password..what was dat?</p>
<p>45206734</p>
<p>hi friend ,can you help me with a clear circuit diagram please!!! ,you can send me through</p><p>shillaisey@gmail.com</p>
@subratdash8 @abhishek7xavier i need some help! I have unzipped the app in my smartphone. But after login, it only displays the main screen of turning on and off the appliances. The settings option does not appear where i can connect to the bluetooth. Kindly help! It's urgent.
<p>Hi Abhishek,</p><p>Congrats. good work. </p><p>by the way what is the numdial and inpbox variables in lines 28 &amp; 29 . When we attempt to run the program error occurs.</p>
<p>please help. i want instead of a Bluetooth module is a wireless module esp8266.how do I use ???</p>
<p>Why do not you reply me? I stoped In this project .help me or ...</p>
<p>G.T</p>
<p>Can I use arduino Uno ?? thanks in advance :)</p>
<p>The ISY is a great piece of hardware that has a great API for controlling almost any type of home automation product. Agave http://www.agaveha.com uses this tool to create a very user-friendly android environment to do most of your home automation needs. </p>
<p>What is SV1 in the schematic</p>
i would love it if you can give an insight on the project and the circuit diagram with the list of all<br><br>necessary accessories i may need<br><br>pls email me punitdubey39@gmail.com
<p>Hi</p><p>i read one of your article online about home automation </p><p>i picked an interest in the project and i would like to do for my final year project as i am an HND </p><p>scholar studying electronics and telecom </p><p>i would love it if you can give an insight on the project and the circuit diagram with the list of all </p><p>necessary accessories i may need</p><p>pls email me benjayson10@gmail.com</p>--<br><p> <br>kind regards</p><div><br>Orolowo Benjayson</div>
<p>thanks u for this project. but i can control it with android app!!. </p><p>please help me. the android version of my phone is 4.2.2 (jelly bean)</p><p>mail me in abhijit9679@gmail.com</p>
please tell the simulation program used.. I m not able to find a lot of components on proteus
sir the schematic diagram is quite unclear can u please send it to my mail with all the other details like components required plz .I really want to make such a project.<br>universalkingankit@gmail.com
nd plz specify all the sensors used too
<p>can you post it's video..</p>
Sir,please send me the schematic diagram clearly.pls my email id is shivakarthikeyan41@gmail.com
<p>I'd love a schematic/tutorial as well if you are willing to share.</p><p>Jamison</p>
Good work sir.. can you please send me some tutorial and reference so i can make this project step by step .. thanks .. garz.bautizta@gmail.cim
<p>I Wonder why this instructables havn't got featured !!<br><br>First of all &quot;Hatts of to your work&quot; you are such a pro</p><p>Im try to make one project similar to yours for that i need to make an android app it will be so thankfull if you help me.</p>
<p>Dear Sir ! I want to buy your project that install it already for my house . Because if I made it I very difficult to buy Electronic component to installation .so I need you help.please reply me on Email: theansenppi@gmail.com thanks you for your kindness ....</p>
<p>Dear Sir ! I want to buy your project that install it already for my house . Because if I made it I very difficult to buy Electronic component to installation .so I need you help.please reply me on Email: theansenppi@gmail.com thanks you for your kindness ....</p>
<p>Hi Abhishek! Thank you so much for providing such a detailed tutorial for this project. You've really helped a lot of students like me :) one thing i needed to ask is whether you have deleted the app from the app store? I could not find the app developed by you. Could you please provide the link to that app? </p>
<p>See Step 5 for App.7z</p>
<p>also, what component have you used for Bluetooth module on proteus? I can't find the BT_UART on proteus :(</p>
<p>Hi please tell me how to program light 1-2 and so on. thanks</p>
Nice brother good project.<br>Can you share the code of this project ?<br>And can I use arduino uno board in place of atmega16?<br><br>Abhishekk.cnb@gmail.com , please send me the project details. Thanks
<p>See step - 5</p>
<p>from where u get android application?</p>
<p>I designed it myself man!!</p>
I have completed this project. but still a problem there is no connection with the Bluetooth module and microcontroller
<p>LMX9838 sends an active low (logic 0) signal to PIN-17 of mcu to say that the client(smartphone) is available and is connected to this bluetooth module so that the mcu can start sending the app update messages. HC-05 module has no such functionality for LINK detection .Now because I designed the firmware to start serial communication only after this pin is sensed as low,you can manually connect this pin to ground to keep the system working!!</p>
<p>Dear, Abhishek sir, can you plz tell me what can I use in replacement of 'ADP122aujz 2.5 r7' . plz suggest me anything I can use instead of this.</p>
<p>Actually it is ADP122aujz3.3 which is a 3.3 linear voltage regulator.You can use any general purpose 3.3v regulator like LM1117-3.3 or UA78m33,etc</p>
<p>Alright sir, Thanks, Please also tell me, Have you made any changes to the Fuse Bits of MC before writing the program. Or you used the the default Fuse bits as purchased from market??? if yes please share.</p>
<p>FUSE BITs config = use default configuration with internal RC oscillator programmed at 8MHz as u may see that I have not used any external crystal,but u can use an external 8MHz crystal also so just change it to external crystal with any startup time after default fusebit settings!!</p>
<p><a href="http://www.digibay.in/ams1117-3-3v-1a-smd-voltage-regulator" rel="nofollow">http://www.digibay.in/ams1117-3-3v-1a-smd-voltage-...</a><br>http://www.onlinetps.com/shop/index.php?main_page=product_info&amp;cPath=12_50&amp;products_id=847&amp;zenid=b5b9f036e550ba7b783e4e1c4bd56fe8</p>
this is the image
and also I made the mq5 like this. I have added a photo
what is the value of R1 and R11
<p>R1 = 10k<br>R11 = 220 ohm</p>
Hey can i hv source code for MCU as well as android app.<br>I was actully trying to make it for my hm. Thanks in adv<br>My mail id is yogesh.kanse22@gmail.com
hi iam using a simple way to convert 5v into 3.3v I added a photo. will it work
<p>Not at all for powering sensors/ICs.</p><p>Use linear regulators like ua78m33,etc</p>

About This Instructable

155,593views

274favorites

License:

Bio: Nothing special ^_^
More by abhishek7xavier:Heart rate monitor with PC connectivity Smart home energy monitoring & management system DIY ClockBlock (a multipurpose rechargeable timepiece) 
Add instructable to: