0% found this document useful (0 votes)
7 views24 pages

UNIT V - Applications

Uploaded by

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

UNIT V - Applications

Uploaded by

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

U21EEX04

HOME AUTOMATION

UNIT - V

APPLICATIONS

Nov 19, 2024 1


U21EEX04 - HOME AUTOMATION

UNIT V – APPLICATIONS

Interfacing of sensors with controller - Fire alarm system - Gas leakage detection system - Burglar alarm
system-Arduino Uno and Node MCU: Lamp, motion and temperature control using Bluetooth and WIFI

DR.C.PAZHANIMUTHU
ASSISTANT PROFESSOR (SL.G)/EEE
KPR INSTITUTE OF ENGINEERING AND TECHNOLOGY
COIMBATORE

Nov 19, 2024 2


U21EEX04 - HOME AUTOMATION
UNIT V – APPLICATIONS
Interfacing of sensors with controller - Fire alarm system - Gas
leakage detection system - Burglar alarm system-Arduino Uno and
Node MCU: Lamp, motion and temperature control using Bluetooth
and WIFI

Nov 19, 2024 3


APPLICATIONS
 Home automation has been projected to target wide array applications for the new digital consumer.
Some of the areas where consumers can expect to see home automation led IoT-enabled connectivity
are:
 Lighting control
 HVAC
 Lawn/Gardening management
 Improved home safety and security
 Home air quality and water quality monitoring
 Natural Language-based voice assistants
 Better infotainment delivery
 AI-driven digital experiences
 Smart switches and smart locks
 Smart energy meters

Nov 19, 2024 4


FIRE ALARM SYSTEMS
 A fire alarm system is a collection of many separate parts, each with their own unique function.
 The following are the five key elements that make up every fire alarm system:
 Initiating Devices: initiating devices are the part of the alarm system which detects smoke or a fire.
These devices include smoke detectors of various kinds, heat detectors of various kinds, sprinkler
water flow sensors, and pull stations.
 Indicating Appliances: indicating appliances are the part of the system that sounds the alarm and
alerts occupants to the fire hazard.
 Fire Alarm Panel: the fire alarm control panel is the user interface and central monitoring and
controlling element of the system. It has a display revealing the current state (alarm or no alarm) of
the fire alarm system and a touch pad, which allows onsite personnel to program, troubleshoot,
silence, and reset the system.
 Power Supplies: Power supplies cover main power from the breaker, (2) 12V batteries as backup for
24 hours, and sometimes a generator as backup power for many fire alarm systems.
 Auxiliary Devices: Additional devices include things like visual LED indicators showing which zone
in a building a fire alarm was initiated, remote annunciators, alarm silence switches, electromagnetic
door holders, fire doors, elevator capture and shutdown, etc.
Nov 19, 2024 5
FIRE ALARM SYSTEMS
 The role of a fire alarm system is to detect fires and alert both building occupants and emergency
personnel from a centrally monitored and controlled location.
 Build fire alarm or fireplace detector the use of Flame sensor and Arduino board. The sensor mainly
detects IR (Infra purple) light wavelength between 760 nm – 1100 nm (nanometer) that emitted
from fire flame.
 Flame Sensor
 The flame sensor is used to detect the fire, it has 3 pins (Ground, VCC, OUTPUT) with operational
voltages ranging from 3.3V to 5V.
 This sensor may be constructed using an electrical circuit and a receiver similar to that used for
electromagnetic radiation.
 This sensor employs the infrared flame flash technology, which enables it to operate through a layer
of oil, dust, water vapor etc.
 Normally flame sensors have an operating temperature ranging from -25℃ ~ 85℃ with several
features like adjustable sensitivity, fast response time and ease to use.

Nov 19, 2024 6


FIRE ALARM SYSTEMS
 MQ2 Gas Sensors
 MQ2 gas sensors detect the presence of gases such as LPG, methane, ethanol and carbon monoxide in
the air ranging up to 10000 ppm using electricity.
 It is also known as chemiresistor for the MQ2 gas sensor.
 The resistance of the sensing material changes depending on the amount of gas present.
 Components Required
 Arduino UNO
 MQ-2 gas sensor
 Buzzer
 Jumper wires
 USB cable for uploading the code

Nov 19, 2024 7


FIRE ALARM SYSTEMS
Arduino Coding for Fire Alarm using Flame Sensor
int Buzzer = 13; // Use buzzer for alert
int FlamePin = 2; // This is for input pin
int Flame = HIGH; // HIGH when FLAME Exposed
void setup() {
pinMode(Buzzer, OUTPUT);
pinMode(FlamePin, INPUT);
Serial.begin(9600);
}
void loop() {
Flame = digitalRead(FlamePin);
if (Flame== HIGH)
{
Serial.println("HIGH FLAME");
digitalWrite(Buzzer, HIGH);
}
else
{
Serial.println("No flame");
digitalWrite(Buzzer, LOW);
}
}

Nov 19, 2024 8


BASIC ARDUINO SOFTWARE
 Arduino API
 Sketch − The first new terminology is the Arduino program called “sketch”.
 Arduino programs can be divided in three main parts: Structure, Values (variables and constants),
