Smart Home – Control everything with ESP8266 Series (Part 3)

Tram Ho


In this section, I will show you how we control every device via the internet from anywhere, combining ESP8266 and Firebase.


1. Firebase account and create database (you can google and do it yourself. It’s very simple), create a value as shown below.

2. Copy FIREBASE_HOST and FIREBASE_AUTH in the databasesecrets section.

3. Install Arduino for programming ESP8266. Details you refer here
4. Set the library to use firebase, you can download it here
5. Install the hardware as shown in the first part. With changing the light bulb with any other equipment such as television, fan, refrigerator, …
It’s done. Turn on the Arduino and code.


1. Set parameters

  1. Read data from Firebase
  • Connect ESP8266 to your home wifi.

  • Wait for the connection to succeed

  • Get data from firebase

  • Check if the sequence is “on” or “off” to decide whether to close or disconnect the relay to control the device


So I have shown you how to connect ESP8266 with Firebase. From the following article, you only need to care how to change the “status” value on firebase to turn off the device, to become “smart”. No need to care about that rudimentary module, all rich ideas start here. Remember to follow the next article.

Share the news now

Source : Viblo