0% found this document useful (0 votes)
34 views15 pages

Cea Report New

This document provides a summary of a project to develop a home automation system using an Arduino board that can be remotely controlled by an Android smartphone. The system interfaces various sensors like IR, temperature, humidity, and Bluetooth to the Arduino board which then controls electrical loads like lights and appliances. The loads can be turned on/off remotely through the smartphone application. Diagrams of the system components and connections are provided along with the code sketch to program the Arduino board.

Uploaded by

mirzamujeeb447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views15 pages

Cea Report New

This document provides a summary of a project to develop a home automation system using an Arduino board that can be remotely controlled by an Android smartphone. The system interfaces various sensors like IR, temperature, humidity, and Bluetooth to the Arduino board which then controls electrical loads like lights and appliances. The loads can be turned on/off remotely through the smartphone application. Diagrams of the system components and connections are provided along with the code sketch to program the Arduino board.

Uploaded by

mirzamujeeb447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

CEA REPORT

HOME AUTOMATION USING ARDUINO

Abstract:
The main objective of this project is to develop a home automation system using an Arduino
board with different sensors being remotely controlled by any Android OS smart phone. As
technology is advancing so houses are also getting smarter. Modern houses are gradually
shifting from conventional switches to centralized control system, involving remote controlled
switches. Presently, conventional wall switches located in different parts of the house makes it
difficult for the user to go near them to operate. Even more it becomes more difficult for the
elderly or physically handicapped people to do so. Remote controlled home automation system
provides a most modern solution with smart phones. In order to achieve this, a different sensors
are interfaced to the Arduino board at the receiver end while on the transmitterend,HC-05
application on the cell phone sends ON/OFF commands to the receiver where loads are
connected. By touching the specified location on the HC-05, the loads can be turned ON/OFF
remotely through this technology.
Table of Content:
No. Topics Page No
1 Description 2,3
2 Introduction 4
3 Component 4
4 Pin Configuration Tables 5
5 Sensor Figures 6,7
6 Flow Chart 8
7 Software Simulation 9
8 Sketch 10-13
9 Hardware 14
10 Advantages 15
11 Conclusion, Results and References 15
Table of Figures:
Fig No Name Fig Page Table No Table Page No
No
1 Arduino 6 - -
2 5V Relay 6 - -
3 IR Sensor and Remote 6 1 5
4 DHT 11 7 2 5
5 Bluetooth Module 7 3 5
6 WI-FI Module 7 4 5

1
Description
Arduino:
Arduino refers to an open-source electronics platform or board and the software used to program
it. Arduino is designed to make electronics more accessible.
Features of the Arduino UNO:
Microcontroller: ATmega328
Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6
DC Current per I/O Pin: 40 mA

2
WIFI Module ESP 8266-01S:
Wi-Fi module is used for connecting your appliances to your smart phones or computers.

5v Relay Module:
It is used for switching DC TO AC voltages maximum voltage switching depends on relay
Specifications.

DHT 11 Temp and Humidity sensor:


It is used for measuring temp and humidity so at a certain range the lights may turn on or off.

IR Module:
It uses IR remote to control appliances.

Switch buttons:
To manually switch on or off appliances and for mode selections.

Universal PCB and Bread Board:


For connections of components.

Resistors:
It is used to prevent components from being damaged by certain electrical surges.

3
Introduction:
Now days everyone has smart phone and wants to control everything from smart phone.
Everyone knows how to control mobile phone so it easy to use and understand. Lights, fan,
switches , refrigerator are controlled through Manually, IR remote, Wi-Fi and Bluetooth remote
using Arduino. The designing of home automation are going to become simpler and more
popular because most of people uses smart phone now days. In this device we are using Arduino
which is most commonly used device for automation. Arduino is a hardware which is used to
connect computer and the project model so that we can control it by using Arduino code
accordingly. Arduino is a microcontroller it is just like human brain it processes information and
then it perform some Logical and mathematical operation on that information. Arduino is
connected with the different sensors which receives the information from user. Arduino also
connected relay, which receives information from Arduino and perform the operation as switch.
This generates personal area network in home environment, where all these appliances can be
interconnected and monitored using a microcontroller with Arduino using smart phone. Home
automation involves a degree of computerized or automatic control to certain electrical and
electronic systems in a building.

Components:
1. Arduino UNO
2. Bluetooth HC-05/ WI-FI Module ESP8266-01S
3. IR Module
4. DHT 11 Sensor
5. 5v Relays
6. 4 Bulbs
7. Power Supply
8. Universal PCB and Bread Board
9. Jumper wires
10. Resistors
11. Switches
12. Soldering Iron

4
Pin Configuration Tables:
IR module:

Table No:01
IR module Pins Arduino Pins
Vcc Vcc
Gnd Gnd
Signal A0
DHT-11:

Table No:02
DHT-11 Pins Arduino Pins
Vcc Vcc
Gnd Gnd
Signal 11
Bluetooth Module:

Table No:03
Bluetooth Module Pins Arduino Pins
Enable Not connected
Vcc Vcc
Gnd Gnd
Tx 2
Rx Tx
State Not connected
Wi-Fi Module:

