26
Remote Control of Home Appliances using Smartphone Submitted by: Sarbari Das (Roll no: 16900513039) Shabnam Afrin (Roll no: 16900513042) Shubham Bhattacharya (Roll no: 16900513043) Siddhartha Mishra (Roll no: 16900513044) Jinia Biswas (Roll no: 16905514039) Ayan Basu (Roll No: 16900512015) Electronics and Instrumentation Engineering

Remote control of home appliances using smartphone

Embed Size (px)

Citation preview

Page 1: Remote control of home appliances using smartphone

Remote Control of Home Appliances using Smartphone

Submitted by:Sarbari Das (Roll no: 16900513039)

Shabnam Afrin (Roll no: 16900513042)

Shubham Bhattacharya (Roll no: 16900513043)

Siddhartha Mishra (Roll no: 16900513044)

Jinia Biswas (Roll no: 16905514039)

Ayan Basu (Roll No: 16900512015)

Electronics and Instrumentation Engineering

ACADEMY OF TECHNOLOGYUnder the guidance ofProf. Smarajit Maity

Page 2: Remote control of home appliances using smartphone

CONTENTSChapter 1: Project Description

1.1 Introduction

1.2 Block Diagram

Chapter 2: Principle and Operation

2.1 Components Used

2.2 Hardware Description

2.3 Software Description

2.4 Screenshots

2.5 Circuit Diagram

2.6 Operation

2.7 Flow Chart

2.8 Program code

Chapter 3: Project Overview

3.1 Practical Applications

3.2 Future Scope

3.3 Advantages

3.4 Limitations

3.5 Conclusion

References

Page 3: Remote control of home appliances using smartphone

CHAPTER 1: Project Description1.1. Introduction:This project aims at achieving automation using the widely used mobile operating system ANDROID i.e. android operating system. The electrical and home appliances can be controlled using the android mobile phones and Bluetooth Wireless Communication Protocol even if you are out of your house and you forgot to switch off the appliances. Many electrical and home appliances like light, fan, and refrigerators etc. can be controlled using the android operating system. This can also be implemented at workplaces. Home automation is the residential extension of building automation. It is automation of the home, housework or household activity. Home automation may include centralized control of lighting, HVAC (heating, ventilation and air conditioning), appliances, security locks of gates and doors and other systems, to provide improved convenience, comfort, energy efficiency and security. Home automation for the elderly and disabled can provide increased quality of life for persons who might otherwise require caregivers or institutional care.

Although home automation today is not a new thing but most advanced home automation systems in existence today require a big and expensive change of infrastructure. This means that it often is not feasible to install a home automation system in an existing building.

“Homatic” is a wireless home automation application that is supposed to be implemented in existing home environments, without any changes in the existing infrastructure.

“Homatic” lets the user to control his home from his or her android smart phone. In the smart phone application the user can select actions what should happen with electrical and/or electronic devices in the network.

Mobile phone is a revolutionary invention of the century. It was primarily designed for making and receiving calls & text messages, but it has become the whole world after the Smart phone comes into the picture. In this project we are building a home automation system, where one can control the home appliances, using the Bluetooth based Smartphone, just by sending commands via Bluetooth from an application designed for this project.

Page 4: Remote control of home appliances using smartphone

1.2. Block Diagram:

Page 5: Remote control of home appliances using smartphone

Chapter 2: Principle & Operations 2.1. Components Used: Following components are used in this project:

1. Android Smartphone

2. Atmega 328P-PU

3. Bluetooth Module (HC-05)

4. UCN2003A Relay Driver

5. 25 Watt Bulb

6. AC Fan

7. Arduino IDE

8. SMPS(12V, 1A)

9. Bulb Holder

10. Terminal Block

11. Crystal Oscillator(16 MHz)

12. Ceramic Capacitor(22 pF)

13. Radial Capacitor(10 uF)

14. Resistor(100 ohm,180 ohm,1 kohm,10 kohm)

15. LED’s

16. Switch Push Button

17. Breadboard

18. Relay Switches

