You are on page 1of 28

HOME AUTOMATION USING ARDUINO

Project report submitted


In partial fulfillment of the requirement for the award of the degree of
Bachelor of Technology
In
ELECTRONICS & COMMUNICATION
ENGINEERING
By
 Anmol Kumar Vimal (18104134005)

 Md Jahid (18104134018)

 Ruhi Shree (18104134030)

 Bipul Kumar (18104134044)

 Prachi Raj (18104134042)

 Rishikesh Kumar (18104134024)

Under the supervision of


Mr. Sanjeev Kumar (Assistant Professor)

DEPARTMENT OF ECE

GOVERNMENT ENGINEERING COLLEGE BANKA


2
Abstract

This project is based on the construction of a model simulating a home


automation with different operation modes which can be controlled also by a
mobile application, IR Remote, sensor. To achieve this objective, a scale house
that captures different signals, both digital and analog, has been developed. To
approach the house to a real home automation application the variables under
study and control are interior temperature and lighting, movement around the
house and water level of the pool. The house has three main operating modes.
In automatic mode, it performs the measurement and executes the control of the
variables, regulating itself according to the conditions to which it is exposed. In
contrast, the remote mode is achieved using the mobile application that allows
user to modify the variables. Finally, in alarm mode it controls the parameters
that assure the security of the house when proprietor is away from home. To
capture the signals, the prototype has temperature, lighting, movement and
water level sensors installed, and for the regulation and control it has a fan,
some LED, an acoustic warning device and a water pump. The core is an
Arduino Mega board that allows the application operation and receives, from
an Android mobile application, operating modes commands and, if it is
operating remotely, orders to individually control the different actuators.
For the data transmission from the mobile to the board, is used
communication via Bluetooth.
CONTENTS

1. Introduction...........................................................................................4

2. Acknowledgement.................................................................................5

3. Home automation Application.............................................................5

4. components required for Arduino........................................................6

5. Arduino Board.........................................................................................6

6. Ultrasonic Sensor......................................................................................12

7. PIR Sensor..................................................................................................10

8. LDR Sensor..................................................................................................13

9. Relay module................................................................................................13

10. Fan...............................................................................................................15

11. Buzzer..........................................................................................................16

12. Circuit Diagram of HA...............................................................................17

13. Working of HA............................................................................................18

14. Programming Part........................................................................................19

15. Conclusion......................................................................................................27
Introduction
In broad strokes, the main points of this project are automation and control, electronic
boards and mobile applications and particularly home automation, Arduino boards and
Android applications. This is the result of the connection of two modern technologies,
including hardware and software. Despite the actuality of these components, they all
appeared long ago and have been evolving throughout history.

Origin

History of automation

This project is based in automation technology and more specifically in home


automation systems.

Automation is the transfer of tasks normally performed by humans to a set of


technological elements.

An automated system consists of two parts:

✓Operation:

Part formed by elements that act directly on the machine and make it perform desired
operations. These elements are called actuators and some examples are engines, cylinders
or photodiodes.

✓Control: Brain of system, normally constituted by a programmable automaton,


able to communicate with all constituents of the operation part. The inclusion of control in
the
automation system, allows to decide on the development of a process, manipulating certain
variables to get these or other variables to act in the desired way. Although it seems a recent
technology and currently is in full development, automation dates back to ancient times.
Nowadays nobody thinks of divine forces seeing an automatic door, it is something of the
day to day that we have very internalized. It was not the same with people of Alexandria
when Herón, the great genius of mechanical engineering of classical Greece, invented an
automatic door opening system for a temple in Alexandria
2. Acknowledgements
At first I would like to thank my tutor for sharing his knowledge and for the support received
during the project development. Thanks to my family, without you none of this would have
been possible. I owe you my degree and my strength to face every challenge. I want also to
thank my couple, for the patience and interest, for every support word

Home automation applications

At this point, is called home automation to a system capable of automate a house or building
including energy management, security, comfort and communication. It can be integrated
through wired or wireless communication networks, although nowadays the predominant
trend is wireless. It could be defined as the integration of technology into the intelligent
design of an enclosure. The main points of this technology are energy saving, comfort,
security, communication and data accessibility.

