Close Menu
Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
Circuit of Things Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc
Hire us
Circuit of Things
Home»ESP32 Projects»ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud
ESP32 Projects

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

Sai Preetham KoyyalaBy Sai Preetham KoyyalaMay 4, 2026No Comments2 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Share
Facebook Twitter LinkedIn Pinterest Email
Contents
  • Introduction
  • What We Will Build
  • Step 1: Create a Firebase Project
  • Step 2: Install the Library
  • The Code
  • Viewing Data in Firebase
  • Conclusion

Introduction

Google Firebase Realtime Database is a cloud-hosted NoSQL database that syncs data in real time across all clients. Paired with the ESP32, it becomes a powerful IoT backend — allowing you to send sensor data from your hardware and instantly see it update in a web dashboard or mobile app.

What We Will Build

An ESP32 that reads temperature from a DHT11 sensor and pushes it to Firebase every 10 seconds. Any browser connected to Firebase will see the value update in real time.

Step 1: Create a Firebase Project

  1. Go to console.firebase.google.com and create a new project.
  2. Navigate to Realtime Database and create a database in test mode.
  3. Copy your database URL (e.g. https://your-project.firebaseio.com).

Step 2: Install the Library

In the Arduino IDE, search for and install Firebase ESP32 Client by mobizt.

The Code

#include <WiFi.h>
#include <FirebaseESP32.h>
#include <DHT.h>
#define DHTPIN 4
#define DHTTYPE DHT11
#define FIREBASE_HOST "your-project.firebaseio.com"
#define FIREBASE_AUTH "your-database-secret"
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
FirebaseData firebaseData;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
  Firebase.reconnectWiFi(true);
  Serial.println("Connected to Firebase!");
}
void loop() {
  float temp = dht.readTemperature();
  float hum = dht.readHumidity();
  if (!isnan(temp)) {
    Firebase.setFloat(firebaseData, "/sensor/temperature", temp);
    Firebase.setFloat(firebaseData, "/sensor/humidity", hum);
    Serial.printf("Sent: %.1f C, %.1f %%\n", temp, hum);
  }
  delay(10000);
}

Viewing Data in Firebase

Go to your Firebase Console and open the Realtime Database. You will see the /sensor/temperature and /sensor/humidity nodes updating every 10 seconds!

Conclusion

Firebase provides a free, scalable cloud backend for your ESP32 IoT projects with zero server management. From here, you can build beautiful web and mobile dashboards to visualize your sensor data anywhere in the world.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticlePIR Motion Sensor with Arduino: Smart Security Alarm System
Next Article NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform
Sai Preetham Koyyala
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

Hello, I am Sai Preetham Koyyala. I'm an electronics engineer by profession, a DIY enthusiast by passion. ESP32 and Arduino are the main topics of my work.

Related Posts

ESP8266 Projects

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

May 4, 2026
ESP32 Projects

ESP32 OTA Updates: Program Your Board Over Wi-Fi with Arduino IDE

May 4, 2026
ESP32 Projects

ESP32 Bluetooth Tutorial: Wireless Serial Communication with Arduino IDE

May 4, 2026
Add A Comment
Leave A Reply Cancel Reply


KSP Electronics
✓ Trusted Store
Everything for Your
Next IoT Build
Boards, sensors, modules & kits delivered fast across India.
ESP32 Arduino Sensors Modules DIY Kits
500+
Products
Fast
Delivery
★★★★★
Rated
🛒 Shop Now →
kspelectronics.in
💻
● Available for Projects
Hire Me for
IoT Projects
ESP32, LoRaWAN, cloud dashboards & custom hardware — end-to-end IoT solutions for your needs.
ESP32 LoRaWAN MQTT Arduino Cloud PCB Design
3+
Yrs Exp
20+
Projects
★★★★★
Rated
💬 Chat on WhatsApp
View services →
Top Posts

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Follow Us
  • Telegram

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Most Popular

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Our Picks

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

May 4, 2026

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

© 2026 Circuit of Things. All Rights Reserved. Built with ❤️ for the Maker Community.

  • About
  • Privacy
X (Twitter) Instagram YouTube WhatsApp
  • Book an Appointment
  • My Bookings
  • Support Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

Type above and press Enter to search. Press Esc to cancel.