Nodemcu firebase– In This tutorial, you will learn how to create your own firebase account and create your first project to monitor a sensor in real-time from anywhere around the world. As this is a getting started tutorial on how to use the firebase with Nodemcu esp8266 wifi module, that’s why I decided to use a variable resistor as the sensor to keep things simple. If you want to make something advanced like a student’s attendance system using RFID, GSM, and 16X2 LCD with the Google Firebase Database. Then read my article on “Arduino Firebase Database, Students Attendance System using RFID and GSM“. If you want to use the FIREBASE database with the ESP32, then consider reading my article on “ESP32 Firebase Tutorial, Send Sensor Data to Google Firebase Database“.
For the detailed step by step explanation watch video Tutorial given at the end of this article.
The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:
Other Tools and Components:
*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!
Nodemcu Firebase Account Setup:
Open your internet browser and go to console.firebase.google.com,
Click on the add project.
Write the project name
check all the boxes and then click on the create project.
if you click on the develop you will see
First, let’s start with the project settings…
click on the service accounts…
click on the database secrets…
click show and copy ….
then open the program and paste this in the firebase authentication…
now for the firebase host…click on the database…
select realtime database…
copy this link and paste it in the programming…
now our settings are completed, now we can click on the verify button to compile our program and check for any errors.
Now let’s discuss the Circuit diagram…
Nodemcu Firebase Circuit Diagram:
The circuit diagram as you can see is really easy. Connect the rightmost and leftmost legs of the variable resistor with the Nodemcu esp8266 wifi module 3.3v and GND. Connect the middle leg of the variable resistor with the A0 pin of the Nodemcu. To power up the Nodemcu ESP8266 Wifi Module you can use a 5V regulated power supply based on the LM7805 Voltage regulator. Simply connect the 5 Volts from the regulated power supply with the Vin pin of the Nodemcu Module and connect the ground of the 5V regulated power supply with the ground pin of the Nodemcu ESP8266 Wifi Module.
If you want to learn in detail, how to design the power supply PCB board for the Nodemcu ESP8266 Wifi Module then watch my tutorial given below.
Nodemcu Firebase Programming:
// Set these to run example.
#define FIREBASE_HOST "fahad-ba398.firebaseio.com"
#define FIREBASE_AUTH "d0vy3ZgNMiwszDZsZ3iT1jg9enRLbKypvadDEPz1"
#define WIFI_SSID "ZONG MBB-E8231-6E63"
#define WIFI_PASSWORD "08659650"
int vr = A0; // variable resistor connected
int sdata = 0; // The variable resistor value will be stored in sdata.
// Debug console
// connect to wifi.
while (WiFi.status() != WL_CONNECTED)
sdata = analogRead(vr);
myString = String(sdata);