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

Temperature sensor


There are a lot of temperature sensors that can be used, but for this project we will use a very common one, the DTH22. It can measure temperature and humidity.

The following are the DHT22 characteristics:

  • Low cost
  • 3 to 5V power and I/O
  • 5mA max current used during conversion (while requesting data)
  • Good for 0-100% humidity readings with 2-5% accuracy
  • Good for -40 to 125°C temperature readings ±0.5°C accuracy
  • No more than 0.5 Hz sampling rate (once every two seconds)
  • Body size 15.1mm x 25mm x 7.7mm
  • 4 pins with 0.1" spacing

DHT22 can be found as a separate sensor or as a breakout. It is preferrable to buy the breakout version since it has also the pull-up 4k7 resistor and a capacitor. If you prefer the sensor alone this is the pinout:

DHT22 pinout

Here:

  • VCC: can be between 3V3 and 5V
  • GND: is the ground
  • DATA: is the data pin

Don't forget to add a 4K7 pull-up resistor between the DATA and VCC pin. For the connection with a gas furnance or other heating element, a relay will be added on the...