and Functions.
 The Arduino API can be divided into three main parts: functions, variables and structure:
 Functions: for controlling the Arduino board and performing computations. For example, to read or
write a state to a digital pin, map a value or use serial communication.
 Variables: the Arduino constants, data types and conversions. E.g. int, boolean, array.
 Structure: the elements of the Arduino (C++) code such as sketch (loop(), setup()), control structure
(if, else, while, for), arithmetic operators (multiplication, addition, subtraction), comparison
operators such as == (equal to), != (not equal to), > (greater than).
 The Arduino API can be described as a simplification of the C++ programming language, with a lot
of additions for controlling the Arduino hardware.

Nov 19, 2024 9


BURGLAR ALARM SYSTEMS
 Security systems are widely suggested for homes as well as other locations.
 Everybody wants to take necessary steps to prevent infiltration at home, thus this security is
necessary.
 Intruders nowadays may take advantage of almost any illegal activity and wreak havoc on a
property’s security.
 The security of one’s home is a critical concern that everyone faces in the current day.
 Many devices regarding smart home security systems are available in the market but these are not
user friendly according to the budget, the device we designed provides the user with a better
interface with the help of LCD.
 We have used enough sensors that make sure the security protocol.

Nov 19, 2024 10


BURGLAR ALARM SYSTEMS

Nov 19, 2024 11


BURGLAR ALARM SYSTEMS
 PIR sensor detects motion by sensing the difference in infrared or radiant heat levels emitted by
surrounding objects.
 The output of the PIR sensor goes high when it detects any motion. The range of a typical PIR sensor
is around 6 meters or about 30 feet.
 For proper operation of PIR sensor, it requires a warm up time of 20 to 60 seconds. This is required
because, the PIR sensor has a settling time during which it calibrates its sensor according to the
environment and stabilizes the infrared detector.
 During this time, there should be very little to no motion in front of the sensor. If the sensor is not
given enough calibrating time, the output of the PIR sensor may not be reliable.
 When the PIR sensor detects any motion, the output of the sensor is high. This is detected by the
Arduino.
 PIR sensors is that the output will be high when it detects motion. The output of the sensor goes low
from time to time, even when there is motion which may mislead the microcontroller into
considering that there is no motion.

Nov 19, 2024 12


BURGLAR ALARM SYSTEMS
 Components Required
 Arduino UNO
 9V Battery
 10K ohms resistor
 Red LED
 PIR and LDR sensor
 Buzzer
 Jumper wires and a breadboard
 USB cable for uploading the code

Nov 19, 2024 13


BURGLAR ALARM SYSTEMS
Arduino Coding using GSM
int LED=12; void loop()
{
int pirOutput=5; if(digitalRead(pirOutput)==HIGH)
void setup() {
digitalWrite(LED2,HIGH);
{ Serial.println("OK");
Serial.begin(9600); delay(1000);
Serial.println("ATD+91xxxxxxxxxx;");
pinMode(LED,OUTPUT);
//add target mobile number in place of
pinMode(pirOutput, INPUT); xxxxxxxxxx
digitalWrite(pirOutput, LOW); delay(15000);
Serial.println("ATH");
digitalWrite(LED, LOW); digitalWrite(LED2,LOW);
delay(15000); delay(1000);
}
digitalWrite(LED, HIGH);
}
}

Nov 19, 2024 14


GAS LEAKAGE DETECTION SYSTEM
 For sensing the flammable gases we are using an MQ-6 gas sensor.
 When the LPG gas is detected by the MQ-6 gas sensor in LPG Gas leakage detector using arduino then
the green LED will go on otherwise red LED will glow.
 A 16×2 LCD module is used to see the real time status of the working of the gas sensor in this LCD
screen.
 Components Required
 Arduino UNO
 MQ-6 gas sensor
 16×2 LCD module
 10K potentiometer
 Red and green LEDs
 220 ohms resistors
 Jumper wires and a breadboard
 USB cable for uploading the code
Nov 19, 2024 15
GAS LEAKAGE DETECTION SYSTEM
 LPG (liquid petroleum gas) used in kitchen gas cylinders is a mixture of propane and butane in
diverse compositions. Even though LPG is essential for use in kitchens and the public is usually alert
while using it, but still some steps need to be introduced for safety.
 LPG used in cylinders (propane or butane) is highly combustible and a danger whenever it leaks from
faulty equipment such as gas regulators, gas pipes/tubes, and other components of LPG
gadgets/devices. The gas tube that fetches gas from the cylinder to the burner is generally the first to
malfunction as it experiences the most damage/erosion at its joints.
 Blockages in the burner or defective regulators can also cause gas leaks. LPG is highly combustible
when mixed with air. When gas leaks inside a confined space such as a house/kitchen, an explosion
may occur if there is a source of ignition. Therefore, gas leakage is very dangerous.

Nov 19, 2024 16


GAS LEAKAGE DETECTION SYSTEM
 Components Required

Automatic LPG Gas Leakage Detection System – Parts List


