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.
Time from the internet, indoor temperature and humidity on a small OLED screen.
Displays & panels Board: ESP32 DevKit V1 (WROOM-32) Level: ●○○ ⏱ 1–2 h
Once the ESP32 has Wi-Fi it does not need a battery-backed clock: it asks an NTP server at start and every few hours. Give it a POSIX time zone string instead of a fixed offset and daylight saving time changes on its own; for Kyiv that is EET-2EEST,M3.5.0/3,M10.5.0/4.
An OLED keeps a static picture for years only if you let it rest. Shift the layout by a pixel every few minutes, dim it at night using the clock, or turn it off from midnight to six. For Cyrillic or Polish letters pick a font with those glyphs, for instance the u8g2 "_t_cyrillic" fonts.
| Module | Module pin | ESP32 pin | Note |
|---|---|---|---|
| OLED + BME280 SDA / SCL | I2C | GPIO21 / GPIO22 | |
| VCC / GND | 3V3 / GND |
#include <WiFi.h>
const char* WIFI_SSID = "YOUR_WIFI";
const char* WIFI_PASS = "YOUR_PASSWORD";
bool connectWiFi(uint32_t timeoutMs = 20000) {
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASS);
uint32_t t0 = millis();
while (WiFi.status() != WL_CONNECTED && millis() - t0 < timeoutMs) {
delay(250);
Serial.print(".");
}
Serial.println();
if (WiFi.status() == WL_CONNECTED) {
Serial.print("IP: ");
Serial.println(WiFi.localIP());
return true;
}
return false;
}
#include <Wire.h>
#include <time.h>
#include <Adafruit_BME280.h>
#include <Adafruit_SSD1306.h>
Adafruit_BME280 bme;
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
void setup() {
Serial.begin(115200);
Wire.begin(21, 22);
bme.begin(0x76);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
connectWiFi();
configTzTime("EET-2EEST,M3.5.0/3,M10.5.0/4", "pool.ntp.org", "time.google.com"); // Kyiv; change the TZ string for your region
}
void loop() {
struct tm ti; getLocalTime(&ti, 100);
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(3); oled.setCursor(0, 0); oled.printf("%02d:%02d", ti.tm_hour, ti.tm_min);
oled.setTextSize(1); oled.setCursor(0, 32); oled.printf("%02d.%02d.%04d", ti.tm_mday, ti.tm_mon + 1, ti.tm_year + 1900);
oled.setTextSize(2); oled.setCursor(0, 46); oled.printf("%.1fC %.0f%%", bme.readTemperature(), bme.readHumidity());
oled.display();
delay(1000);
}
Buy the parts kit · Estimated total: $11.00
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.
BME280 plus an OLED screen: temperature, humidity and pressure on the display, a web page and Home Assistant.
Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
An ESP32-S3 with a screen that shows battery voltage, load and mains status with a button to switch pages.
Comments
No comments yet. Share your experience or ask a question.