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
About the Author
About the Reviewer
Customer Feedback
Building a Home Thermostat with the ESP8266
Using ESP8266 to Build a Security System

ESP8266 and Infrared communication

In the previous chapters the ESP866 has been controlling relays, reading temperature and humidity, but not all the appliances around the house can be controlled with a relay. There are some of them that can be controlled using the infrared like TV or air-conditioning Now let's see how we can use ESP8266 to turn on/off a Panasonic TV. This can be extended to other TV brands by modifying the addresses and values.

Hardware components

To complete this project you will need:

  • ESP8266
  • Infrared LEDs (maybe from an old remote)
  • Some 100-ohm resistors (depending on the number of your infrared LEDs, one per LED)
  • One 1-Kilo Ohm resistor
  • One 2N2222 NPN transistor

Use the following schematic for the hardware part of this project:

Connect the output pin to the GPIO 12 from the ESP8266 the ground to the GND pin, and 5V to 5V from your ESP.

Software and libraries for this project

First let's install the library IRremoteESP8266. For that go to Sketch | Include Library | Manage Libraries...