Components Quantity
Arduino Uno (MOD1) 1
12V, 2A adaptor 1
SIM900A GSM module (MOD2) 1
IC ULN2003 (IC1) 1
5V relay (R1) 1
Buzzer (B1) 1
MQ6 or MQ2 sensor (S2) 1
MG996R high torque servo motor
1
(S1)
Breadboard 1

Nov 19, 2024 17


GAS LEAKAGE DETECTION SYSTEM
 Circuit Diagram

LPG Gas Leakage Detection Working

Nov 19, 2024 18


GAS LEAKAGE DETECTION SYSTEM
 Interfacing
 First, connect the MQ-6 gas sensor with the Arduino.
 Join the VCC pin of the gas sensor with the 5 volts pin of the Arduino.
 Then attach the GND pin of the gas sensor with the GND pin of the Arduino.
 Connect the OUT/A0 pin of the MQ-6 gas sensor with the analog-0 pin of the Arduino.
 Now make the connections between the 16×2 LCD and the digital pins of the Arduino as shown in the
diagram.
 After that connect the positive leg of the green LED with the digital- pin of the Arduino.
 Join the positive leg of the red LED with the digital- pin of the Arduino.
 At last, connect the negative legs of both the LEDs with the GND pin of the Arduino via a 220 ohm
resistor.
 Using a resistor to protects LEDs from getting fuse.

Nov 19, 2024 19


GAS LEAKAGE DETECTION SYSTEM
 Interfacing
void loop()
#include "LiquidCrystal.h"
{
LiquidCrystal lcd(9,8,7,6,5,4);
GAS_VAL = analogRead(A0);
int GAS_VAL = 0;
Serial.println(GAS_VAL);
void setup()
if (GAS_VAL > 500)
{
{
pinMode(A0, INPUT); // MQ-6 A0 Pin
lcd.setCursor(0,1);
Serial.begin(9600);
lcd.print(" LPG Detected ");
lcd.begin(16,2);
digitalWrite(11,HIGH);
pinMode(11,OUTPUT); // LED Green
digitalWrite(12,LOW);
pinMode(12,OUTPUT); // LED Red
}
lcd.setCursor(0,0);
else
lcd.print(" GAS SENSOR ");
{
}
lcd.setCursor(0,1);
lcd.print("LPG Not Detected ");
digitalWrite(11,LOW);
digitalWrite(12,HIGH);
}

delay(10);
}

Nov 19, 2024 20


CONTROL LAMP USING ARDUINO AND BLUETOOTH
 The Android app sends the serial data to the connected Bluetooth Module HC-05 by clicking ON
button. The Bluetooth device receives the data from the app and sends it through TX pin of Bluetooth
module to RX pin of Arduino. The Arduino device read the input data and process it according to
program uploaded inside it and generate the output to 4 Chanel Relay Module.
 When the Bluetooth application's button turns ON, it sets the home light ON, and when the Bluetooth
application's button turns OFF, it sets the home light OFF.

 Main components: Android smartphone Bluetooth application, Bluetooth transceiver, Arduino


device, and 4 Channel Relay module.

Nov 19, 2024 21


CONTROL LAMP USING ARDUINO AND BLUETOOTH
Arduino Coding
int lampPin = 2;
void setup() {
Serial.begin(9600);
pinMode(lampPin, OUTPUT);
}

void loop() {
int command;
if (Bluetooth.available()) {
command = Bluetooth.read();
Serial.println("Input received:");
if (command != 0)
{
// A non-zero input will turn on the LED
Serial.println("LED ON");
digitalWrite(led, HIGH);
}
else
{
// A zero value input will turn off the LED
Serial.println("LED OFF");
digitalWrite(led, LOW);
}
}
}
Nov 19, 2024 22
CONTROL LAMP USING ARDUINO AND BLUETOOTH

Nov 19, 2024 23


CONTROL LAMP USING ARDUINO AND BLUETOOTH
char Incoming_value = 0; //Variable for storing Incoming_value
void setup()
{
Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial data transmission
for(int i=8; i<12; i++){
pinMode(i, OUTPUT); //Sets digital pin as output pin
digitalWrite(i, HIGH);
} else if(Incoming_value == '7')
} digitalWrite(11, LOW);
void loop() else if(Incoming_value == '8')
{ digitalWrite(11, HIGH);
if (Serial.available() > 0) }
{ if(Incoming_value == 'a')
Incoming_value = Serial.read(); for(int i=8; i<12; i++){
if(Incoming_value == '1') digitalWrite(i, LOW);
digitalWrite(8, LOW); }
else if(Incoming_value == '2') else if(Incoming_value == 'b'){
digitalWrite(8, HIGH); for(int i=8; i<12; i++){
else if(Incoming_value == '3') digitalWrite(i, HIGH );
digitalWrite(9, LOW); }
else if(Incoming_value == '4') }
digitalWrite(9, HIGH); }
else if(Incoming_value == '5')
digitalWrite(10, LOW);
else if(Incoming_value == '6')
digitalWrite(10, HIGH);
Nov 19, 2024 24

You might also like