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.
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
Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
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.
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.
| 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 |
#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);
}
Buy the parts kit · Estimated total: $14.50
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.
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.
Time from the internet, indoor temperature and humidity on a small OLED screen.
Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
A compact volt/amp/watt meter for 5–26 V circuits with an OLED screen and a web page.
Comments
No comments yet. Share your experience or ask a question.