Table No:04
Wi-Fi Module Pins Arduino Pins
Gnd Gnd
Tx Rx
GPIO Not connected
CH_EN vcc
GPIO-0 Not connected
Reset Not connected
Rx Tx
Vcc Vcc

5
Sensor Figures:
Figures of different sensors used in this project are as follows,

Arduino:

FIG 1

5v Relays:

FIG 2

IR Module and Remote:

FIG 3

6
DHT-11:

FIG 4

Bluetooth Module:

FIG 5

Wifi Module:

FIG 6

7
Flow Chart:

8
Software Simulation:

9
Sketch:
#include <IRremote.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX D2, D3

// define the GPIO connected with Relays and switches


#define RelayPin1 3 //D4
#define RelayPin2 5 //D5
#define RelayPin3 7 //D6
#define RelayPin4 9 //D7

#define SwitchPin1 4 //D10


#define SwitchPin2 6 //D11
#define SwitchPin3 8 //D12
#define SwitchPin4 10 //D13

#define IR_RECV_PIN A0 //A0

//Update the HEX code of IR Remote 0x<HEX CODE>


#define IR_Button_1 0xFF30CF
#define IR_Button_2 0xFF18E7
#define IR_Button_3 0xFF7A85
#define IR_Button_4 0xFF10EF
#define IR_All_Off 0xFFA25D
#define IR_All_On 0xFFE21D

IRrecv irrecv(IR_RECV_PIN);
decode_results results;

// Switch State
bool SwitchState_1 = LOW;
bool SwitchState_2 = LOW;
bool SwitchState_3 = LOW;
bool SwitchState_4 = LOW;
bool RelayState_1 = LOW;
bool RelayState_2 = LOW;
bool RelayState_3 = LOW;
bool RelayState_4 = LOW;
char bt_data; // variable for storing bluetooth data

void relayOnOff(int relay){


switch(relay){
case 1:
digitalWrite(RelayPin1, !digitalRead(RelayPin1)); // change state for relay-1
EEPROM.update(0,digitalRead(RelayPin1));
delay(100);
break;
case 2:
digitalWrite(RelayPin2, !digitalRead(RelayPin2)); // change state for relay-2
EEPROM.update(1,digitalRead(RelayPin2));
delay(100);
break;
case 3:
digitalWrite(RelayPin3, !digitalRead(RelayPin3)); // change state for relay-3

10
EEPROM.update(2,digitalRead(RelayPin3));
delay(100);
break;
case 4:
digitalWrite(RelayPin4, !digitalRead(RelayPin4)); // change state for relay-4
EEPROM.update(3,digitalRead(RelayPin4));
delay(100);
break;
default : break;
}
}

void eepromState()
{
digitalWrite(RelayPin1, EEPROM.read(0)); delay(200);
digitalWrite(RelayPin2, EEPROM.read(1)); delay(200);
digitalWrite(RelayPin3, EEPROM.read(2)); delay(200);
digitalWrite(RelayPin4, EEPROM.read(3)); delay(200);
}

void bluetooth_control()
{
if(mySerial.available()) {
bt_data = mySerial.read();
Serial.println(bt_data);
switch(bt_data)
{
case 'A': digitalWrite(RelayPin1, LOW); EEPROM.update(0,LOW); break; // if 'A' received Turn on Relay1
case 'a': digitalWrite(RelayPin1, HIGH); EEPROM.update(0,HIGH); break; // if 'a' received Turn off Relay1
case 'B': digitalWrite(RelayPin2, LOW); EEPROM.update(1,LOW); break; // if 'B' received Turn on Relay2
case 'b': digitalWrite(RelayPin2, HIGH); EEPROM.update(1,HIGH); break; // if 'b' received Turn off Relay2
case 'C': digitalWrite(RelayPin3, LOW); EEPROM.update(2,LOW); break; // if 'C' received Turn on Relay3
case 'c': digitalWrite(RelayPin3, HIGH); EEPROM.update(2,HIGH); break; // if 'c' received Turn off Relay3
case 'D': digitalWrite(RelayPin4, LOW); EEPROM.update(3,LOW); break; // if 'D' received Turn on Relay4
case 'd': digitalWrite(RelayPin4, HIGH); EEPROM.update(3,HIGH); break; // if 'd' received Turn off Relay4
case 'Z': all_Switch_ON(); break; // if 'Z' received Turn on all Relays
case 'z': all_Switch_OFF(); break; // if 'z' received Turn off all Relays
default : break;
}
delay(20);
}
}

void ir_remote(){
if (irrecv.decode(&results)) {

switch(results.value){
case IR_Button_1: relayOnOff(1); break;
case IR_Button_2: relayOnOff(2); break;
case IR_Button_3: relayOnOff(3); break;
case IR_Button_4: relayOnOff(4); break;
case IR_All_Off: all_Switch_OFF(); break;
case IR_All_On: all_Switch_ON(); break;
default : break;
}
//Serial.println(results.value, HEX);
irrecv.resume();

11
}
}

