Vous êtes sur la page 1sur 28

Guillermo

Alberto Prez Guillen












Automation Home























INDEX









1. Introduction
2. Schematic Diagram
3. Electric Diagram
4. Hardware
5. Software
6. Photographs
7. Links





This work is authors property, and has been registered on the Website
http://www.safecreative.com with the registration code 1607058305393 and protected
under the License Creative Commons Attribution-NonCommercial-NoDerivatives 4.0










1. INTRODUCTION

HISTORY

Early home automation began with labor-saving machines. Self-contained electric or gas
powered home appliances became viable in the 1900s with the introduction of electric
power distribution and led to the introduction of washing machines (1904), water heaters
(1889), refrigerators, sewing machines, dishwashers, and clothes dryers.

In 1975, the first general purpose home automation network technology, X10, was
developed. It is a communication protocol for electronic devices. It primarily uses electric
power transmission wiring for signalling and control, where the signals involve brief radio
frequency bursts of digital data, and remains the most widely available. By 1978, X10
products included a 16 channel command console, a lamp module, and an appliance
module.

According to Li et. al. (2016) there are three generations of home automation: 1) First
generation: wireless technology with proxy server; 2) Second generation: artificial
intelligence controls electrical devices; 3) Third generation: robot buddy who interacts
with humans.

BENEFITS OF SMART HOMES

The benefits of the smart home are by no means limited to convenience, although this is a
compelling feature. The automation of simple tasks saves us time time that could be
spent on our families, our careers, or other passions, which is a strong selling proposition.
Smart homes also have the potential to be greener and cheaper: water and energy-
monitoring tools, and programs to optimize energy consumption, could impel us to lower
our water and energy usage, which could, in turn, lower our bills and reduce our carbon
footprint.

Automation and centralized control have serious benefits for family caregivers. By
integrating home healthcare equipment, such as monitoring and diagnostic tools, smart
homes could simplify the caregiving process for the hundreds of millions of adults
worldwide who care for an elderly, ailing, or infirm parent or relative. For example, a
smart home might allow you to monitor the movements of a relative suffering from
dementia













PROJECT

Design a Home Automation and using Arduino UNO and App Inventor.

This project serves to control lamps or bulbs and other electrical or electronic devices
proposed.

Goals:

1. The homes lamp or light bulb is activated with a switch of the App.
2. The bedrooms lamp or light bulb is activated with a switch of the App.
3. The bathrooms lamp or light bulb is activated with a switch of the App.
4. The kitchens lamp or light bulb is activated with a switch of the App.
5. The doors lock is controlled with a switch of the App and using a servo.
6. A fan activated with a switch of the App.
7. An alarm system is activated with a switch of the App and using a PIR
motion sensor and a buzzer.
8. A light detection system is activated with a switch of the App and using a
LDR sensor and 3 leds that can illuminate outdoors at night.
9. A humidity and temperature system and using a DHT11 sensor and print the
values on the notifier of the App.
10. A gas detection system and using a MQ2 sensor when theres a gas leak
the kitchens lamp or light bulb is triggered and print a message on the App.
11. A voice-activated system and using speech recognizer and the microphone of
the hads free and the cellular network or the wifi network.
























2. SCHEMATIC DIAGRAM



3. ELECTRIC DIAGRAMA

4

4. HARDWARE

The components used are as follows:


Arduino UNO
Bluetooth HC-05
DHT11 Sensor
MQ2 Sensor
PIR Motion Sensor
LDR Sensor
Servo
Buzzer
Fan
Relay 5V
Transistor NPN
Resistances: 220, 330, 570, 1K, 10K, 100K
LEDs
Battery: 5 V, 3.3 V and 9V





The schematic diagram and electrical diagram show me the physical and wireless
connections to build this project.
Arduino UNO is connected via wired to the devices: DHT11, MQ2, PIR, Buzzer, Fan,
Servo, LDR, LED and HC-05.
Arduino UNO board can communicates with the Smart Lights Smartphone application
via wireless and using the Bluetooth HC-05.
The Smart Lights Smartphone application communicates with the voice recognition
system of Google via wireless through the wireless network or telephone network data.
You can see the list of parts used in this project in the section Things.
In the video where I show you my work you can see the tests with the hardware devices as
switch on or turn off the four LEDS, door, fan, alarm and light detection system. It also
shows me the values measured as humidity and temperature and gas leak alarms and
flashing lamp.







5. SOFTWARE

1. Arduino program



This program is developed with Arduino and is named Smart_Lights.ino, the program
contains the comments of its operation and is registered in Safe Creative.














The operation of the Software, I divided into three parts:
1. Use of switches in the Smart Lights Smartphone application to control the following systems: light bulbs,
door, fan, alarm and light detection.
2. Using voice commands to control the same devices shows in the part one.
3. Using the Arduino UNO board to control the DHT11 and the MQ2 sensors and sending data to the Smart
Lights Smartphone application via Bluetooth.


This code is authors property, and has been registered on the Website
http://www.safecreative.com with the registration code 1607058305409 and protected
under the License Creative Commons Attribution-NonCommercial-NoDerivatives 4.0


You can get the link of source code on the chapter 7.





















Arduino UNO - Smart Lights
// AUTOMATION HOME
//Author Guillermo Alberto Perez Guillen

#include <Servo.h>
#include DHT.h
#define DHTPIN 2 // DHT11 pin
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

