Vous êtes sur la page 1sur 22

N.S.

S COLLEGE OF ENGINEERING
Palakkad – 678008 , Kerala

Design Project Report On


ARDUINO CONTROLLED HOME AUTOMATION

Submitted by:
FAWAZ HANIF (Roll no: 24)
SHILPA RAMADAS (49)
ZAMEEMA ZANBAKH (59)
ATHIRA.C.P (60)

Guided By:
Mr. SIVAKUMAR.K.S
Assistant Professor
Dept. of I&C Engg.

DEPARTMENT OF INSTRUMENTATION AND CONTROL ENGINEERING


2017
DEPARTMENT OF INSTRUMENTATION & CONTROL ENGINEERING
N.S.S COLLEGE OF ENGINEERING
Palakkad – 678008 , Kerala

CERTIFICATE

This is to certify that this is the bonafide record of the Design Project
report titled “ARDUINO CONTROLLED HOME AUTOMATION” done by
Fawaz Hanif, Shilpa Ramadas, Zameema Zanbakh, Athira.C.P in the partial
fulfilment of the requirements for the award of the Degree of Bachelor of
Technology (B-Tech) in Instrumentation and Control Engineering under the
A.P.J.Abdul Kalam Technological University.

Guided by Head of Dept. Staff in Charge

Mr.Sivakumar.K.S Dr.Anish.M.N Mrs.Deepa.M.K


Professor Professor Professor
Dept. of I&C Engg. Dept. of I&C Engg. Dept. of I&C Engg.
NSSCE NSSCE NSSCE

ACKNOWLEDGEMENT

It is with great satisfaction that we wish to acknowledge the guidance and


assistance received from many in doing this project.

We would like to express our profound gratitude to our guide Mr.Sivakumar.K.S,


(Assistant Professor), Dept. of Instrumentation & Control Engineering, for his
invaluable help and suggestions during the various stages of this seminar.

We are also deeply indebted to Mr.Anish.M.N , Professor and Head of


Department of Instrumentation & Control, for his encouragement.

We also take this opportunity to express our gratitude to our dear friends for
providing immense help and encouragement for successful completion of this
project.
ABSTRACT

In the present scenario, mobile phones play an integral role in human’s


life. This makes it easier and time saving. With this we came up from an
idea “Arduino Controlled Home Automation”. This includes
controlling the lights and fans switches in a mobile phone. This can also
be applied in gate control. Also placing sensors in well to calculate the
water level. Another problem faced is in the irrigation field. Irrigation
control can be used to on/off the water flow by checking water content
in the soil. All of these are based on Arduino. The Arduino board is a
hardware interface allowing you to control and monitor hardware
devices with your computer.
CONTENTS

CHAPTER PAGE NO
1. INTRODUCTION 1
2. CHAPTER 1 i) Water Level Indicator 2
ii) Plant Irrigation System 6
iii) Automatic Control of Room
Devices 10
iv) Sliding Gate Control 14
3. CONCLUSION 16
4. REFERENCES 17
INTRODUCTION

Home automation aims to make our day to day lives easier in this day of fast living. With
Arduino board, Bluetooth and GSM module, a multilevel home automation system is discussed
here. Arduino boards are capable of reading inputs – light on a sensor, and turn it into an output
– activating a motor, turning on an LED, and display on an LCD. Bluetooth and GSM module
provides an interface between the user and the devices to be controlled. The sensors used
provides the necessary information for the whole system to work. Hence, we control our home
appliances with a touch but with some of them like water level and irrigation, it is automatic and
does not need our control.
WATER LEVEL INDICATOR

In this Arduino based automatic water level indicator and controller project we are going to
measure the water level by using ultrasonic sensors. Basic principal of ultrasonic distance
measurement is based on ECHO. When sound waves are transmitted in environment then they
return back to the origin as ECHO after striking on any obstacle. So we have to only calculate its
traveling time of both sounds means outgoing time and returning time to origin after striking on
any obstacle. And after some calculation we can get a result that is the distance. This concept is
used in our water controller project where the water motor pump is automatically turned on
when water level in the tank becomes low.
Components

