Home Automation Using Arduino
Home Automation Using Arduino
Introduction:
Home Automation enables you to use your home's Lighting, Temperature and home appliances
more conveniently and efficiently. And, at the same time giving you greater levels of comfort
and security.
It can be as simple as remote or automatic control of a few lights, or it can be a complete system
that controls all major parts of your home.
Smart Home Technology is anything that gives you automatic control of things around the
home, turning it from "dumb" to smart.
Application Area:
Home automation refers to the capacity to use internet-connected equipment to operate
household appliances. It might involve pre-programming complicated heating and lighting
systems, as well as alarms and home security controls, all of which are connected via a central
hub and operated remotely via a smartphone app.
There are several applications for smart homes that are currently being used.
Some of them are mentioned below:
• Lighting.
• Safety Sensors.
• Security System.
• Temperature Control.
• Doors.
• Kitchen.
• Windows.
• Home Routines.
It refers to the ability to schedule the events beforehand so that the device learns to perform
certain activities at that particular time on a daily basis. For example, every night when you go
to sleep the lights are turned off on their own. It may also include rare incidents like turning the
lights on whenever the alarm is triggered.
Peripheral equipment (also called: input and output devices) connects a computer to other
things. It gives a computer system more features. Input is anything that goes in and output is
anything that goes out. Any device for the computer that the computer can work without is
peripheral equipment.
• Mouse
• Keyboard
• Printer
• Monitor
• Webcam
• Printer
• Scanner
• Speakers
• External Drive
• USB Flash Drive
Programming language:
C/C++
Working mechanism of Sensors:
Ultrasonic Sensor:
The HC-SR04 ultrasonic sensor uses SONAR to determine the distance of an object just like the
bats do. It offers excellent non-contact range detection with high accuracy and stable readings
in an easy-to-use package from 2 cm to 400 cm or 1” to 13 feet.
The operation is not affected by sunlight or black material, although acoustically, soft materials
like cloth can be difficult to detect. It comes complete with ultrasonic transmitter and receiver
module.
Temperature sensor:
The temperature sensor in Arduino converts the surrounding temperature to voltage. It further
converts the voltage to Celsius, Celsius to Fahrenheit, and prints the Fahrenheit temperature on
the LCD screen.
We will use a temperature sensor (TMP 36) of low voltage. Such sensors are also stable while
dealing with large capacitive loads. It is also suitable for automotive applications.
The temperature sensors TMP 35, TMP 36, and TMP 37 are the sensors with the same features.
The operating voltage of the TMP 36 sensor ranges from 2.7V to 5.5V.
PIR sensor :
PIR sensors allow you to sense motion. They are used to detect whether a human has moved in
or out of the sensor’s range. They are commonly found in appliances and gadgets used at home
or for businesses. They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR
motion" sensors.
• Small in size
• Wide lens range
• Easy to interface
• Inexpensive
• Low-power
• Easy to use
• Do not wear out
Connection with ICs:
A microprocessor is typically used with a number of peripheral integrated circuit (IC) devices
Input Output Interface provides a method for transferring information between internal storage
and external I/O devices. Peripherals connected to a computer need special communication
links for interfacing them with the central processing unit.
#include<Servo.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(A1,10,9,6,5,3);
setup()
Serial.begin(9600);
servo1.attach(servoPin);
lcd.begin(16, 2);
pinMode(2,INPUT);
pinMode(4,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
pinMode(A0,INPUT);
digitalWrite(2,LOW);
digitalWrite(11,HIGH);
digitalWrite(3,OUTPUT);
digitalWrite(7,OUTPUT);
digitalWrite(11,OUTPUT);
digitalWrite(13,OUTPUT);
//digitalWrite(A0,OUTPUT);
void loop()
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(pingPin, INPUT);
inches = microsecondsToInches(duration); cm
= microsecondsToCentimeters(duration);
servo1.write(0);
if(cm < 40)
servo1.write(90);
lcd.setCursor(0,1);
lcd.print("Door:OPEN");
else
servo1.write(0);
lcd.setCursor(0,1);
lcd.print("Door:CLOSED");
if(pir == HIGH)
digitalWrite(4,HIGH);
lcd.setCursor(10,0);
lcd.print("LED:ON");
//delay(5000);
}
else if(pir == LOW)
lcd.setCursor(12,0);
lcd.print("OFF");
digitalWrite(4,LOW);
value = analogRead(tmp)*0.004882814;
lcd.setCursor(0,0);
lcd.print("Tmp:");
lcd.print(value); delay(1000);
Serial.println("temperature");
Serial.println(value); if(value
> 20)
digitalWrite(12,HIGH);
digitalWrite(13,LOW);
else
digitalWrite(12,LOW);
digitalWrite(13,LOW);
}
lcd.clear();
{ return microseconds / 74 / 2;
{ return microseconds / 29 / 2;
Component List:
• Arduino Uno R3
• LCD 16*2
• PIR sensor
• DC Motor
• Temperature Sensor
[TMP36]
• Resistor
• Potentiometer
• LED
CONCLUSIONS:
Main purpose of home automation system is to provide ease to people to control different
home appliances with the help of the android application present in their mobile phones and to
save electricity, time and money.