Servo servomotor; // Name of servo
int pos = 5;
//Hall, Bedroom, Bathroom, Kitchen, Ventilator and Alarm pins
int ledPin1= 13, ledPin2= 12, ledPin3= 11, ledPin4= 10, ledPin6= 8, ledPin7= 7;
const int ledPin8 = 6; // LDR pin
const int analogInPin = A0; // Analog input pin that the MQ-2 is connected
int sensorValue = 0; // value read from the sensor

void setup() {
Serial.begin(9600); // initialize serial communication:
dht.begin();
pinMode(ledPin1, OUTPUT); // Sets the digital pins as output
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
servomotor.attach(9); // Set the pin 9 as servo
servomotor.write(pos);
delay(5);
}

void loop() {
int h = dht.readHumidity(); // Save DHT11 humidity
int t = dht.readTemperature(); // Save DHT11 temperature

sensorValue = analogRead(analogInPin); // MQ-2 sensor reading
if (sensorValue >= 500)
{
Serial.println( GAS LEAK );
digitalWrite(ledPin4, HIGH); // Kitchen On
delay(200);
digitalWrite(ledPin4, LOW); // Kitchen Off
}
delay(5);

if (isnan(t) || isnan(h))
{
Serial.println(Error in the DHT sensor); //Message of error if there arent numbers
} else {
delay(5);
Serial.print( Humidity= ); // Humidity printing
Serial.print(h);
Serial.println( %\t);
Serial.print( Temperature= ); // Temperature printing
Serial.print(t);
Serial.println( *C);
}

if (Serial.available() > 0) {
int inByte = Serial.read();
switch (inByte) {
case a: // Hall On
digitalWrite(ledPin1, HIGH);
break;
case b: // Hall Off
digitalWrite(ledPin1, LOW);
break;
case c: // Bedroom On
digitalWrite(ledPin2, HIGH);
break;
case d: // Bedroom Off
digitalWrite(ledPin2, LOW);
break;
case e: // Bathroom On
digitalWrite(ledPin3, HIGH);
break;
case f: // Bathroom Off
digitalWrite(ledPin3, LOW);
break;
case g: // Kitchen On
digitalWrite(ledPin4, HIGH);
break;
case h: // Kitchen Off
digitalWrite(ledPin4, LOW);
break;
case i: // Door Open
for(pos = 5; pos < 180; pos += 5)
{
servomotor.write(pos);
delay(10);
}
break;
case j: // Door Close
for(pos = 180; pos>=5; pos-=5)
{
servomotor.write(pos);
delay(5);
}
break;
case k: // Ventilator On
digitalWrite(ledPin6, HIGH);
break;
case l: // Ventilator Off
digitalWrite(ledPin6, LOW);
break;
case m: // Alarm On
digitalWrite(ledPin7, HIGH);
break;
case n: // Alarm Off
digitalWrite(ledPin7, LOW);
break;
case o: // LDR On
digitalWrite(ledPin8, HIGH);
break;
case p: // LDR Off
digitalWrite(ledPin8, LOW);
break;
default: // Turn all the LEDs off
for (int thisPin = 2; thisPin < 7; thisPin++) {
digitalWrite(thisPin, LOW);
}
delay(200);
}
}
}























2. App Inventor 2 Application


This application is for a cell and is developed with App Inventor 2 and is called Smart
Lights and the files that compose it are: Smart_Lights.aia and Smart_Lights.apk and
are registered in Safe Creative.












This code is authors property, and has been registered on the Website
http://www.safecreative.com with the registration code 1607058305386 and protected
under the License Creative Commons Attribution-NonCommercial-NoDerivatives 4.0



You can get the link of source code on the chapter 7.

Button connect



























Button Light example.














Button Spech Recognizer


















6. PHOTOGRAPHS

The following photos show a test.



This is the first version of my project and Im pleased because I achieve my goals. It was
not so easy to do it because there are several pressures, mainly get the necessary material
and have the knowledge and enough time.
As designer, this project leaves me good and interesting experiences such as:
1.- Voice-activated system depends on: a) The pronunciation of voice must be loud and clear, b) To reduce
external noise, c) The signal quality of the wireless telephone network must be good, and d) We must use
keywords to reduce errors, for example I used door open instead open the door
2.- Dont overload the Batteries, for example Arduino UNO only can give us 500 mA of current.
3.- Avoid doing complex program code because the microcontroller only has 8 bits and 20 MHz clock,
otherwise the program would collapse or blocked.






7. LINKS

The video of this project is on Youtube at the following link:


https://youtu.be/f5N7nfMm8X4

This video shows us:


The objectives

The hardware used in this project.
The software used to program the Arduino UNO.
The software used to develop the application of the Smartphone, in this case I use
App Inventor 2.
Tests performed with switches and voice-activated system.


The Tutorial project is located at the following link:

http://hubpages.com/technology/Automation-Home-With-Arduino-UNO

Arduino UNO Source code:

https://drive.google.com/file/d/0B8XMvcdJvBBYU0xUejEtRnkyN00/view?
usp=sharing

App Inventor 2 Source code:



https://drive.google.com/file/d/0B8XMvcdJvBBYcXhiT2padFBtdlE/view?
usp=sharing

Image of App Inventor 2 Source code:


https://drive.google.com/file/d/0B8XMvcdJvBBYaU5mcjBsTExidHc/view?
usp=sharing

Vous aimerez peut-être aussi