1. Arduino Uno
2. Ultrasonic sensor Module
3. 16x2 LCD
4. Relay 6 Volt
5. ULN2003
6. 7806
7. PVT
8. Copper wire
9. 9 volt battery or 12 Voltadaptor
10. Connecting wires

Working of Automatic Water Level Controller

Working of this project is very simple we have used Ultrasonic sensor module which sends the
sound waves in the water tank and detects reflection of sound waves that is ECHO. First of all
we needs to trigger the ultrasonic sensor module to transmit signal by using Arduino and then
wait to receive ECHO. Arduino reads the time between triggering and received ECHO. We
know that speed of sound is around 340 m/s. so we can calculate distance by using given
formula:

Distance= (travel time/2) * speed of sound

Where speed of sound is approximately 340m per second. By using this methods we gets distance
from sensor to water surface. After it we need to calculate water level. Now we need to calculate
the total length of water tank. As we know the length of water tank then we can calculate the
water level by subtracting resulting distance coming from ultrasonic from total length of tank.
And we will get the water level distance. Now we can convert this water level in to the percent
of water, and can display it on LCD.
Circuit Diagram and Explanation
As shown in the water level controller circuit given below, Ultrasonic sensor module’s “trigger”
and “echo” pins are directly connected to pin 10 and 11 of arduino. A 16x2 LCD is connected
with arduino in 4-bit mode. Control pin RS, RW and En are directly connected to arduino pin 7,
GND and 6. And data pin D4-D7 is connected to 5, 4, 3 and 2 of arduino, and buzzer is connected
at pin 12. 6 Volt relay is also connected at pin 8 of arduino through ULN2003 for turning on or
turning off the water motor pump. A voltage regulator 7805 is also used for providing 5 volt to
relay and to remaining circuit.

In this circuit Ultrasonic sensor module is placed at the top of bucket (water tank) for
demonstration. This sensor module will read the distance between sensor module and water
surface, and it will show the distance on LCD screen with message “Water Space in Tank is:”.
It means we are here showing empty place of distance or volume for water instead of water
level. Because of this functionality we can use this system in any water tank. When empty water
level reaches at distance about 30 cm then Arduino turns ON the water pump by driving relay.
And now LCD will show “LOW Water Level” “Motor turned ON”, and Relay status LED will
start glowing

Now if the empty space reaches at distance about 12 cm arduino turns OFF the relay and LCD
will show “Tank is full” “Motor Turned OFF”. Buzzer also beep for some time and relay status
LED will turned OFF.

Code:
#include <LiquidCrystal.h>

#define trigger 10
#define echo 11
#define motor 8
#define buzzer 12

LiquidCrystal lcd(7,6,5,4,3,2);

float time=0,distance=0;
int temp=0;
void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
pinMode(motor, OUTPUT);
pinMode(buzzer, OUTPUT);
lcd.print(" Water Level ");
lcd.setCursor(0,1);
lcd.print(" Indicator ");
delay(2000);
}

void loop()
{
lcd.clear();
digitalWrite(trigger,LOW);
delayMicroseconds(2);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
lcd.clear();
lcd.print("Water Space In ");
lcd.setCursor(0,1);
lcd.print("Tank is: ");
lcd.print(distance);
lcd.print("Cm");
delay(2000);
if(distance<12 && temp==0)
{
digitalWrite(motor, LOW);
digitalWrite(buzzer, HIGH);
lcd.clear();
lcd.print("Water Tank Full ");
lcd.setCursor(0,1);
lcd.print("Motor Turned OFF");
delay(2000);
digitalWrite(buzzer, LOW);
delay(3000);
temp=1;
}

else if(distance<12 && temp==1)


{
digitalWrite(motor, LOW);
lcd.clear();
lcd.print("Water Tank Full ");
lcd.setCursor(0,1);
lcd.print("Motor Turned OFF");
delay(5000);
}

else if(distance>30)
{
digitalWrite(motor, HIGH);
lcd.clear();
lcd.print("LOW Water Level");
lcd.setCursor(0,1);
lcd.print("Motor Turned ON");
delay(5000);
temp=0;
}
}
 PLANT IRRIGATION SYSTEM:
