Skip to content

Ekemini-Udofia/Power-Monitoring-Hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Power Monitoring Hub

A battery-powered ESP32-based device that detects when electrical power is restored (NEPA brings light) and logs the event. It connects to WiFi via a captive portal and sends the event to a remote server or webhook. Designed for energy efficiency using deep sleep, and built for anyone to use β€” no hardcoded credentials required.


πŸ“¦ Features

  • πŸ•΅οΈ Detects power presence using a GPIO pin (relay)
  • πŸŒ™ Enters deep sleep when no power is present to conserve battery
  • πŸ“‘ Wakes and connects to WiFi (via saved credentials or captive portal)
  • πŸ•’ Syncs real-time clock using NTP
  • πŸ“€ Sends power-on timestamp to remote webhook/API (e.g., Pipedream, Firebase)
  • 🌍 Optionally logs data locally (SPIFFS/LittleFS)
  • βœ… No hardcoded credentials β€” user configures WiFi through a web interface

πŸš€ How It Works

  1. On boot, ESP32 checks for power using a GPIO pin.
  2. If power is off, it enters deep sleep and waits for a HIGH signal to wake.
  3. If power is on, it:
    • Connects to WiFi (saved credentials or captive portal)
    • Syncs time via NTP
    • Logs the power-on event with a timestamp
    • Sends the data to a configured webhook or endpoint
  4. Returns to deep sleep to conserve battery.

πŸ›  Hardware Required

Component Purpose
ESP32 Dev Module Core microcontroller
LiPo Battery / Power Bank Power source
Optocoupler / Relay Detect power state on input pin
Push Button (optional) Enter WiFi config mode manually

πŸ“² WiFi Configuration (Captive Portal)

When first powered:

  • Device creates a WiFi hotspot (Power Hub / 1234567890)
  • Connect to this AP with a phone or PC
  • Enter your home WiFi credentials via the web interface
  • ESP32 saves and reuses this config on the next boot

πŸ“‘ Remote Logging

This project supports sending event data to a remote endpoint.

Example Payload:

{
  "timestamp": "2025-06-30T09:45:00",
  "event": "POWER_ON",
  "device": "ESP32-HUB-01"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published