Skip to content
/ TempHum Public

This project uses an ESP32 to interface with a DHT22 sensor for measuring temperature and humidity,

Notifications You must be signed in to change notification settings

vuvvvv/TempHum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realtime Database




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.




Firebase Logo Database Icon








Setup




Step 1: Create a Firebase Project



Create a new Firebase project in the Firebase console. This will give you a unique project ID that you

وصف الصورة




Step 2: Create a Realtime Database



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



وصف الصورة



Edit rules to be



{ "rules": { ".read": true, ".write": true } }


Real Model



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.




Connecting DHT22 to ESP32

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


وصف الصورة




Digram



وصف الصورة

Programing

Open Arduino IDE or any IDE to Upload code from esp32_code to esp32

esp32_code



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



Optional




Use the files in the 3D_print folder to print a custom enclosure for the ESP32 and DHT22 using a 3D printer.


وصف الصورة




Displaying Data in Flutter




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

About

This project uses an ESP32 to interface with a DHT22 sensor for measuring temperature and humidity,

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published