This project is about a moisture-sensing automatic plant watering system using Arduino UNO.
The system reads the moisture content of the soil using soil moisture sensor and
switches ON the motor when the moisture is below the set limit. When the moisture level rises
above the set point, the system switches off the pump. The status of the tank, motor and the
moisture level will be displayed on a 16×2 LCD display.
Components:
1.Soil moisture sensor
2.Float switch
3.16x2 LCD Display
4.Arduino Uno Board
5.LM393
6.Resistors : 1K, 10K, 330Ohm
7.Two LEDs
8. BC547
9.12V Motor

CIRCUIT DIAGRAM AND WORKING:


The soil moisture sensor module used here have two output pins ( Digital output and Analog
output ). The output from the probe of the moisture sensor is compared with a reference value
using a lm393 comparator. The reference value can be changed by turning the potentiometer in
the module. Here we are using the analog output from the module by connecting it to one of the
analog pins of Arduino. While using the analog output the wet detection value can be
set/adjusted within the program itself.

As shown in the circuit diagram, a float switch is connected to one of the analog pins of Arduino
and a 1K Ohm resistor is used to pulled up the line. Analog pins of Arduino can also be used as
digital inputs. The status of the tank is identified by checking the output of the float switch.
Arduino reads the voltage dropped across the pull up resistor for sensing the level of water in the
tank. Two LEDs are connected to the 2nd and 3rd pin of Arduino to show the moisture status and
tank status respectively. And the 4th pin links to the base of a BC547 transistor which in turn
drives the 12 V DC motor.

A 16×2 LCD is connected with Arduino in 4-bit mode. JHD162A is the LCD module used
here. JHD162A is a 16×2 LCD module based on the HD44780 driver from Hitachi. The
JHD162A has 16 pins and can be operated in 4-bit mode (using only 4 data lines) or 8-bit mode
(using all 8 data lines). Here we are using the LCD module in 4-bit mode. Control pin RS, RW
and En are directly connected to arduino pin 13, GND and 12. And data pin D4-D7 is connected
to 11, 10, 9 and 8 of arduino.

The status of the float switch is compared to identify the current water level and according to
these both sensor status the controller will switch the motor to ON or OFF condition. If values
from the float switches is high and if the reading from the moisture sensor is low, then controller
will shows a full level tank status and a low level moisture status on LCD and switches the
motor to ON condition. This is done by giving a signal to the base of the BC547 transistor which
is connected to the 4th pin of the arduino UNO. The controller will also switch the moisture
status LED and the tank status LED OFF by writing a digital 0 to the 2nd and 3rd pin of
arduino. The motor will be in ON condition until the moisture content goes above reference
value or if the float switch status become low.

