Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ESP8266 Home Automation Projects

You're reading from  ESP8266 Home Automation Projects

Product type Book
Published in Nov 2017
Publisher Packt
ISBN-13 9781787282629
Pages 196 pages
Edition 1st Edition
Languages
Authors (2):
Catalin Batrinu Catalin Batrinu
Profile icon Catalin Batrinu
Constantin Tambrea Constantin Tambrea
Profile icon Constantin Tambrea
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}