Nowadays thanks to the permanent technological evolution the offer is better and have
grater quality, its use is now more intuitive and perfectly manageable by any user.
Today’s home automation contributes to increase the quality of life, makes the distribution
of the house more versatile, changes environmental conditions by creating different
predefined scenes and makes the home more functional by allowing the development of
domestic, professional and leisure under one single roof.
Houses have evolved throughout history, from caves with fire to warm and illuminate even
torches and candles and finally the arrival of electricity, which has allowed to increase home
comfort. Later, electronics arrived allowing the use of the appliances, being able to perform
programming routines and regulation processes such as hot and cold washing or video
recording. It was from the 1970’s that integrated systems were used commercially and
developed into the domestic aspect of urban houses, this is when home automation manages
to integrate the two necessary systems, electrical and electronic, in pursuit of the integral
communication of house devices. It was in the United States where the first devices of
building automation appeared, based on the X- 10 protocol.

This is a communication protocol for the remote control of electrical devices, using the pre-
existing electrical line to transmit control signals within home automation equipment by
radio frequency pulses which represent digital information. History of automation
applications comprises different stages, beginning with the first protocols oriented to remote
control and following with the great protocols of self-regulation, considered the real home
automation revolution

4. COMPONENTS REQUIRED FOR ARDUINO


1) ARDUINO UNO

2) 2 CHANNEL RELAY(5v)

3) BLUETOOTH MODULE HC05

4) POWER SUPPLY

5) LOAD (BULB 220V)

6) CONNECTING WIRES

7) VERO BOARD

8) SMARTPHONE (BLUETOOTH ENABLED)

5. Arduino boards
Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along
with ATmega328P, it consists other components such as crystal oscillator, serial
communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has
14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input pins,
a USB connection, A Power barrel jack, an ICSP header and a reset button.

Explanation of Arduino bord

Arduino Uno Pinout Configuration

Pin Category Pin Name Details

Power Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino


when using an external power
source.
8

5V: Regulated power supply


used to power
microcontroller and other
components on the board.

3.3V: 3.3V supply generated


by on-board voltage regulator.
Maximum current draw is
50mA.

GND: ground pins.

Reset Reset Resets the microcontroller.

Analog Pins A0 – A5 Used to provide analog input in


the range of 0-5V

Input/Output Pins Digital Pins 0 - 13 Can be used as input or output


pins.

Serial 0(Rx), 1(Tx) Used to receive and transmit


TTL serial data.

External Interrupts 2, 3 To trigger an interrupt.

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

SPI 10 (SS), 11 (MOSI), 12 Used for SPI communication.


(MISO) and 13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.


TWI A4 (SDA), A5 (SCA) Used for TWI communication.

AREF AREF To provide reference voltage for


input voltage.

Arduino Uno Technical Specifications

Microcontroller ATmega328P – 8 bit AVR family


microcontroller

Operating Voltage 5V

Recommended Input Voltage 7-12V

Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

EEPROM 1 KB

Frequency (Clock Speed) 16 MHz


6. Ultrasonic sensor

An ultrasonic sensor is an electronic device that measures the distance of a


target object by emitting ultrasonic sound waves, and converts the
reflected sound into an electrical signal. Ultrasonic waves travel faster
than the speed of audible sound (i.e. the sound that humans can hear).
Ultrasonic sensors have two main components: the transmitter (which
emits the sound using piezoelectric crystals) and the receiver (which
encounters the sound after it has travelled to and from the target).
In order to calculate the distance between the sensor and the object, the
sensor measures the time it takes between the emission of the sound by
the transmitter to its contact with the receiver. The formula for this
calculation is D = ½ T x C (where D is the distance, T is the time, and C
is the speed of sound ~ 343 meters/second). For example, if a scientist set
up an ultrasonic sensor aimed at a box and it took
0.025 seconds for the sound to bounce back, the distance between the
ultrasonic sensor and the box would be:
7. PIR sensor
PIR sensor can detect animal/human movement in a requirement range. PIR is made of a pyroelectric
sensor, which is able to detect different levels of infrared radiation. The detector itself does not emit any
energy but passively receives it.

