Skip to content

Awais-Asghar/FreeRTOS-Based-Smart-Energy-Monitor-using-STM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FreeRTOS-Based Smart Energy Monitor using STM32

Status Platform MCU RTOS Cloud Language Lisence

Project Overview

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.

Image Image Image Image

Key Features

  • 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

System Architecture

  • 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
Image Image

Tools and Technologies

  • STM32F746
  • FreeRTOS
  • STM32CubeIDE
  • IAR Embedded Workbench
  • ESP32
  • Arduino IDE
  • Firebase Realtime Database
  • UART Communication
  • C / C++
Image

Core Implementation

Image

FreeRTOS Task Design

STM32 (RTOS-based)

  • ADC Sampling Task (High Priority)
  • RMS & Signal Processing
  • UART Transmission Task

ESP32 (Dual-Core FreeRTOS)

  • UART Receive Task
  • Cloud Upload Task
  • Serial Debug Task

Mutexes are used to protect shared data across tasks.

Image Image Image

Hardware Implementation

Image

Results

  • Stable RMS voltage and current measurement
  • Accurate power and energy computation
  • Live cloud updates every 5 seconds
  • Robust real-time performance using FreeRTOS
Image Image Image

Applications

  • Smart home energy monitoring
  • Industrial power usage tracking
  • Smart metering systems
  • Energy consumption analysis
Image

Demo Video

Demo.Video.mp4

Team Members

  • Awais Asghar
  • Muhammad Haris
  • Saad Farooq
  • Aneeqa Ur Rehman
Image Image Image Image Image Image Image

References

  • STM32F746 Reference Manual
  • ESP32 Technical Reference
  • Firebase Realtime Database Documentation
  • FreeRTOS Official Documentation
Image

License

This project is intended for academic and educational use.

About

Developed a real-time smart energy monitoring system on STM32F746 using FreeRTOS, managing tasks for sensor acquisition, Vrms, Irms, and kWh computation, and local display. Integrated an ESP32 IoT interface to transmit processed data to a cloud dashboard, ensuring comprehensive remote tracking of electrical parameters and consumption.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages