magnifier
Language
  • English
  • German
Currency

News

DIY ESP32-S3 MINI Flip Clock: Animated NTP Time on a 0.96" OLED Display

0 comments /

DIY ESP32-S3 MINI Flip Clock: Bold-Face HH:MM with Timezone, WiFi Bars & Smart Greeting on a 0.96" OLED



Looking for a desk clock that combines vintage flip-card charm with modern Wi-Fi smarts? Our upgraded ESP32-S3 MINI Flip Clock 2.0 renders crisp, bold sans-serif digits on a tiny 0.96-inch OLED display — each digit snaps over with a two-phase flip animation, just like a mechanical split-flap clock. But this version goes further than the classic flip: it shows your timezone (auto-switching for daylight saving), live WiFi signal bars, a time-of-day greeting, and live ticking seconds — all packed into 128×64 pixels without feeling crowded. It's a satisfying weekend build for makers, students, and anyone who appreciates a beautifully typeset clock face. Get Parts: ESP32-S3 MINI + 0.96" OLED I2C




Step 1 — Wire the OLED to the ESP32-S3 MINI

Four wires, no soldering required. Power the OLED from the ESP32-S3 MINI's 3.3V rail and run the two I²C lines to GPIO 8 and 9.

OLED Pin ESP32-S3 MINI Pin Purpose
VCC 3.3V Power
GND GND Ground
SDA GPIO 8 I²C data
SCL GPIO 9 I²C clock

Note: if you're using a different ESP32 variant that doesn't expose GPIO 8 and 9, you can change the pin assignment in the sketch (see Step 4 below).

Step 2 — Install the Arduino IDE and ESP32 Board Support

  1. Download and install the latest Arduino IDE from arduino.cc.
  2. Open File → Preferences and paste this URL into the "Additional Board Manager URLs" field:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Open Tools → Board → Boards Manager, search for esp32, and install "esp32 by Espressif Systems".
  4. Under Tools → Board, select ESP32S3 Dev Module (or the variant that matches the board in your kit).

Step 3 — Install the Required Libraries

Open Tools → Manage Libraries and install these two (the ESP32 core includes everything else):

  • Adafruit GFX Library — by Adafruit (brings in the FreeSansBold24pt7b font the clock uses for its bold digits)
  • Adafruit SSD1306 — by Adafruit (drives the OLED over I²C)

Everything else — WiFi, Wire, and time.h — comes bundled with the ESP32 core. No extra installs needed.

Step 4 — Download the Firmware and Edit Three Lines

Download the sketch file (flip-clock-ntp.ino) and open it in the Arduino IDE.

Near the top of the sketch you'll see a USER SETTINGS block. Change these three lines to match your Wi-Fi network and time zone:

That's it. Three edits and you're ready to flash. If your board uses different I²C pins, you'll find this block a bit further down — change the numbers to whatever your ESP32-S3 MINI exposes:

Step 5 — Flash and Watch It Come to Life Get Parts: ESP32-S3 MINI + 0.96" OLED I2C


Plug the ESP32-S3 MINI into your computer with a USB-C cable, select the correct COM / serial port under Tools → Port, and click the Upload arrow. After a few seconds you'll see the boot sequence — "Rendering glyphs...", then "Connecting WiFi", then "Syncing NTP..." — and finally the clock face snaps into view: a big, bold HH:MM in four individual rounded flip cards, with all the extras populated around it.


What You See on the Screen

The 128×64 OLED is laid out as three distinct zones, each with a purpose:

  • Top row (y=0..7): the full date — weekday, month, day, and year, centered. "Wednesday Sep 21 2026" is the longest case and fits exactly with 1 px of margin on each side.
  • Main display (y=9..54): four individual flip cards for HH:MM, each with a rounded 1-px frame, a solid hinge line through the midline, and a two-phase flip animation when its digit changes.
  • Bottom row (y=56..63): four micro-indicators on a single text line — TZ on the left (auto "CST" vs "CDT"), WiFi signal bars driven by live RSSI, a centered greeting word ("Morning" / "Afternoon" / "Evening" / "Night") that changes with the hour, and AM/PM with live seconds flush to the right edge.

Features at a Glance

  • Bold sans-serif digits — renders typography-quality HH:MM using Adafruit's FreeSansBold24pt7b font instead of blocky 7-segment glyphs, for a cleaner, more modern look
  • Animated flip-card display — every digit change plays a smooth two-phase flip: the top half collapses downward, then a new bottom flap grows into place
  • Four independent digit slots — the ones-of-minutes can be mid-flip while the hours sit perfectly still, exactly like a real split-flap clock
  • NTP time sync over Wi-Fi using pool.ntp.org — accurate to the second, no RTC module needed, automatic daylight saving
  • Automatic timezone display — the bottom-left TZ abbreviation switches between standard and daylight names (CST↔CDT, EST↔EDT, etc.) on the DST boundary with zero code changes
  • Four US time zones supported out of the box: Eastern, Central, Mountain, Pacific (easy to add more POSIX TZ strings)
  • 12-hour or 24-hour mode — toggle a single #define to switch
  • WiFi signal strength bars — four stepped bars driven by live RSSI, with empty slots shown as tip dots so the icon footprint is always visible
  • Time-of-day greeting — a single, confidently-sized word ("Morning", "Afternoon", "Evening", "Night") centered on the bottom row, updating automatically as the day progresses
  • Live ticking seconds — AM/PM and the current seconds are grouped right-justified as "PM:42", giving the clock a visible once-per-second pulse between minute flips
  • Solid hinge line through the middle of every card — sells the "folded paper" look without introducing visual noise
  • Individual rounded card frames — each of the four digits sits in its own 28×46 card with subtle corner radius, evoking real flip-clock hardware
  • Smart leading-zero blanking — in 12-hour mode, single-digit hours show without an awkward leading "0"
  • Smooth 33 FPS — the entire frame is redrawn and pushed to the OLED in a single I²C transaction, so there's no tearing during flips

