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.
Shows voltage, current, power, energy and min/max voltage on an OLED, with a button to switch pages.
Level: Intermediate Board: ESP32-S3 DevKitC-1 Power & blackouts
Li-ion cells: watch polarity, use protected cells and a charger with protection, never leave a damaged cell charging unattended.
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.
| 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 |
Arduino IDE → Tools → Manage Libraries, then install:
#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 V\n%.2f A\n%.1f W", v, a, w); }
else if (page == 1) { oled.printf("Energy\n"); oled.setTextSize(2); oled.printf("%.2f Wh", wh); }
else { oled.printf("Voltage min/max\n"); oled.setTextSize(2); oled.printf("%.2f\n%.2f", vMin, vMax); }
oled.display(); delay(250);
}Flash a ready firmware from the browser Paste your error into the AI Error Doctor
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.