19. 7805 Regulator

20. Lead wires

Page 6: Remote control of home appliances using smartphone

2.2. Hardware Description:

2.2.1. Atmega328:

ATMEGA 328 microcontroller, which acts as a processor for the arduino board. Nearly it consists of 28 pins. From these 28 pins, the inputs can be controlled by transmitting and receiving the inputs to the external device. It also consists of pulse width modulation (PWM). These PWM are used to transmit the entire signal in a pulse modulation. Input power supply such as Vcc and Gnd are used. These IC mainly consists of analog and digital inputs. These analog and digital inputs are used for the process of certain applications. The operating volt ranges from 5v. The input voltage recommended for arduino microcontroller is from 7v and the maximum of 12v. The DC input current given to the arduino board is in the range of 40mA.

2.2.2. Switching Relay:

Page 7: Remote control of home appliances using smartphone

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal.

In this project the relay have been used to control the 230V power supply of household when connected with the Bluetooth app.

2.2.3. Bluetooth Module: HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Blue core 04-External single chip Bluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm.

2.2.4. Power Supply:

Page 8: Remote control of home appliances using smartphone

2.3: Software Description:

2.3.1. Android Operating System:Android is an open-source operating system which means that any manufacturer can use it in their phones free of charge. It was built to be truly open. Android is built on the open Linux Kernel. Furthermore, it utilizes a custom JAVA virtual machine that was designed to optimize memory and hardware resources in a mobile environment.

An android app is meant for phones with an android based operating systems. They can be downloaded from the android app Market which is pre-loaded on every android phone. Blue control APP and Bluetooth Spp APP are some examples.

2.3.2. Arduino Integrated Development Environment:

Page 9: Remote control of home appliances using smartphone

The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing and other open-source software. This software can be used with any Arduino board.

It contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino and Genuino hardware to upload programs and communicate with them. Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the text editor and are saved with the file extension .ino.

There are two special functions that are a part of every Arduino sketch: setup() and loop() . The setup() is called once, when the sketch starts. It's a good place to do setup tasks like setting pin modes or initializing libraries. The loop() function is called over and over and is heart of most sketches.

2.4. Screenshots:

Page 10: Remote control of home appliances using smartphone

2.6. Operation:

Page 11: Remote control of home appliances using smartphone

This application controls the various appliances connected to your arduino and relays. When the toggle buttons on the application are pressed, corresponding bluetooth signals are sent from your android phone to he Bluetooth module you have hooked up to your arduino. The arduino finds out which signal was sent and compares it to the predefined signals assigned for each appliance. When it identifies that signal, then the arduino activates the relay hooked up to its digital pin by passing 5V through it. Thus the relay is switched ON and the corresponding appliance connected to the relay is turned ON as well. To switch it OFF, arduino passes a 0V or logic low to its digital pin.

2.6.1. Implementation of Arduino Uno on breadboard:

We have implemented the arduino uno on breadboard to minimize the total cost of the project.

The steps mentioned below are to be followed to create the set up shown above.

Step 1: Adding power and ground wires for where our voltage regulator will be. 

Step 2: Adding power and ground wires at the bottom of our board connecting each rail.

Page 12: Remote control of home appliances using smartphone

Step 3: Adding the 7805 power regulator and the lines to power the board. The regulator is a TO-220 package where the Input from the external power supply goes input on the left, ground is in the middle and the 5V output is on the right (when facing the front of the regulator). Add power OUT and ground wires that connect to the right and left rails of the breadboard. Also a 10uF capacitor between the IN of the regulator and the ground as well as a 10uF capacitor on the right rail between power and ground. The silver strip on the capacitor signifies the ground leg.

Step 4: Adding an LED and a 220-ohm resistor on the left side of your board across from the voltage regulator. An LED attached to power like this is a great trouble shooting trick. We'll always know when our board is being powered as well as quickly know if your board is being shorted.

