0% found this document useful (0 votes)
11 views11 pages

iot ass 1

The document outlines a Smart Home Automation System using Arduino Uno R3 and various sensors for automating home appliances and enhancing security. It details the components required, circuit connections, and code implementation, highlighting the system's benefits in energy efficiency, safety, and convenience. Future enhancements include integration with voice assistants and mobile apps for remote monitoring.

Uploaded by

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

iot ass 1

The document outlines a Smart Home Automation System using Arduino Uno R3 and various sensors for automating home appliances and enhancing security. It details the components required, circuit connections, and code implementation, highlighting the system's benefits in energy efficiency, safety, and convenience. Future enhancements include integration with voice assistants and mobile apps for remote monitoring.

Uploaded by

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

21UCD602 – IOT DESIGN

ASSIGNMENT - 2
Submitted by

K.AISHWARYA (Reg.No:921722102005)

A.ABIRAMI (Reg.No:921722102003)

K.HARINI (Reg.No:921722102046)

S.DHIKSHA (Reg.No921722102037)

BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING

SETHU INSTITUTE OF TECHNOLOGY


(An Autonomous Institution|Accredited with‘A++’Grade by NAAC)
PULLOOR,KARIAPATTI-626115.

ANNA UNIVERSITY:CHENNAI 600025.


Smart Home Automation System

This Smart Home Automation System is built using an Arduino Uno R3 and multiple
sensors to automate home appliances and enhance security. The system includes a PIR
sensor for motion detection, an ultrasonic sensor for distance measurement, and a gas
sensor for detecting hazardous gases. A relay module is used to control electrical devices
like a bulb and a motor. The system displays real-time data on a 16×2 LCD display.

Step-by-Step Implementation

1. Components Required

 Arduino Uno R3 – The brain of the system, processes sensor data.


 16×2 LCD Display – Displays system status and sensor readings.
 Ultrasonic Distance Sensor (HC-SR04) – Measures distance to detect obstacles.
 PIR Sensor – Detects human movement.
 Gas Sensor – Detects harmful gases.
 Resistors – Used to limit current where necessary.
 Relay SPDT (Single Pole Double Throw) – Controls electrical appliances.
 Bulb – Represents a light source in the smart home.
 DC Motor – Represents a fan or any motor-based appliance.
 Slide Switch – Used to turn the system ON/OFF.
 Power Supply – USB or external 9V battery.
 Connecting Wires – Used for circuit connections.

2. Circuit Connections

1. Power Connections
o Connect the VCC of sensors and LCD to 5V on Arduino.
o Connect the GND of all components to GND on Arduino.
2. LCD Display (16×2)
o Connect RS, E, D4-D7 to Arduino digital pins.
o Connect VSS, RW, K to GND.
o Connect VDD, A to 5V.
o Use a potentiometer to adjust contrast.

3. Ultrasonic Sensor (HC-SR04)


o VCC → 5V
o GND → GND
o Trig → Digital Pin (e.g., 9)
o Echo → Digital Pin (e.g., 10)

4. PIR Sensor
o VCC → 5V
o GND → GND
o OUT → Digital Pin (e.g., 7)

5. Gas Sensor
o VCC → 5V
o GND → GND
o A0/D0 → Analog/Digital Pin (e.g., A0)

6. Relay Module
o VCC → 5V
o GND → GND
o IN → Digital Pin (e.g., 6)
o Common (C) → Bulb One Terminal
o Normally Open (NO) → Power Supply Live Wire
o Other Bulb Terminal → Power Supply Neutral Wire

7. DC Motor
o Controlled using relay or motor driver module.

8. Slide Switch
o Used to turn the system ON/OFF.

Code :

// include the library code:


#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//For ultrasound sensor


int distanceThreshold = 0;
int cm = 0;
int inches = 0;

//for Relay Control


int releNO = 13;
int inputPir = 8;
int val = 0;
int resuldoSensorLDR;
int sensorLDR = A0;

//For Gas sensor


int const PINO_SGAS = A1;
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);
// Reads the echo pin, and returns the sound wave travel time in microseconds
return pulseIn(echoPin, HIGH);
}

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);

pinMode(releNO, OUTPUT);
pinMode(inputPir, INPUT);
pinMode(sensorLDR, INPUT);
Serial.begin(9600);
}

void loop() {
// set threshold distance to activate LEDs
distanceThreshold = 350;
// measure the ping time in cm
cm = 0.01723 * readUltrasonicDistance(7, 6);
// convert to inches by dividing by 2.54
inches = (cm / 2.54);

lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will
be displayed
lcd.print("D:"); // Prints string "Distance" on the LCD
lcd.print(cm); // Prints the distance value from the sensor
lcd.print("cm");
delay(10);

val = digitalRead(inputPir);
resuldoSensorLDR = analogRead(sensorLDR);
if(resuldoSensorLDR<600)
{
if(val == HIGH)
{
digitalWrite(releNO, HIGH);
lcd.setCursor(0,1);
lcd.print("L: On ");
delay(5000);
}
else{
digitalWrite(releNO, LOW);lcd.setCursor(0,1);
lcd.print("L: Off");
delay(300);
}
}
else{ digitalWrite (releNO, LOW);
Serial.println(resuldoSensorLDR);
delay(500);
}

int color = analogRead(PINO_SGAS);


lcd.setCursor(8,0);
//lcd.print("");
if(color <= 85){
lcd.print("G:Low ");
} else if(color <= 120){
lcd.print("G:Med ");
} else if(color <= 200){
lcd.print("G:High");
} else if(color <= 300){
lcd.print("G:Ext ");
}

delay(250);
}
Output ;
Usefulness of Smart Home Automation System in Society

This Smart Home Automation System has various benefits that contribute to safety,
energy efficiency, and convenience in daily life. Here’s how it helps society:

1. Energy Efficiency & Cost Savings

 Automatic Light Control: The PIR sensor detects human movement and turns
on/off lights, reducing electricity wastage.
 Smart Fan/Motor Control: The ultrasonic sensor can detect room occupancy and
adjust fan/motor operation, saving power.

2. Home Security & Safety

 Motion Detection: The PIR sensor can act as an intruder detection system,
triggering alarms or sending notifications.
 Gas Leak Detection: The gas sensor detects harmful gases (e.g., LPG, CO) and
prevents accidents by alerting homeowners.

3. Automation & Convenience

 Remote & Smart Control: The system can be expanded to work with IoT,
allowing users to control appliances via a smartphone.
 LCD Display for Alerts: Real-time updates on temperature, gas leaks, and motion
detection help users stay informed.

4. Helps Elderly & Disabled People

 Hands-Free Operation: Elderly or disabled individuals can benefit from


automation as it reduces the need for manual switching of lights and fans.
 Enhanced Safety: Automated gas leak detection ensures safety for individuals who
might forget to check manually.

5. Disaster Prevention

 Early Gas Leak Alerts: This system can prevent fire hazards caused by gas leaks.
 Smart Power Control: Automatically turns off appliances when no one is
present, preventing electrical hazards.

Future Scope

 Can be integrated with voice assistants (Alexa, Google Assistant).


 Can be connected to mobile apps for remote monitoring.
 Can be expanded to include fire detection, smart door locks, and water leak
sensors.

You might also like