You are on page 1of 8

Project: SmartHome with Esp8266

Actual Stage:
In the last years, technology has become widely accessible. Many companies and startups, even
with limited resources, were able to implement SmartHome Systems.

A SmartHome System can be classified by its functions:

1) Heating/ Ventilation/ Air Conditioning


2) Safety functions
3) Multimedia

Many products choose not to focus on all the functions at once, but choose only a few.

So, there are many systems available for different purposes:

1. Security :
a) Ring alarm – it has a numeric keypad, a base station with a siren, a motion sensor, and one
door/window sensor. It also has every type of radio you’d want in a smart home system: Z-
Wave Plus, Zigbee, LTE, and Wi-Fi. One of the biggest advantages is that it can be interfaced
with different smart sensors from other companies.
b) Abode Iota – it incorporates a 1080p security camera, support for Zigbee and Z-Wave smart
home devices and sensors, optional cellular backup for added security, and optional
professional monitoring. One of the advantages is that it supports IFTTT (If This Then
That), meaning that it provides a user friendly interface to program the connections you want
between the devices making your smarthome customizable.
2. Heating/Ventilation/Air conditioning:
a) GE AHP08LX Window Air Conditioner – The core requirement for a smart air conditioner
is Wi-Fi capability, so you can access and control the unit from anywhere using a mobile
app. Once it’s installed in a window and connected to your home Wi-Fi network, you can use
the simple but effective GE Comfort app on your phone or tablet to easily turn the A/C on or
off or adjust the temperature. You can also set up schedules to run the cooling at certain
times, and they can be different for any day of the week. It’s compatible with major voice
assistants and smart platforms like Google Home and Amazon’s Alexa.
b) Kenmore Elite Smart Room Air Conditioner - the main draw to the smart A/C is being
able to control these settings from anywhere inside the house or outside it. You can turn the
air on and off, adjust the temperature, and set up custom schedules through the Kenmore
Smart app, a decent mobile interface that can manage other Kenmore smart products as well.
The Kenmore Elite also offers convenient integration with Amazon’s Alexa voice
assistant and Echo speakers.
3. Multimedia :
Virtual Assistant + Speaker like Google Home, Amazons Alexa, Apple Homepod. Virtual
assistants are able to interpret human speech and respond via synthesized voices. Users can ask
their assistants questions, control home automation devices and media playback via voice, and
manage other basic tasks such as email, to-do lists, and calendars with verbal commands.
Virtual assistants can be interfaced with other smart home appliances like:
a) RGB lights
b) Smart Vaccum Cleaner
c) Smart Wash Machine
d) TV
e) Sound System

In which category does our product falls in?


The aspects our Smart Home System will be focusing on are:

4. Temperature monitoring and control


5. Wireless lights control based on presence in the room and optimal luminosity level

What development board we use?


Used module:

The ESP8266 is a low cost Wifi chip from Expressif.

Reasons to use an ESP8266:

1) Full TCP/IP stack and microcontroller capability
2) Good price
3) Hardware abstractization layer (libraries)
4) Wireless communication
5) Easy to program with Arduino Ide

ESP8266 Features:

 16 GPIO pins
 IEEE 802.11 b/g/n Wi-Fi
 SPI
 I²C (software implementation)
 I²S interfaces with DMA (sharing pins with GPIO)
 UART on dedicated pins, plus a transmit-only UART can be enabled on GPIO2
 10-bit ADC (successive approximation ADC)

What type of communication we use ?


We will use the wireless Wifi module using Websockets.

WebSocket is a computer communications protocol, providing full-duplex communication channels over


a single TCP connection. 

The WebSocket protocol enables interaction between a web browser (or other client application) and
a web server with lower overhead than half-duplex alternatives such as HTTP polling, facilitating real-
time data transfer from and to the server. This is made possible by providing a standardized way for the
server to send content to the client without being first requested by the client, and allowing messages to
be passed back and forth while keeping the connection open. In this way, a two-way ongoing
conversation can take place between the client and the server. The communications are done over
TCP port number 80.

The esp8266 will connect to the server and transmit sensor data once every x seconds.

On the server part, the data is processed and stored into a MySql Database. The information that is
requested and sorted using queries can be used then to display the statistics of the system.

Sensors to interface with our ESP8266?


A. Temperature and Humidity Sensor - DHT11
DHT11 temperature range is from 0 to 50 degrees Celsius with +-2 degrees accuracy and humidity range
is from 20 to 80% with 5% accuracy. Taking in consideration that we are trying to measure ambient
values, the temperature and humidity ranges are perfect for our application.

We can also use a more expensive sensor – DHT22.  Its temperature measuring range is from -40 to +125
degrees Celsius with +-0.5 degrees accuracy. Also the DHT22 sensor has better humidity measuring
range, from 0 to 100% with 2-5% accuracy.

Interfacing the sensor and ESP: Serial communication

B. PIR Motion Sensor

MOTION click is a motion detector sensitive only to live bodies. It carries PIR500B, a pyroelectric
sensor which generates a voltage when exposed to infrared radiation emitted by live bodies (the white
plastic Fresnel lens covering the sensor filters visible light).
The click is designed to run on 3.3V power supply
only. It communicates with the target MCU over RST
and INT pin on the mikroBUS line.

The signal is processed by a BISS0001 PIR sensor


controller which sends an interrupt to the MCU
through the mikroBUS INT (out) line.

An onboard potentiometer lets you adjust the detecting


range of the sensor (up to 1.7 meters).

Night only mode

The click also has a night only mode—resoldering a


zero-ohm jumper activates the onboard photo resistor
which acts as a light-sensitive switch.

You can also switch the sensor ON and OFF by sending a signal from the MCU through the mikroBUS
RST pin.

MOTION click is ideal for alarm systems, light switch controllers, and similar systems where human
presence needs to be detected.

Data storage
1.MySql Database

Advantages:

a)     Data Security

MySQL is globally renowned for being the most secure and reliable database management system
used in popular web applications like WordPress, Facebook and Twitter. The data security and
support for transactional processing that accompany the recent version of MySQL, can greatly benefit
any project especially if it is one that contains security information.

b)    On-Demand Scalability

MySQL offers unmatched scalability to facilitate the management of deeply embedded apps using a
smaller footprint even in massive warehouses that stack terabytes of data. On-demand flexibility is
the star feature of MySQL. When the number of customers increases and more data is being stored
onto the server, the need for scalability is becoming evident.

c)    High Performance

MySQL features a distinct storage-engine framework that facilitates system administrators to


configure the MySQL database server for a flawless performance. Whether it is an eCommerce
website that receives a million queries every single day or a high-speed transactional processing
system, MySQL is designed to meet even the most demanding applications while ensuring optimum
speed, full-text indexes and unique memory caches for enhanced performance.

d) Easy to manage and sort data

MySQL allows you to use queries in order to extract and sort the data you want. The fact that this is
done on the server side is a big advantage because the person’s resources are not used. This gives you
the possibility to make the application faster and more user-friendly.

Displaying the data for the user


Using the library chart.js we can display the data for a better understanding of the dynamics.

Customers can track their use of energy use over the course of the day, home heating/lighting habits.

Examples of chart.js:

You might also like