XXX -X-XXXX -XXXX -XXXXX.00 20XX IEEE Experimental stand for smart home optimization [623822]
XXX -X-XXXX -XXXX -X/XX/$XX.00 ©20XX IEEE Experimental stand for smart home optimization
Electronică Telecomunicații și
Tehnologia informației
Universitatea Tehnică din Cluj -Napoca
Cluj-Napoca,Romania
Automated systems are more and more pres ent in
recent years, in home -based applications, designed to
provide greater comfort within the living space. This paper
aims at making the hardware and software of a home
automation system using Wi -Fi technology. In order to
realized this paper, a model w hich is populated with several
categories of sensors, relays, actuators will be used, as well
as various modules such as the RTC module and the
ESP8266 module. The element who controls all actions of
the different componets on the model is Arduino Nano.
Also, a computer or laptop web page was created, faciliting
communication between the layout and the computer.
Smart home is a pragmatic solution, already present in
thousands of homes around the world. At the base of smart
houses are specialized equipment t hat can control the vast
majority of electronic and household appliances present in
homes. In principle all individual electrical and electronic
systems in the house are reunited in a single unit, which
makes it possible to centrally coordinate all functio ns, either
inside the home or remotely by mobile phone or internet.
These processes may include several aspects such as
centralized lighting control, HVAC systems (heating,
ventilation and air conditioning), home appliances, doors
and door closure systems to enhance comfort, energy
efficiency and safety of the house.
Smart houses made through wi -fi system can create a
series of scenarios when owners are left to keep your
curiosity at a distance. Among those scenarios they can
reduce energy consumption by c reating personalized
profiles that only use energy when needed, installing
surveillance cameras and using sensors such as temperature
sensors, humidity, gas detectors, water leakage or power
outages. Being covered by so many scenarios, the house is
always monitored even remotely.
The Wi -Fi modul used in this paper is ESP8266. This
is an integrated circuit used for wi -fi communications,
which communicate with other devices through the serial
UART protocol. The module is preprogrammed with AT
commands and has a high processing and storage capacity
so it can be integrated with various sensors and other
applications.
The modul has an autonomous operating system and a
stack of integrated TCP/IP protocols that can be easily
connected to the microcontroller or an A rduino development
board, to access any wi -fi network. The protocol is built on
802.11 standards. It transmits and receives radio waves in
the 2.4GHz frecquency band and can speed up from 11Mbps
to 140Mbps to the latest standards.
The Wi -Fi ESP8266 modul c an not connect directly to
your computer. To connect it requires a interfacing device
that can be a microcontroller or an Arduino development
board. The power supply voltage required for the correct operation is 3.3V and is supplied via the LM317 voltage
stabilizer.
Arduino is an open -source platform that produces both
microcontroller -based development boards and the software
component for their operation and programming. The
development board used for this application is Arduino
Nano.
Arduino Nano is a sm all, complete and friendly board,
based on Atmega328 microcontroller.
These boards provides the user with digital and analog
inputs/outputs, which can be interfaced with a wide range of
plates called shields and/or other circuits. Development
boards have serial communications interfaces, including
USB on some models, to load computer programs.
With a set of AT commands and the Arduino
development board, a web server will be created to monitor
temperature, humidity, and other processes. For the model
to wo rk, it has to be set in AP mode and the baudrate
frecquency to 9600. Then you get an IP address and
configure the module to work for multiple connections, as
well as configure it as a server on port 80 as shown below:
sendData("AT+CIOBAUD=9600 \r\n",2000, DEB
UG); // Reset module esp8266
esp8266.begin(9600); // Esp's baudrate might
be different
sendData("AT+CWMODE=2 \r\n",1000,DEBUG); //
Configure as access point
sendData("AT+CIFSR \r\n",1000,DEBUG); //
Get ip address
sendData("AT+CIPMUX=1 \r\n",10 00,DEBUG
);// Configure for multiple connections
sendData("AT+CIPSERVER=1,80 \r\n",1000,
DEBUG);// Turn on server on port 80
Figure 1. Configuring the module as a server on
port 80 and returning the IP
After creating the web server, a series of sens ors, actuators
and modules will be connected in order to control
temperature, humidity, lighting and other processes.
The temperature sensor chosen for this application
is the DS18B20 digital sensor, ideal for temperature
monitoring applications. This se nsor has a measuring range
of -55șC ÷ +125șC and an accuracy of ±0.5șC. To connect it
with the development board, this sensor uses the 1 -Wire
protocol, allowing multiple sensors to be cascaded on the
same communication line. Each device has a 64 -bit unique
serial code stored in the internal memory so multiple
DS18B20 devices can work on the same 1 -Wire bus.
Temperature conversion is done at high resolutions
ranging from 9 to 12 bits up to 750ms. The power supply
voltage is between 3V and 5.5V. The sensors are pre –
calibrated so use of additional circuits is not required. Small
output impedance, linear output and calibration makes it
very easy for interfacing the read and control of a circuit.
Having a very low consumption of just 60µA, it gets very
little he at, with less than 0.1șC.
To connect the temperature sensor to an Arduino
board, 3 wire connections and a 4K7 pull up electrical
resistance are required. The electrical resistance is
connected to the 1 -Wire bus between the data pin and the
VCC power pin.
Once the sensor has been connected, the output is
read out, and by the software implementation of a
command, the temperature value is returned to a web page
as shown in the figure below:
Figure 2 Display temperature value on a webpage and
temperature co mmand
Depending on the value of the temperature obtained, a
command will be implemented to operate the relays so that
if the temperature inside the house is low, a relay will be
actuated to start the electric heating plant. If the temperature
inside t he house is high, it will act on another relay that will
start a fan. These processes are possible by implementing
some comands in the software, which will then be used on
the web page where the temperature is returned.
Moisture sensor YL -69 detects the am ount of water in
the soil. The voltage at the sensor output varies, depending
on the amount of water in the soil. So, if the soil is wet the
output voltage drops and if the ground is dry the output
voltage increases.
The moisture sensor YL -69 consists of t wo parts,
namely the probe with the two measuring elements that are
inserted into the soil to detect the water content and the
electronic module communicating with the Arduino development board. On the electronic board is a sensitivity
adjustment potentiom eter, a led indicating the presence of
water in the ground and through which the digital output
switches from low to high or vice versa, a voltage
comparator LM393, which compares the voltage at the
output of the sensor with a voltage set by the user.
This module has both digital output and analog output.
In this paper, the analog output A0 will be used as it is more
accurate, obtaining intermediate values between 0 and
1023. Following the connection of the GND pins to the
ground, VCC to 5V and A0 to an a nalog Arduino input, the
value of the humidity can be read, and through the software
implementation of a command, this value will be displayed
on a web page, as can be seen in the following figure:
Figure 3. Display humidity value on a web page
and th e given command
Depending on the value returned, a command will be
used that will act on a relay, triggering the sprinklers. By
means of relay connected to the development board, to
which two leds of different colors will be connected , the
amount of wa ter in the soil will be sensed by setting a
threshold. By exceeding this threshold, the relay will
automatically operate and turn on the red led, indicating the
low amount of water in the soil and the need to start the
sprinkler. If this threshold is not e xceeded, the green led will
indicate the presence of water in the ground.
The HC -SR04 distance sensor is used to measure
distances between 2cm and 400cm, with a precision that can
reach 3mm, and an ultrasonic waveform generation angle of
15 degrees.
The r emote sensor needs 4 pins to work: VCC
connected to 5V, GND connected to the ground, Trig for the
emitted wavelength and Echo for the received wave.
The HC -SR04 distance sensor emits an ultrasonic wave
at a frequency of 40000Hz. When the sound meets an
obstacle, it returns and it is captured by the sensor receiving
module. The distance between the sensor and the detected
object is calculated by considering the time of the sound and
the speed of the sound.
To start measuring the distance, the Trig pin must
receive a high 5V pulse for at least 10µs, and then the
module will send out an 8 cycle burst of ultrasound at
40kHz and raise its echo. The Echo is a distance object that
its pulse width and the range are in proportion. It calculates
the range through the time interval between sending trigger
signal and receiving echo signal.
The time between the time of generation of the
ultrasonic signal and the time of receiving the echo by the
receiver is measured. Knowing the propagation velocity, the
distance can be c alculated:
,
where v is the sound propagation velocity, and T is the time
between ultrasound emission and echo reception.
Figure 4. Timming Diagram
Once the distance value has been determined, a function of
comparison be tween the value and a given value by the user,
will be implemented so that if the previous value is lower
than the given value, a servomotor will open and close a
door. If the distance is less or equal to the set
threshold, the actuator will wait a few sec onds after that the
door will automatically close.
A servomotor allows a precise control of position,
speed and acceleration. This angular position, speed and
acceleration control can not be done without a position
feedback sensor.
PWM signals are genera lly used to control the speed of
a DC motor. These motors allow speed control by changing
the supply voltage, but the speed changes non -linearly. In
order to control this linear velocity, the PWM signal control
method was used.
Changing the ratio between t he duration of the signal at
5V and the length of time the signal stays in 0V produces a
signal whose power changes in stages. This report will be
called filling factor. A DC motor to which a 100% fill factor
PWM signal has been applied will operate at ful l speed. If
the fill factor drops to 50%, the engine speed will also
change.
The servomotor has 3 wires: signal, power supply and
ground. The data wire transmits a position control signal to
the engine. The position control signal is a single pulse of
variable width. Pulse may vary from 1ms to 2ms. The pulse
width controls the shaft position.
The actuators waits to see a pulse every 20ms, and
depending on the pulse length, the position of the servo will
be determined. For a 1.5ms pulse, the servo reaches 90 ș, for
a 1ms pulse , it will reach 0ș, and for a 2ms pulse, the servo
will reach 180ș. The pulse width is sent to the servomotor
approximately 50 times per second(50Hz).
Figure 5. Control signal of servomotors
In this paper, a servomotor will automatic ally operate
when the HC -SR04 ultrasonic distance sensor detects an
obstacle at a predetermined distance and opens/closes the
door. The sensor sends an ultrasonic wave, waits until it
encounters an obstacle and returns, then sends a command
signal to the s ervomotor to open the door because someone
wants to enter. After actuating the servomotor, it stays for a
few seconds in stanbay, after that the door will be closed
without receiving another signal.
Another servomotor will be operated following a
control c ommand, implemented to control the garage door.
The door will open only when the servomotor receives a
command and remains open until the servomotor receives a
new door closing command.
For gas leakage monitoring, the MQ -7 sensor detects
the presence of c arbon monoxide at a concentration of 10 to
10000ppm.
The MQ -7 sensor module consists of 4 pins, two of
which are used for powering, and the other two are used to
make the communication between the sensor and the
development board.
The module is integrated with a sensitivity adjustment
potentiometer, a LM393 voltage comparator that compares
the voltage read from the sensor with a set voltage, a led
indicating the sensor supply, and a led indicating the gas
detection.
The sensors uses a small heater with an electrochemical
sensor inside. Sensitive material of MQ -7 gas sensor is
SnO2, which has a lower conductivity in clean air. It makes
detection by using the method of cycle high and low
temperature, and detect CO when low temperature(heating
by 1.5V). The se nsor’s conductivity is more higher along
with the gas concentration rising. When high
temperature(heated by 5.0V), it cleans the other gases
absorbed under low temperature.
The MQ -7 sensor has two outputs; An analog
output(A0) and a digital output(D0). A nalog output provides
an output voltage proportional to the amount of carbon
monoxide detected. The higher the amount of carbon
monoxide, the higher the analog voltage is. The lower the
amount of carbon monoxide, the analog voltage will be
lower. If the an alog voltage reaches a certain threshold, the
built-in led on the module will go into high state and set the
D0 pin to the high state.
When pin D0 is high, it will send a signal to the
development board. It receives this signal and sets the
buzzer connecte d to a high -development pins high,
indicating that the set carbon dioxide threshold is exceeded.
By using a photoresistance, the external lighting of the
house will be controlled. Photoresistance is a resistor made
of a semiconductor material whose resista nce changes under
incidence of incident light flux.
The electrical resistance of the photoresistor decreases
as the intensity of the light flux applied to the photoresist
sensitive surfaces. The current intensity increases in
proportion to the increase in luminous flux intensity.
In the absence of light, the photoresistance has a very
high resistance, and the light value of the photoresistor
decreases.
In this paper, an automatic lighting system for exterior
space is required, using a photoresist to measu re the level of
natural light and a series of leds that will change their light
intensity according to the level of natural light. As the level
of natural light decreases, the light intensity of the led’s
increases. Changing the led ’s light intensity is ac hieved by
using the PWM signal by modifying the fill factor.
The real -time clock module contains a integrated
circuit DS1307, the ideal circuit to automatically save and
increment the date, year, day and week in AM / PM format,
and the AT24C32 EEPROM me mory module is useful for
storing the date. This module can be used to store the time at
certain events occured. The supply voltage is between 4.4V
÷ 5.5V. If the power is interrupted, it switches to backup
power mode by consuming 500µA of the attached bat tery.
The module will take the date and time from the device
to which the development board is connected, and then a
function will be implemented, that will set an alarm to turn
on and off a led at defined user intervals to create different
scenarios where the owner is not at home. In fact, if the gas
sensor detects gas leakage through dwelling by accesing the
web page, the user can see if there were leaks. If there has
been leakage, the rtc mode returns the date and time on the
web page.
The processes desc ribed above are done by using
relays. The use of relays is required to control various
devices, operating at high voltages and currents up to 10A.
A relay is nothing more than a switch that consists a coil,
and three terminals: the common terminal to be co nnected to
the mains, the normally open terminal and the normally
closed terminal.
When the relay receives a signal from the development
board pin, it moves and it opens or closes the switch
contacts. These relays will control the boiler which will only
be switched on when the temperature inside the room is
low, the fan when the temperature is too high, the sprinklers
if the humidity in the ground is low, as well as other
processes.
The operation of relays connected to the development
board is possible by implementing some commands,
depending on the value of the parameters read from the
sensors and need of the user.
After realizing the hardware part of the project, you
will proceed to the realization of the software part.
The software part of this work is m ade in the form of a
mobile application in the Android Studio programming
environment.
The application contains several pages that are opened
by pressing buttons. These pages represent different activities implemented in Java programming language,
either g athering information or sending commands.
When you open the app, you’ll see a first page that will
take you to a menu with a list of facilities. This menu
contains a number of ON/OFF control butons, for gathering
informaton from various sensors or controll ing some
servomotors.
Depending on the desire and need of the user, one of
the buttons is selected. Following the action of the chosen
button, the characteristic components for identifying the
internal network for communication must be inserted.
Namely the IP and port that are in the form of text input
boxes, after which the function specific for each facility is
selected, to complete the order that you want to be sent.
After selecting the function, at the press of the button it
verifies if the IP and por t of the wi -fi module are correct,
after which it moves on the chosen function. If the
connection can not be made, an error message will be
received informing the user that the connection can not be
accomplished, and the user must re -enter the network
identifications. If the connection is good, it sends the
command for the desired function, after which the desired
response or information is received.
The above described application will be found in
another paper, where all the necessary commands and how
to do it and use it will be explained in more detail.
To avoid connection problems, we have chosen to
make a wiring, made with dedicated software. The electric
schematic and the layout of the wiring can be seen in
Annex1, respective Annex2. Because the mod ules and
sensors used a re powered at a voltage of 5V and due to the
high current consumption of the entire circuit, it is powered
by an external adjustable power supply. To avoid circuit
failure due to excessive voltage, a 5V voltage stabilizer is
used, which supports a maximmum current of 1A and the
connection mode can be seen in Annex3.
Copyright Notice
© Licențiada.org respectă drepturile de proprietate intelectuală și așteaptă ca toți utilizatorii să facă același lucru. Dacă consideri că un conținut de pe site încalcă drepturile tale de autor, te rugăm să trimiți o notificare DMCA.
Acest articol: XXX -X-XXXX -XXXX -XXXXX.00 20XX IEEE Experimental stand for smart home optimization [623822] (ID: 623822)
Dacă considerați că acest conținut vă încalcă drepturile de autor, vă rugăm să depuneți o cerere pe pagina noastră Copyright Takedown.
