Book Image

ESP8266 Home Automation Projects

By : Catalin Batrinu, Constantin Tambrea
Book Image

ESP8266 Home Automation Projects

By: Catalin Batrinu, Constantin Tambrea

Overview of this book

The ESP8266 is a low-cost yet powerful Wi-Fi chip that is becoming more popular at an alarming rate, and people have adopted it to create interesting projects. With this book, you will learn to create and program home automation projects using the ESP8266 Wi-Fi chip. You will learn how to build a thermostat to measure and adjust the temperature accordingly and how to build a security system using the ESP8266. Furthermore, you will design a complete home automation system from sensor to your own cloud. You will touch base on data monitoring, controlling appliances, and security aspects. By the end of the book, you will understand how to completely control and monitor your home from the cloud and from a mobile application. You will be familiar with the capabilities of the ESP8266 and will have successfully designed a complete ready-to-sell home automated system.
Table of Contents (16 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
3
Building a Home Thermostat with the ESP8266
5
Using ESP8266 to Build a Security System
Index

Streaming data from ESP8266


To stream data from ESP8266 we need first to establish a WebSocket connection between the ESP8266 and a server; data that will be streamed over the WebSocket connection will be the acceleration values for the X, Y and Z axes. ESP8266 will read them from an ADXL345 chip and will send them to a nodeJS server. From the server, data can be sent to a connected browser on the same server or can be written to a database for further analysis:

The final circuit can also include a time-series database such as InfluxDb, for storing the values transmitted by the ADXL345.

Adding a database can let you collect various data from multiple acceleration sensors, store them in the database, retrieve them on request to compare them with the current values, or draw nice graphs with the current and historical data.

A server can also react to some values and send alerts (email, SMS) and send data to other ESP8266 modules to react, or to other servers.

ADXL345 accelerometer

Produced by the...