Power status panel

An ESP32-S3 with a screen that shows battery voltage, load and mains status with a button to switch pages.

Displays & panels Board: ESP32-S3 DevKitC-1 Level: ●●○ ⏱ 2–3 h

⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

One screen for the whole backup system

In an outage you want one glance, not three apps: is the mains present, what is the battery voltage, how many watts does the house draw, and how much time is left. An ESP32-S3 with a small screen and a button for pages can show all of it on the wall next to the inverter.

An honest runtime estimate

Remaining time is energy left divided by load. Use the usable capacity, which for LiFePO4 is realistically 80 to 90 % of the label, and include the inverter efficiency of about 85 to 90 %. Show it as "about 4 h" and smooth the load over several minutes, or the number will jump with every kettle.

  • The mains status comes from an opto-isolated detector, not from measuring the inverter output.
  • A long press can switch the backlight, a short press can change the page.
  • Keep the screen off most of the time. A panel that sits on battery should not drain it.

Components

  • ESP32-S3 DevKitC-1 N16R8
  • INA219 current/voltage sensor module
  • OLED 0.96" 128x64 I2C SSD1306
  • Tactile buttons (set)
  • Dupont jumper wires (M-F, M-M)

Wiring

Module Module pin ESP32 pin Note
INA219 + OLED SDA / SCL I2C GPIO8 / GPIO9 INA219 0x40, OLED 0x3C
INA219 Vin+ / Vin- shunt in series with the load + up to 26 V and 3.2 A with the stock shunt
Button one side GPIO7 other side to GND; short press changes the page

Libraries

  • Adafruit INA219
  • Adafruit SSD1306
  • Adafruit GFX Library

Code

#include <Wire.h>
#include <Adafruit_INA219.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_INA219 ina; Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const int PIN_BTN = 7;
int page = 0; float vMin = 99, vMax = 0, wh = 0; uint32_t lastMs = 0, lastBtn = 0;

void setup() {
  Serial.begin(115200); pinMode(PIN_BTN, INPUT_PULLUP); Wire.begin(8, 9);
  ina.begin(); oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE); lastMs = millis();
}
void loop() {
  float v = ina.getBusVoltage_V(), a = ina.getCurrent_mA() / 1000.0, w = v * a;
  uint32_t now = millis(); wh += w * (now - lastMs) / 3600000.0; lastMs = now;
  vMin = min(vMin, v); vMax = max(vMax, v);
  if (digitalRead(PIN_BTN) == LOW && now - lastBtn > 300) { page = (page + 1) % 3; lastBtn = now; }
  oled.clearDisplay(); oled.setCursor(0, 0); oled.setTextSize(1);
  if (page == 0) { oled.setTextSize(2); oled.printf("%.2f Vn%.2f An%.1f W", v, a, w); }
  else if (page == 1) { oled.printf("Energyn"); oled.setTextSize(2); oled.printf("%.2f Wh", wh); }
  else { oled.printf("Voltage min/maxn"); oled.setTextSize(2); oled.printf("%.2fn%.2f", vMin, vMax); }
  oled.display(); delay(250);
}

Build tips

  • Keep the shunt wires short and thick; remember the INA219 limit of 26 V and 3.2 A.
  • For a bigger load use an external shunt and recalculate the calibration.

What you need

Buy the parts kit · Estimated total: $14.50

ESP32-S3 DevKitC-1 N16R8 × 1
$8.00
Buy at AliExpress Buy at Amazon.com
INA219 current/voltage sensor module × 1
$2.00
Buy at AliExpress Buy at Amazon.com
OLED 0.96" 128x64 I2C SSD1306 × 1
$2.50
Buy at AliExpress Buy at Amazon.com
Tactile buttons (set) × 1
$0.50
Buy at AliExpress Buy at Amazon.com
Dupont jumper wires (M-F, M-M) × 1
$1.50
Buy at AliExpress Buy at Amazon.com
🇺🇦 Ukraine🌍 Other countries

Other countries: order these parts on AliExpress with the links below.

Some links are affiliate links: we may earn a commission at no extra cost to you.

Related ideas

Outage schedule countdown display

A small screen that loads your own outage schedule and shows the time to the next switch-off or switch-on, so you can plan charging and cooking.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 1–2 h
Pick parts / kit

OLED weather clock

Time from the internet, indoor temperature and humidity on a small OLED screen.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●○○ Beginner
  • Build time 1–2 h
Pick parts / kit
⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

DC power meter with display

A compact volt/amp/watt meter for 5–26 V circuits with an OLED screen and a web page.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●○○ Beginner
  • Build time 1 h
Pick parts / kit

← All module ideas →

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.