The red and black wires to the left of the voltage regulator are where our power supply will be plugged in. The red wire is for the power and the black wire is for the ground. We only attach a power supply that is between 7-16V. Any lower and you won't get 5V out of our regulator. Any higher and our regulator may be damaged. A 9V battery, 9V DC power supply, or 12V DC power supply is suitable.

Page 13: Remote control of home appliances using smartphone

Step 5: Connecting a 10k ohm pull up resistor to +5V from the reset pin in order to prevent the chip from resetting itself during normal operation. The reset pin reboots the chip when pulled down to ground. In later steps we will show you how to add a reset switch that takes advantage of this.

The pins are connected as follows:

1. Pin 7 - Vcc - Digital Supply Voltage2. Pin 8 - GND

3. Pin 22 - GND

4. Pin 21 - AREF - Analog reference pin for ADC

5. Pin 20 - AVcc - Supply voltage for the ADC converter.

Step 6: Adding a 16 MHz external clock between pin 9 and 10, and add two 22 pF capacitors running to ground from each of those pins.

Page 14: Remote control of home appliances using smartphone

Step 7: Adding the small tactile switch so that we can reset the Arduino whenever we'd like and prepare the chip for uploading a new program. A quick momentary press of this switch will reset the chip when needed. Add the switch just above the top of the Atmega chip crossing the gap in the breadboard. Then, add a wire from the bottom left leg of the switch to the RESET pin of the Atmega chip and a wire from the top left leg of the switch to ground.

Step 8: Add the small tactile switch so that you can reset the Arduino whenever we'd like and prepare the chip for uploading a new program. A quick momentary press of this switch will reset the chip when needed. Add the switch just above the top of the Atmega chip crossing the gap in the breadboard. Then, add a wire from the bottom left leg of the switch to the RESET pin of the Atmega chip and a wire from the top left leg of the switch to ground.

Finally, adding the LED. The long leg or the anode connects to the red wire and the short leg or the cathode connects to the 220 ohm resistor going to ground.

Page 15: Remote control of home appliances using smartphone

Following all above steps we have made our own Arduino UNO board shown below.

2.6.2. Checking our Arduino circuit:Now to see whether our Arduino is working or not, we upload a blinking LED program in it.It turns the LED on and off after a delay of 250 ms. The code and flowchart of the same is given below.

Page 16: Remote control of home appliances using smartphone

Code:

int ledPin = 10;

void setup() {

pinMode(ledPin, OUTPUT);

}

void loop() {

digitalWrite(ledPin, HIGH);

delay(250);

digitalWrite(ledPin, LOW);

delay(250);

}

Page 17: Remote control of home appliances using smartphone

The response of the above program is shown below:

When green LED is on:

When green LED is off:

2.6.3. Home automation circuit:

Page 18: Remote control of home appliances using smartphone

Now the steps for implementing the home automation circuit are as follows:

The connection diagram for arduino is as shown. For setting up this system, wiring connections have to be made between the arduino and bluetooth module and also with the relays.

Step I: Connecting BluetoothThe bluetooth module’s Tx is connected to arduino Rx (digital pin 0) and the module’s Rx to arduino Tx (digital pin 1). 5V and GND of the module is connected to the arduino’s 5V and GND.

Step II: Connecting Relay DriverThe relay driver chip consist of total 16 pins (8 pins both side) where pin 1 to 7 are input from digital pins of Arduino and pin 10 to 16 are for the output to the relay switches. The pin 8 is connected to ground and pin 9 to +12v supply. Here in our project, we are connecting digital pin 7 and 8 (pin 13 and 14 of Atmel328) to the pin 1 and 2 of relay driver.

Step III: Relay Driver connection with Relay SwitchesThe relay we’re using is SPDT, it has 5 pins on the underside. As shown below, here pins 1 and 3 are the coil pins. Pin 1 is connected to the pin 16 and 3 is connected to arduino GND. 2 is the common contact in the relay to which you have to connect the power for your appliance (AC 230V), and 4 is the pin to which you have to connect your appliance wire.

Page 19: Remote control of home appliances using smartphone

Step IV: Connecting your appliance to the relay

