Close Menu
Circuit of Things
  • Home
  • About Us
  • Contact Us
  • 3D Print
  • Shop Now !
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • KSP Tools

Get Free Tutorials & Discounts!

Subscribe for the latest IoT tutorials and exclusive KSP Electronics discount codes.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
Circuit of Things Circuit of Things
  • Home
  • About Us
  • Contact Us
  • 3D Print
  • Shop Now !
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • KSP Tools
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, 2026Updated:May 7, 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.

Related Tutorials

  • Choosing the Right Microcontroller: ESP32 vs. ESP8266 Comparison
  • Build an ESP32 DHT11 Webserver for Real-Time Temperature and Humidity Monitoring
  • Top 5 Development Boards for IoT Projects in 2026
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

ESP32 Projects

Step-by-Step Guide: Interface DHT11 and DHT22 Sensors with ESP32

May 6, 2026
ESP32 Projects

An Introduction to the ESP32 Development Board

May 6, 2026
ESP32 Projects

The Complete ESP32 Pinout Guide: Which Pins to Use?

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


⚡

Circuit of Things

Free IoT tutorials & electronics projects — powered by KSP Electronics.

📸 Instagram 💬 Community
✓ Official Partner Store

Everything for Your
Next IoT Build

Boards, sensors, modules & kits — fast delivery across India.

ESP32 Arduino Sensors Raspberry Pi 3D Print
🛒 Shop KSP Electronics →
Top Posts

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

July 14, 2023

Step-by-Step Guide: Interface DHT11 and DHT22 Sensors with ESP32

May 6, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Available for Projects

Hire Us for IoT Development

End-to-end solutions for your needs:

  • → ESP32 & Embedded Systems
  • → LoRaWAN & Cloud Dashboards
  • → Custom Hardware Design
  • → IoT Product Prototyping
View Services →

Get Free Tutorials & Discounts!

Subscribe to get the latest IoT tutorials and exclusive hardware discount codes for KSP Electronics delivered directly to your inbox.

Follow Us
  • Instagram
  • Telegram
About Circuit of Things

We are a community-driven engineering platform dedicated to IoT, Robotics, and DIY electronics tutorials.

Proudly partnered with KSP Electronics.

Quick Links
  • Home
  • ESP32 Projects
  • Arduino Projects
  • IoT Tutorials
  • Sensors & Modules
  • Shop on KSP Electronics
  • Electro Calc
Legal & Support
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
📩

Get Free Tutorials & Discounts!

Subscribe for IoT tutorials and exclusive KSP discount codes.

Subscription Form


By subscribing, you agree to our Privacy Policy. No spam, ever.

X (Twitter) Instagram YouTube WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

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