Skip to content

Repository files navigation

Home_Power_Automation

Live Demo

Physical Implementation

Physical implementation

System Architecture Diagram

System architecture diagram

Project Overview

IoT-based prepaid energy monitoring and control system using ESP32, MQTT (HiveMQ Cloud), Node.js backend, and Firebase Firestore.

The system measures voltage/current, calculates power and energy, publishes telemetry to MQTT, stores history in Firestore, and provides a web dashboard for live monitoring, reports, recharge, and relay control.

Hardware + Firmware (ESP32)

  • Controller: ESP32 DevKit
  • Voltage sensor: ZMPT101B (ADC)
  • Current sensor: ACS712-30A (ADC)
  • Display: LCD 16x2 I2C
  • Relay control for AC load (NC logic in firmware)
  • Push button for local display navigation

Firmware responsibilities:

  • Read sensor values and compute power/energy
  • Publish telemetry/status/relay events to MQTT
  • Receive control commands from MQTT
  • Apply protection thresholds and relay actions
  • Persist settings/calibration in EEPROM

Backend + Cloud

  • Backend: Node.js + Express + WebSocket
  • Message broker: HiveMQ Cloud (MQTT over TLS)
  • Database: Firebase Firestore

Data flow:

  • ESP32 -> HiveMQ topics: energy/data, energy/status, energy/relay
  • Backend subscribes to MQTT topics and stores records in Firestore
  • Dashboard consumes:
    • live data via /api/data + WebSocket
    • report data via /api/reports?range=...

HiveMQ Screenshot

HiveMQ screenshot

Firestore collections used:

  • readings
  • statusLogs
  • settings/global

Firebase Screenshot

Firebase screenshot

Web Dashboard Features

  • Real-time voltage/current/power/energy/balance view
  • Relay ON/OFF control from UI
  • Recharge flow from UI
  • Threshold/settings update and factory reset actions
  • Reports and charting with range filters

Run/Deploy Notes

  • Frontend static files are served from static/
  • Backend server is in backend/server.js
  • Production app endpoint is hosted on Render (see Live Demo link above)

Releases

Packages

Contributors

Languages