This project implements a real-time smart energy monitoring and billing system using the STM32F746 microcontroller and ESP32. The system measures voltage and current, computes RMS values, calculates power and energy consumption, and uploads live data to the Firebase cloud using WiFi. The design follows a FreeRTOS-based multi-task architecture, ensuring deterministic operation and clean separation of responsibilities.
- Real-time voltage and current measurement
- RMS calculation with DC offset removal
- Power and energy (kWh) computation
- Cloud-based monitoring using Firebase
- FreeRTOS-based multi-threaded design
- UART communication between STM32 and ESP32
- Voltage Sensor (ZMPT101B) → STM32 ADC
- Current Sensor (ACS712 / INA219) → STM32 ADC
- STM32F746 → Signal processing + RMS calculation (FreeRTOS)
- ESP32 → WiFi + Firebase cloud upload
- UART → Communication between STM32 and ESP32
- STM32F746
- FreeRTOS
- STM32CubeIDE
- IAR Embedded Workbench
- ESP32
- Arduino IDE
- Firebase Realtime Database
- UART Communication
- C / C++
- ADC Sampling Task (High Priority)
- RMS & Signal Processing
- UART Transmission Task
- UART Receive Task
- Cloud Upload Task
- Serial Debug Task
Mutexes are used to protect shared data across tasks.
- Stable RMS voltage and current measurement
- Accurate power and energy computation
- Live cloud updates every 5 seconds
- Robust real-time performance using FreeRTOS
- Smart home energy monitoring
- Industrial power usage tracking
- Smart metering systems
- Energy consumption analysis
Demo.Video.mp4
- Awais Asghar
- Muhammad Haris
- Saad Farooq
- Aneeqa Ur Rehman
- STM32F746 Reference Manual
- ESP32 Technical Reference
- Firebase Realtime Database Documentation
- FreeRTOS Official Documentation
This project is intended for academic and educational use.