void all_Switch_ON(){
digitalWrite(RelayPin1, LOW); EEPROM.update(0,LOW); delay(100);
digitalWrite(RelayPin2, LOW); EEPROM.update(1,LOW); delay(100);
digitalWrite(RelayPin3, LOW); EEPROM.update(2,LOW); delay(100);
digitalWrite(RelayPin4, LOW); EEPROM.update(3,LOW); delay(100);
}

void all_Switch_OFF(){
digitalWrite(RelayPin1, HIGH); EEPROM.update(0,HIGH); delay(100);
digitalWrite(RelayPin2, HIGH); EEPROM.update(1,HIGH); delay(100);
digitalWrite(RelayPin3, HIGH); EEPROM.update(2,HIGH); delay(100);
digitalWrite(RelayPin4, HIGH); EEPROM.update(3,HIGH); delay(100);
}

void manual_control()
{
if (digitalRead(SwitchPin1) == LOW && SwitchState_1 == LOW) {
digitalWrite(RelayPin1, LOW);
EEPROM.update(0,LOW);
SwitchState_1 = HIGH;
}
if (digitalRead(SwitchPin1) == HIGH && SwitchState_1 == HIGH) {
digitalWrite(RelayPin1, HIGH);
EEPROM.update(0,HIGH);
SwitchState_1 = LOW;
}
if (digitalRead(SwitchPin2) == LOW && SwitchState_2 == LOW) {
digitalWrite(RelayPin2, LOW);
EEPROM.update(1,LOW);
SwitchState_2 = HIGH;
Serial.println("Switch-2 on");
}
if (digitalRead(SwitchPin2) == HIGH && SwitchState_2 == HIGH) {
digitalWrite(RelayPin2, HIGH);
EEPROM.update(1,HIGH);
SwitchState_2 = LOW;
Serial.println("Switch-2 off");
}
if (digitalRead(SwitchPin3) == LOW && SwitchState_3 == LOW) {
digitalWrite(RelayPin3, LOW);
EEPROM.update(2,LOW);
SwitchState_3 = HIGH;
Serial.println("Switch-3 on");
}
if (digitalRead(SwitchPin3) == HIGH && SwitchState_3 == HIGH) {
digitalWrite(RelayPin3, HIGH);
EEPROM.update(2,HIGH);
SwitchState_3 = LOW;
Serial.println("Switch-3 off");
}
if (digitalRead(SwitchPin4) == LOW && SwitchState_4 == LOW) {
digitalWrite(RelayPin4, LOW);
EEPROM.update(3,LOW);
SwitchState_4 = HIGH;

12
Serial.println("Switch-4 on");
}
if (digitalRead(SwitchPin4) == HIGH && SwitchState_4 == HIGH) {
digitalWrite(RelayPin4, HIGH);
EEPROM.update(3,HIGH);
SwitchState_4 = LOW;
Serial.println("Switch-4 off");
}
}

void setup() {
Serial.begin(9600);
mySerial.begin(9600);

irrecv.enableIRIn(); // Start the receiver

pinMode(RelayPin1, OUTPUT);
pinMode(RelayPin2, OUTPUT);
pinMode(RelayPin3, OUTPUT);
pinMode(RelayPin4, OUTPUT);

pinMode(SwitchPin1, INPUT_PULLUP);
pinMode(SwitchPin2, INPUT_PULLUP);
pinMode(SwitchPin3, INPUT_PULLUP);
pinMode(SwitchPin4, INPUT_PULLUP);

//During Starting all Relays should TURN OFF


digitalWrite(RelayPin1, HIGH);
digitalWrite(RelayPin2, HIGH);
digitalWrite(RelayPin3, HIGH);
digitalWrite(RelayPin4, HIGH);

delay(500);
eepromState();
}

void loop() {

ir_remote();
bluetooth_control();
manual_control();
}

13
Hardware Figure:

14
Advantages:
1. Everything is automated so it is easy to use.
2. It is control by mobile application so no extra training is required.
3. We can change controlling system as our requirement.
4. It works on Arduino based system so we can easily understand how it works.
5. It saves our time.
6. Every home appliance can control by one android application.
7. Easy installation and user friendly.

Conclusion:
It can be concluded from the above discussion that Home automation is a special kind of device
which controls home appliances with using extra effort. And in this paper, we demonstrated how
the home automation is made, discussed about methodology and what its application can be. And
in the future, on the new technology can be included which reduces human effort, which is being
researched, we also talked about it. And we've created a that type of device which is compact in
size, low cost, more capacity, long life and more distant signal receivers . The need of this
research paper is to create a device which saves the electricity and improve human life style.

Results:
According to the proposed plan the final outcome of this paper leads to the development of a
home automation. Through this project, an automation system has been created so that we can
easily control home appliances like as light, fan, tube light, AC, bulb, etc.

References:
1.. N.David, A.Chima, A.Ugochukwu and E.Obinna,”Design of a home automation system
using Arduino”, International journal of Scientific & Engineering Research, Vol. 6, pp. 795-801,
june-2015.
2. International Journal of Computer Applications (0975 – 8887) Volume 116 –
No. 11, April 2015.

15

You might also like