CODE;
#include<LiquidCrystal.h>
#define moisture_sensorPin A0
#define float_switchPin A1
#define motorPin 4
#define soil_statusPin 2
#define tank_statusPin 3
LiquidCrystal lcd(13,12,11,10,9,8);
const int avg_moisture = 800;
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" AUTOMATIC ");
lcd.setCursor(0,1);
lcd.print(" IRRIGATION S/M ");
delay(2000);
pinMode(moisture_sensorPin,INPUT);
pinMode(float_switchPin,INPUT);
pinMode(motorPin,OUTPUT);
pinMode(soil_statusPin,OUTPUT);
pinMode(tank_statusPin,OUTPUT);
digitalWrite(motorPin,LOW);
digitalWrite(soil_statusPin,LOW);
digitalWrite(tank_statusPin,LOW);
}
void loop()
{
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print(" MOISTURE - ");
if(analogRead(moisture_sensorPin) > avg_moisture)
{
lcd.print("HIGH");
digitalWrite(soil_statusPin,HIGH);}
if(analogRead(moisture_sensorPin) < avg_moisture){
lcd.print(" LOW");
digitalWrite(soil_statusPin,LOW);}
lcd.setCursor(0,1);
lcd.print("TANK LEVEL- ");
if( digitalRead(float_switchPin) == HIGH){
lcd.print("HIGH");
digitalWrite(tank_statusPin,LOW);}
if( digitalRead(float_switchPin) == LOW){
lcd.print(" LOW");
digitalWrite(tank_statusPin,HIGH);}
digitalWrite(motorPin,LOW);
if(analogRead(moisture_sensorPin) < avg_moisture && digitalRead(float_switchPin) ==
HIGH)
{
while(analogRead(moisture_sensorPin) < avg_moisture && digitalRead(float_switchPin) ==
HIGH)
{
lcd.setCursor(0,0);
lcd.print(" MOISTURE - LOW");
lcd.setCursor(0,1);
lcd.print(" MOTOR IS ON ");
digitalWrite(soil_statusPin,LOW);
digitalWrite(tank_statusPin,LOW);
digitalWrite(motorPin,HIGH);
}
if(analogRead(moisture_sensorPin) > avg_moisture){
lcd.setCursor(0,0);
lcd.print(" MOISTURE - HIGH");
lcd.setCursor(0,1);
lcd.print(" MOTOR - OFF ");
digitalWrite(soil_statusPin,HIGH);
digitalWrite(motorPin,LOW);
delay(3000);}
if(digitalRead(float_switchPin) == LOW){
lcd.setCursor(0,0);
lcd.print(" TANK LEVEL- LOW");
lcd.setCursor(0,1);
lcd.print(" MOTOR - OFF ");
digitalWrite(tank_statusPin,HIGH);
digitalWrite(motorPin,LOW);
delay(3000);}}

 AUTOMATIC CONTROL OF DEVICES IN A ROOM:


Over here, we have used a Bluetooth module and GSM module with the help of which we can
control the lights and fans as well as other devices with the help of an app in our phone and via
SMS as well. As we install this in our houses we simply need not worry about whether we have
carelessly left any of the electronic devices turned on. With the help of the app we can turn OFF
or ON the lights and fans. And with the help of GSM, a simple text message can make sure if
any other devices is working or not. Relays used here play the major role. A relay allows you to
turn on or turn off a circuit using voltage and/or current much higher than what Arduino could
handle. Relay provides complete isolation between the low-voltage circuit on Arduino side and
the high-voltage side controlling the load. It gets activated using 5V from Arduino, which, in
turn, controls electrical appliances like fans, lights and air-conditioners.

Components:

1. Arduino UNO
2. HC – 05 Bluetooth Module
3. 10 KΩ Resistor
4. 20 KΩ Resistor
5. 1 KΩ Resistor X 4
6. 2N2222 NPN Transistor X 4
7. 1N4007 Diode X 4
8. 12 V Relay X 4
9. Prototyping board (Bread board)
10. Connecting wires
11. 12 V Power supply
12. Smartphone or tablet (Bluetooth enabled)

CIRCUIT DIAGRAMS AND WORKING:

The Bluetooth module has 4 – pins: VCC, TX, RX and GND. VCC and GND are connected to
5V and ground from Arduino UNO. The Bluetooth module works on 3.3V and it has an on
board 5V to 3.3V regulator. The TX and RX pins of the Bluetooth module must be connected to
RX and TX pins of the Arduino. In Arduino UNO, we are defining pins 2 and 4 as RX and TX
using software. Hence, TX of Bluetooth is connected to pin 4 of Arduino. But when connecting
RX of Bluetooth to TX of Arduino (or any microcontroller as a matter of fact), we need to be
careful as the pin can tolerate only 3.3V. But the voltage from TX or Arduino will be 5V.So, a
voltage divider network consisting of 10K and 20K resistors are used to reduce the voltage to
3.3V approximately.

WORKING
The Bluetooth module HC05 that is connected to the Arduino acts as a Slave and so it can be
connected to a mobile phone. When it is connected to a mobile phone , The user can ON/OFF
the device by just clicking on the ON/OFF option in the app. This sends a signal to Bluetooth
module and it transmits it to the Arduino. Upon receiving the signal it controls the voltage
supplied to the respective relay. When it is commanded to turn on the relay, the 3.3V is send to
the relay and this makes the switch to be in closed position and thus the device starts working.
And if a signal is send to turn OFF the device, the voltage to the relay is cut off and so it stops
working.

Code:

#include <SoftwareSerial.h>

const int rxPin = 4;


const int txPin = 2;

SoftwareSerial mySerial(rxPin, txPin);

const int Loads[] = {9, 10, 11, 12};

int state = 0;
int flag = 0;

void setup()
{
for (int i=0;i<4;i++)
{
pinMode(Loads[i], OUTPUT);
}
mySerial.begin(9600);
for (int i=0;i<4;i++)
{
digitalWrite(Loads[i], LOW);
}

void loop()
{

if(mySerial.available() > 0)
{
state = mySerial.read();
flag=0;
}

switch(state)
{
case '0':digitalWrite(Loads[0], HIGH);
flag=1;
break;
case '1':digitalWrite(Loads[0], LOW);
flag=1;
break;
case '2':digitalWrite(Loads[1], HIGH);
flag=1;
break;
case '3':digitalWrite(Loads[1], LOW);
flag=1;
break;
case '4':digitalWrite(Loads[2], HIGH);
flag=1;
break;
case '5':digitalWrite(Loads[2], LOW);
flag=1;
break;
case '6':digitalWrite(Loads[3], HIGH);
flag=1;
break;
case '7':digitalWrite(Loads[3], LOW);
flag=1;
break;
case '8':digitalWrite(Loads[0], LOW);
digitalWrite(Loads[1], LOW);
digitalWrite(Loads[2], LOW);
digitalWrite(Loads[3], LOW);
flag=1;
break;
}
}

Disadvantage:

Since we have used Bluetooth module here, the range is limited to around 10m. This makes it
difficult to control the devices if we are far from our house.
So we modify the concept by using a GSM module which works when a SIM is placed in it.
This gives the range of the network provider.
Circuit Diagram:

When the user sends a text message to stop a particular device, the GSM module reads it and
works accordingly.
 SLIDING GATE CONTROL
The main aim of this project is to utilize a dead Sliding gate with a functioning AC motor
and automate the system using an Arduino and couple of relays. A camera is added as a
recognition element. The system creates a method of powering the gate's motor when
required and to decide whether to open or close the gate.

Components:

1. Arduino uno board


2. Bluetooth module
3. Relays
4. Cam assembly
5. Limiter switch

Circuit Diagram And Working:


The gate can be controlled in two way, either by Bluetooth (using mobile) or by detecting
vehicle number using cam assembly. The cam assembly basically detects the number of the car
of the user. The numbers are already saved in the system. If the detected number matches with
the saved number, the output of the Arduino goes high. This turns the motor on and opens the
gate. At the end of the gate, a limiter switch is placed using which the motor is turned off.
The same can be done via Bluetooth, which is similar to room automation. If the user wants to
open the gate while they’re inside the house, he can just open/close using an app. If it is turned
ON in the app, Arduino output goes high and the motor turns ON. The connection is via a relay.
CONCLUSION

As we have discussed, the purpose of home automation is to make our lives


easier and risk free. All of the above mentioned applications do play a major role
in our day to day lives. And by incorporating some of it into our mobile phones,
the control of our home appliances has become easier. In this report, the
program for each of the application and the connections have been mentioned.
REFERENCES:

 www.circuitstoday.com
 www.electronicshub.com
 www.circuitdigest.com
 create.arduino.cc/projecthub

Vous aimerez peut-être aussi