A Peek Inside the Code — Font-Driven Flip Animation

The technical magic of this build is how it gets bitmap-quality digits to behave like mechanical flip cards. The classic approach is to hand-draw 7-segment glyphs procedurally, but that looks like a calculator — not a flip clock. Instead, this sketch pre-renders every digit as a proper bitmap at startup, then samples those bitmaps at runtime to drive the flip animation.

At boot, the sketch creates ten GFXcanvas1 buffers (one per digit, each exactly the size of a card) and prints a centered FreeSansBold24pt7b numeral into each:

Then, during the flip animation, the renderer reads pixels out of those canvases with OR-downsampling: for each output row in the compressed flap, it ORs together all the source rows that map into it, so even a 1-pixel-tall flap still shows a meaningful silhouette of the half being compressed. The result is a flip that genuinely looks like a piece of paper folding — not a digit being sliced.

Each of the four digit slots has its own independent animation timer, so hours can be idle while minutes are flipping, or vice-versa:

The flip itself runs in two phases, each lasting 175 ms (350 ms total):

Phase A (0–175 ms): the OLD top half "falls" — its height is progressively compressed toward the midline, revealing the NEW top digit behind it.

Phase B (175–350 ms): a NEW bottom flap "drops down" from the midline, growing in height until it fully covers the OLD bottom digit.

How the Code Works (the Short Version)

The sketch runs two cooperating pieces on the ESP32-S3 MINI:

Time loop. On boot, the ESP32 connects to your Wi-Fi, syncs with an NTP server, and then runs a software clock locally. Every frame, the current hour and minute are broken down into four digits and each is compared to its current displayed value. Any mismatch triggers a flip animation for just that digit. The bottom row's seconds value is read fresh every frame directly from the system clock, so it ticks visibly once per second.

Render loop. Roughly 33 times per second, the entire 128×64 frame is redrawn from scratch: the centered date header, the four flip cards (each in whatever animation phase it happens to be in), the static colon, the TZ label, WiFi signal bars, the centered greeting, and AM/PM with the current seconds. The whole frame is then pushed to the SSD1306 over I²C in a single transaction, so there's never any tearing.

No FreeRTOS gymnastics, no extra cores — just a tight, single-threaded render loop that's plenty fast for a 30+ FPS animation on the ESP32-S3 MINI's 240 MHz CPU.

Why ESP32-S3 MINI + OLED?

The ESP32-S3 MINI is one of the best beginner-friendly Wi-Fi microcontrollers you can buy: tiny (smaller than a postage stamp), USB-C native, dual-core, with built-in Wi-Fi and Bluetooth, and fully supported in the Arduino IDE. Pair it with a crisp 0.96" SSD1306 OLED and you have a platform that can drive dashboards, IoT widgets, weather stations, smart-home displays — anything you can dream up. This flip clock is a great project that teaches you Wi-Fi setup, NTP time sync, POSIX timezone handling, custom-font glyph rendering, frame-rate animation timing, and stateful per-element animation — all in one tidy, single-file sketch.

Make It Your Own

Because the firmware is open and heavily commented, you can easily:

  • Toggle USE_12_HOUR between true and false for 12- vs 24-hour display
  • Tweak ANIM_MS to make flips snappier (200 ms) or more deliberate (500 ms)
  • Swap FreeSansBold24pt7b for another Adafruit GFX font — FreeMonoBold24pt7b gives a typewriter feel, FreeSerifBold24pt7b goes editorial
  • Change the greeting cutoffs in greetingFor() to match your schedule, or replace the words with ones in your language
  • Adjust the RSSI thresholds in wifiBarsFromRssi() — if you're usually close to the router, bump them to −50/−60/−70/−80 for a more optimistic meter
  • Swap the static colons for minute-tick "breathing" dots that briefly grow before each flip
  • Add a temperature panel above the greeting by tapping into an indoor sensor or online weather API
  • Re-skin the top row with day-of-year, week number, or a custom countdown

The Full Sketch

Below is the complete flip-clock-ntp.ino sketch. Copy it into your Arduino IDE, edit the three Wi-Fi / timezone lines at the top, and flash to your ESP32-S3 MINI.

flip-clock-ntp.ino

Wiring is just four pins: VCC, GND, SDA, and SCL. If you can plug in a USB-C cable, you can build this clock.

Get Yours:

ESP32-S3 MINI + 0.96" OLED I2CESP32-S3 MINI development board with WiFi and Bluetooth - eElectronicParts



Grab the ESP32-S3 MINI + 0.96" OLED Flip Clock Kit from our store and have a working, beautifully-typeset animated NTP flip clock on your desk this weekend. Whether you're a hobbyist, a STEM teacher, or just someone who wants a smarter clock with a vintage flair and a modern face, this kit is a fun, educational, and genuinely useful build.


👉 Shop ESP32 DIY Kits at eelectronicparts.com


0 comments

Leave a comment

All blog comments are checked prior to publishing

You have successfully subscribed!