Académique Documents
Professionnel Documents
Culture Documents
S COLLEGE OF ENGINEERING
Palakkad – 678008 , Kerala
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.
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.
ACKNOWLEDGEMENT
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
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 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:
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>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
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);}}
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)
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>
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:
www.circuitstoday.com
www.electronicshub.com
www.circuitdigest.com
create.arduino.cc/projecthub