In a normal SPDT relay, whose pin out is shown in the above step, pins 2 and 4 act identical to the two terminals of a switch. When digital HIGH voltage is applied from the arduino to the relay, switch turns ON, when the voltage is withdrawn it turns OFF. We can attach this system you made to a normal switchboard by extending the wires from behind the switches in the board to your relay. As seen in the connection diagram in the above step, you have to connect a power AC line to the common terminal of all the relays. Then, you have to extend the wires from behind the switchboard of the corresponding lights/lamps you wish to control. Each of these wires are connected to the “NO”(Normally Open) terminal of the relays (pin no 4 in step no 1’s relay pin out diagram).

Step v: Loading the Arduino software

Here it checks the incoming bluetooth signal via the bluetooth module and then compares (ASCII values) using an “if” statement with previously defined values. If it matches the value, relay is activated using “digitalWrite(pin,HIGH)” command , which passes 5V to the arduino digital pin. The arduino code for the project is here:[Pending].

Step VI: Downloading the android application and setting up Bluetooth

There are a lot of applications available in Google playstore for home automation. We install any one of them. Once you have installed the application, before opening it you need to pair and connect with your bluetooth module. For this, you need to power the arduino and bluetooth module and then turn ON the bluetooth of your phone and make it visible to other devices. After that, search for new devices in bluetooth, select your bluetooth module from the list, enter the pairing code when prompted ,it is usually ’1234 ′ or ’0000 .′ Note the name of your device , in this case it is “HC-05″.

After pairing with the system, go to the application and enter the name of your bluetooth module you noted earlier (case-sensitive) and click “OK”. After that the phone will get connected to your system, and on clicking the respective buttons, the appliances turn ON/OFF.

Page 20: Remote control of home appliances using smartphone

Chapter 3: Project Overview3.1. Application:The project designed is very practical in nature because everything can be controlled with the help of just a mobile phone which is widely available nowadays and also proves to be handy. Also the project is feasible because the cost of the project is very less as compared to the expensive Wi-Fi based home control systems presently available in the market which require an additional cost of internet service.

3.2. Future Scope:This project can be further developed by integrating it with the internet to monitor your home while sitting in a remote area. By doing this, one can keep an eye on his or her home through an internet connected to the user’s mobile phone or PC or laptop. This will not only improve the security of your home in this modern day world but will also assist in conservation of energy like if you left any home appliance switched on by mistake, then you can check the status of the appliance on the graphical interface made on your mobile and can switch it off using the net connectivity.

3.3. Advantages:1. It is a robust and easy to use system.

2. There is no need for extra training of that person who is using it.

3. All the control would be in your hands by using this home automation system.

4. This project can provide the facility of monitoring all the appliances within the communication range through Bluetooth.

5. The schematic of Arduino is open source, for the future enhancement of the project board can be extended to add more hardware features.

6. The inefficiency of operation of conventional wall switches can be overwhelmed using various home automation systems (without using conventional swit1ching methods).

7. The loss of power can be reduced and manpower required for home automation is very less compared to conventional methods.

8. Provides safety from electrical power short circuits while using conventional wall switches to operate loads.

3.4. Limitations:1. Bluetooth is used in this home automation system, which have a range of 10 to 20 meters

so the control cannot be achieved from outside this range.

2. Application is disconnected after disconnect of the Bluetooth.

3. When the new users want to connect, first download application software and then configuration must be done.

4. Security problem

Page 21: Remote control of home appliances using smartphone

3.5. CONCLUSION:The home automation system has been experimentally proven to work satisfactorily by connecting sample appliances to it and the appliances were successfully controlled from a wireless mobile device. The Bluetooth client was successfully tested on a multitude of different mobile phones from different manufacturers, thus proving its portability and wide compatibility. This project will not only provide convenience to the common man but will be a boon for the elder and disabled.

Page 22: Remote control of home appliances using smartphone

References:1. www.electronicshub.org

2. www.engineersgarage.com

3. www.atmel.com

4. www.arduino.org

5. Power Electronics by P.S Bimbhra