It detects infrared radiation from the environment. Once there is infrared radiation from the human body
particle with temperature, focusing on the optical system causes the pyroelectric device to generate a
sudden electrical signal.

Simply, when a human body or any animal passes by, then it intercepts the first slot of the PIR sensor.
This causes a positive differential change between the two bisects. When a human body leaves the
sensing area,the sensor generates a negative differential change between the two bisects.
8. LDR SENSOR

A Light Dependent Resistor (LDR) is also called a photoresistor or a cadmium sulfide


(CdS) cell. It is also called a photoconductor. It is basically a photocell that works on the
principle of photoconductivity. The passive component is basically a resistor whose
resistance value decreases when the intensity of light decreases. This optoelectronic
device is mostly used in light varying sensor circuit, and light and dark activated
switching circuits. Some of its applications include camera light meters, street lights,
clock radios, light beam alarms, reflective smoke alarms, and outdoor clocks.

9. Relay module:

A power relay module is an electrical switch that is operated by


an electromagnet. The electromagnet is activated by a separate low-
power signal from a micro controller. When activated, the
electromagnet pulls to either open or close an electrical circuit.
A simple relay consists of wire coil wrapped around a soft iron
core, or solenoid, an iron yoke that delivers a low reluctance path for
magnetic flux, a movable iron armature and one or more sets of
contacts. The movable armature is hinged to the yoke and linked to
one or more set of the moving contacts. Held in place by a spring,
the armature leaves a gap in the magnetic circuit when the relay is
de-energized. While in this position, one of the two sets of contacts
is closed while the other set remains open.

When electrical current is passed through a coil, it generates a


magnetic field that in turn activates the armature. This movement
of the movable contacts makes or breaks a connection with the fixed
contact. When the
relay is de-energized, the sets of contacts that were closed, open
and breaks the connection and vice versa if the contacts were
open. When switching off the current to the coil, the armature is
returned, by force, to its relaxed position. This force is usually
provided by a spring, but gravity can also be used in certain
applications. Most power relays are manufactured to
operate in a quick manner.

For distribution of power in high current applications, GEP Power Products


is the industry leader in high power relay module design and
manufacturing.

Rated up to 70 amps, GEP’s power relay modules are designed for


seamless integration in high power distribution applications. The
convenient integral mounting brackets provide easy installation and
accessibility. With endless options such as terminal position assurance
available for wire retention, GEP Power Products’ power distribution
solutions and off-road industry knowledge are second to none

10. Fan :
Cooling fan which transmits energy to generate the necessary pressure with which a
continuous flow of air is maintained. It is axial type, which means that the air inlet and
outlet follow a path according to coaxial cylindrical surfaces. In this case, its brushless DC
motor will be energized when the NPN transistor to which is connected saturates.
11. Buzzer:

Is a piezoelectric transducer, a device that converts electrical signals


into sound. Piezoelectric materials have the possibility of varying its
volume when being crossed by electrical currents. Figure 3.2.11.
LED. A buzzer takes advantage of this phenomenon to vibrate a
membrane by traversing the piezoelectric material with an electric
signal.
Circuit Diagram of Home automation:

Circuit Diagram of Home automation:


13.WORKING OF CIRCUTE DIAGRAME

1. By using of ultrasonic sensor we Maked a automatic open the


front door .if someone is in the front of the door open by the micro
servo

2 Second thing we have use a PIR sensor. PIR sensor detection of human
then turn ON the fan

3. We have use a LDR sensor is used for automatic light control in


the home at night the bulb is automatically turn ON

4. Forth sensor we have used for smoke detector is used to gas if it


leakage the the data sence by the sensor are then it gas is leakage the
alarm circuit smoke detect
14. Programing part 1
#include

<Servo.h> int

output1Value =

0; int sen1Value

= 0; int

sen2Value = 0;

int const gas_sensor

= A1; int const LDR

= A0;

int limit = 400;

long readUltrasonicDistance(int triggerPin, int echoPin)

pinMode(triggerPin, OUTPUT); // Clear

the trigger digitalWrite(triggerPin,

LOW); delayMicroseconds(2);

// Sets the trigger pin to HIGH state for 10

