project build log

4square

A four-screen desk clock on a custom PCB, in a printed case with a clear acrylic back.

View on GitHub

Type desk gadget
Date 2026
Status complete, iterating
Finished 4square build on a desk

V1 · custom PCB · 4× SSD1306 OLEDs · printed shell

what is this?

4square is a small desk clock: four 128×64 OLED panels in a 2×2 grid, hours top left, minutes top right, weekday and date along the bottom. It started as four screen modules on jumper wires and a protoboard, and it is now a 74×74 mm board I designed in KiCad, inside a case I wrote in code with build123d, with a laser-cut acrylic back so you can see the board. Behind the screens there is a real-time clock, a temperature and humidity sensor, a light sensor for auto-dimming, three RGB status LEDs, four buttons and an EEPROM that keeps the settings.

OLEDs burn in when the same pixels stay lit, and a clock lights the same digits for months, so the firmware is written around panel lifetime. Every pixel goes through one function that shifts the image and caps the brightness, and a layout prover on my laptop checks every screen before the flash script will flash the board.


  1. Prototype

    protoboard and first enclosure prints

    • Four OLED carrier boards and the ESP32 before wiring
    • Two protoboards wired together, held over the desk
    • First enclosure face with the four OLEDs showing test patterns
    • Prototype wiring: protoboard mux breakout with four OLEDs on jumper wires
      protoboard I²C mux breakout · 4× OLEDs on jumper wires · testing before the enclosure
  2. V0

    the original build, hand-wired in a 3D-printed enclosure

    • 4square V0, the original 3D-printed build, finished
    • V0 enclosure · display faceplate · display mounts · back panel · lid
  3. V1

    custom PCB, new case, finished build

    • 4square V1 with the back off, showing the custom PCB
    • 4square V1 finished, clock face
    • 4square V1 finished, showing a four-panel page
    • 4square V1, front, showing the clock face
    • 4square V1 on the desk
    • 4square in the dark, OLEDs glowing

replacing the jumper wires with one board

The prototype and V0 were four screen modules, a mux breakout and an ESP32 joined by jumper wires and protoboard. It worked, but the wiring was fragile, it filled the case, and every rebuild meant rewiring. I replaced all of it with one carrier board. The four screens plug into the front, everything else sits on the back, and the board matches the inside of the case at 74×74 mm, which keeps the walls 2 mm thick all round.

The board is generated from code: the schematic and placement are scripts, KiCad checks the result, and an autorouter lays the copper, so every revision rebuilds from scratch. It went through revisions A to N over about a week in July. Rev C was the first square layout, rev D moved the power chain onto a centre spine, rev E added the four buttons, rev F settled on 74×74 mm with even margins around the screens, rev G turned the back into a “kit” you look at through the clear back, with axial resistors laid out as a labelled ladder, rev I added the DS3231 clock, the temperature sensor and the light sensor, and rev L moved to cheaper LEDs and labelled every part. An audit of rev L found blockers, and rev N fixed all of them: it passes DRC at JLCPCB’s manufacturing limits with 74 footprints on two layers, and JLCPCB assembles the surface-mount parts. The first batch was ordered from that design as rev O.


case CAD in build123d

The V1 case is code CAD: every part is a build123d Python script, so a change to the board becomes a changed number and a rebuild instead of an afternoon of redrawing. The printed set is rev 5, three PETG parts: a front shell that holds the four screens just below the face, and a retainer split into two halves that clamps the screens from behind. The back is rev 6, a 3 mm laser-cut acrylic panel that keeps the board visible, with two finger notches, a slotted vent over the temperature sensor and a printed standoff frame behind it. Four M3×16 self-tapping screws hold the whole stack together.

The engraving reads “SAWYER” and “SMITH” on either side of the USB-C opening, with “4SQUARE V1” in the middle, in newstroke, the same font as the board’s own silkscreen, pulled straight out of KiCad. It is engraved on the inner face so the surface you touch stays smooth. A laser marks whichever face is up, so the panel is cut inner face up and the DXF is drawn mirrored to match: in the file the text reads backwards and the vent sits top left. Once the panel is turned over and assembled, the text reads normally from outside.


buttons, pages and burn-in protection

There is no menu. Each button owns a page, and pressing it again cycles that page. A long press on MODE toggles the status LEDs, and a long press on SET opens the one settings page: light sensitivity, temperature unit, and a daily screens-off window. Settings live in a wear-levelled ring on the EEPROM, so they survive a power cut.

The stopwatch is the newest face; it replaced the stock ticker in October. It shows minutes top left and seconds top right in the clock’s outline digits, the state bottom left, hours bottom right. UP starts or resumes it from anywhere, DOWN on it pauses and then clears, and it keeps counting while you look at other pages.

Burn-in is the main way a clock on OLEDs fails, so the protection is built into the drawing path instead of left to each face. Drawing code only gets a canvas in RAM. One function copies that canvas to the panel, and on the way it shifts the image along a path that visits every offset evenly and applies a brightness cap; the light sensor dims it further at night. Because no face can write to a panel directly, every face gets the shift and the cap. The second safeguard is a layout prover that runs on my laptop: it compiles the same drawing code that ships and checks every screen the firmware can draw for overlapping elements, ink outside the safe area and the lit-pixel budget. If any check fails, the flash script refuses to flash.

The same source builds two ways. The demo build has no radio code at all and keeps time from the clock chip; it is the version I show people. The full build adds WiFi and over-the-air updates for running it at home.


firmware, demo image and build notes on GitHub

The repo has the firmware source, a prebuilt demo image you can flash with one command, the layout prover, and hardware notes with the board summary and pin map. It is MIT licensed.

github.com/partypancake8/4square_production →