Firebase Realtime Database is a cloud-hosted database provided by Google through the Firebase platform. It allows you to store and sync data in real time across all clients (mobile, web, etc.). Whenever data changes, all connected devices receive the update instantly, without the need to refresh or make additional requests.
Create a new Firebase project in the Firebase console. This will give you a unique project ID that you
In the Firebase console, navigate to the Realtime Database section and click on the "Create Database"
Now you have host link for read and write And you need Key pair From project settings ---> Cloud Messaging
{ "rules": { ".read": true, ".write": true } }
This project uses an ESP32 to interface with a DHT22 sensor for measuring temperature and humidity, and sends the data to a remote server or cloud platform in real-time.
| DHT22 Pin | Function | ESP32 Pin | Notes |
|---|---|---|---|
| VCC | Power (+3.3V ) | 3.3V | Use 3.3V to match ESP32 logic levels |
| DATA(Out) | Data signal | GPIO4 (example [P4]) | You can choose any available GPIO |
| GND | Ground | GND | Connect to ESP32 ground |
Open Arduino IDE or any IDE to Upload code from esp32_code to esp32
write your wifi name and pass
#define WIFI_SSID "-----------"
#define WIFI_PASSWORD "----------"
paste your host link and key
#define FIREBASE_HOST"---------------------"
#define FIREBASE_AUTH"---------------------"
Now you see the data is being saved, and you can easily integrate it into any IoT or automation project, such as:
-
Displaying it on a web dashboard
-
Triggering alerts or automation
Use the files in the 3D_print folder to print a custom enclosure for the ESP32 and DHT22 using a 3D printer.
All source code for the Flutter application is available in the Flutter/ folder.
This includes:
- UI components to display temperature and humidity
- Networking logic to fetch data from ESP32
- Optional charts, styling, and state management
This project demonstrates how embedded programming with devices like ESP32 + DHT22 can be easily connected to cloud services such as Firebase Realtime Database, and then integrated into any software project including mobile apps like Flutter.
Whether you're building an IoT dashboard, automation system, or smart environment, this setup provides a complete, scalable foundation for real-time data collection, storage, and visualization.
-
Real-time temperature & humidity data from ESP32
-
Data stored instantly in Firebase Realtime Database
-
View & use that data in any client (e.g., Flutter app)
-
Optional 3D-printed enclosure for real hardware setup
This concept is reusable — you can apply the same architecture to any project involving sensors, cloud storage, and app integration.
@vuvvvv