microseconds digitalWrite(triggerPin,

HIGH); delayMicroseconds(10);

digitalWrite(triggerPin,

LOW);

pinMode(echoPin,

INPUT);
2

// Reads the echo pin, and returns the sound wave travel time

in microseconds return pulseIn(echoPin, HIGH);

Servo servo_7;

void setup()

Serial.begin(9600); //initialize serial communication


2

pinMode(A0, INPUT);

//LDR

pinMode(A1,INPUT); //gas sensor

pinMode(13, OUTPUT); //connected to

relay servo_7.attach(7, 500, 2500); //servo motor

pinMode(8,OUTPUT); //signal to piezo

buzzer pinMode(9, INPUT);

//signal to PIR

pinMode(10, OUTPUT); //signal to npn as switch

pinMode(4, OUTPUT); //Red LED

pinMode(3, OUTPUT); //Green LED

void loop()

//------light intensity control //

//--------------------------------------------------------------

int val1 =

analogRead(LDR); if

(val1 > 500)

{
2

digitalWrite (13,

LOW);

Serial.print("Bulb ON =

"); Serial.print(val1);

else

{
2

digitalWrite (13,

HIGH);

Serial.print("Bulb OFF =

"); Serial.print(val1);

//--------------------------------------------------------------

//------light & fan control //

//--------------------------------------------------------------

sen2Value =

digitalRead(9); if

(sen2Value == 0)

digitalWrite(10, LOW); //npn as switch OFF

digitalWrite(4, HIGH); // Red LED

ON,indicating nomotion

digitalWrite(3, LOW); //Green LED OFF, since no

Motion detected Serial.print(" || NO Motion Detected " );

if (sen2Value == 1)

digitalWrite(10, HIGH);//npn as
2

switch ON delay(5000);

digitalWrite(4, LOW); // RED LED OFF

digitalWrite(3, HIGH);//GREEN LED ON , indicating

motion detected Serial.print(" || Motion Detected! " );

}
2

//---------------------------------------------------------------

//--------Gas Sensor - //

//---------------------------------------------------------------

int val = analogRead(gas_sensor);

//read sensor

value Serial.print("|| Gas Sensor Value = ");

Serial.print(val); //Printing in serial monitor

//val = map(val, 300, 750, 0,

100); if (val > limit)

tone (8, 650);

delay(30

0);

noTone(8

);

//--------------------------------------------------------------

//------- servo motor----//

//-------------------------------------------------------------

sen1Value = 0.01723 * readUltrasonicDistance(6, 6);

if (sen1Value < 100)

servo_7.write(90);
2

Serial.print(" || Door Open! ;

Distance = "); Serial.print(sen1Value);

Serial.print("\
n");

}
2

else

servo_7.write(0);

Serial.print(" || Door Closed! ;

Distance = "); Serial.print(sen1Value);

Serial.print("\n");

delay(10); // Delay a little bit to improve simulation performance

15. CONCLUSION:

The system as the name indicates, ‘Home automation’ makes the system more flexible and
provides attractive user interface compared to other home automation systems. In this system
we integrate mobile devices into home automation systems. A novel architecture for a home
automation system is proposed using the relatively new communication technologies. The
system consists of mainly three components is a BLUETOOTH module, Arduino
microcontroller and relay circuits. WIFI is used as the communication channel between
android phone and the Arduino microcontroller. We hide the complexity of the notions
involved in the home automation system by including them into a simple, but comprehensive
set of related concepts. This simplification is needed to fit as much of the functionality on the
limited space offered by a mobile
device’s display. This paper proposes a low cost, secure, ubiquitously accessible, auto-
configurable, remotely controlled solution. The approach discussed in the paper is novel and
has achieved the target to control home appliances remotely using the Wi-Fi technology to
connects system parts, satisfying user needs and requirements. WiFi technology capable
solution has proved to be controlled remotely, provide home security and is costeffective as
compared to the previously existing systems. Hence we can conclude that the required goals
and objectives of home automation system have been achieved. The system design and
architecture were discussed, and prototype presents the basic level of home appliance control
and remote monitoring has been implemented. Finally, the proposed system is better from the
scalability and flexibility point of view than the commercially available home

You might also like