Skip to the content
4 layers33.8 × 46 mmV2-baseline, the printed circuit board in 3D

I have clone the repo locally at ../Watchy

Size
33.8 × 46 mm
Copper layers
4
Thickness
1.6 mm
Parts
70
Nets
95
Pads
305
Tracks, vias
899, 358
Pours
5
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
17 Aug 2026
Updated
13 Sep 2026

Overview

V2-baseline is an open-source printed circuit board by jamesjnadeau, from the jamesjnadeau/watchy-ref-counter repository on GitHub. It is a 4-layer board of 33.8 × 46 mm with 70 parts on 95 nets, routed with 899 tracks and 358 vias.

It is built around the CP2102, ESP32-PICO-D4 and BMA423, with the ME6211C33M5G-N, PCF8563BS/4 and TP4054 among its other parts. Its parts include 20 resistors, 14 capacitors, 6 ICs, 6 diodes and 4 transistors. It belongs with the ESP32 and RISC-V boards of this library.

Main components

11

README

README.md

Intial prompt:

Based on the firmware available here:

https://github.com/sqfmi/Watchy

I have clone the repo locally at ../Watchy

I'm creating a purpose built countdown timer used for reffing a football game.

The user should see a countdown on the screen that updates every second. The count down should have 2 configurable start timers, start with 40 and 25 as defaults. The user should use the two buttons on the right hand side of the device to start the timers. The top one should be the longer value The timer buttons should have a configurable hold down before it acts as a reset of the timer, or to start the timer in general. Make it be 0.5 seconds as a default.

When the timer is up, it should buzz a configurable time, start with 1 second. Before the timer reaches a configurable number of seconds, default with 10 seconds, it should buzz a configurable number of times, start with 1. By default it should buzz once at 10 seconds.

It should count down the last 5 seconds by buzzing at each second mark. So it should buzz at 5, 4, 3, 2, and 1, then do the finall configuable buzz time. The top left button, after being held down for a configurable ammount of time, different than the above one, default 1 second, should then put the device into low power mode. The device should wake back up to normal operating mode if this button is pressed again, If in lower power mode, it should say sleeping on the display.

Please create a read me seciton below the line that documents the structure of the repo and how to install it on the device.


Watchy Ref Counter

A countdown timer for sports officials, running on a Watchy e-paper watch. Seven presets — football, lacrosse, NCAA and NFHS baseball, NCAA and NFHS softball, and a custom slot — each with two countdowns, big 7-segment digits, and a buzz pattern you can follow without looking at your wrist.

This repo stands alone. It does not link against the Watchy library; the panel is driven through GxEPD2, the RTC chips directly over I2C, and NTP through the ESP32 core's own SNTP client. Where the behaviour follows that firmware — the menu, the set-time screen, the pin map — the comments credit it, but none of its code is here. It builds with the reference repo nowhere on disk.

Controls

Watchy's four buttons, by physical position:

text
   BACK (top left)  ----+---------+---- UP   (top right)
                        |  200 x  |
   MENU (bottom left) --|  200    |---- DOWN (bottom right)
                        +---------+

Watch out for the names: on Watchy, MENU is the bottom-left button and BACK is the top-left one, which is the opposite of what they sound like.

ButtonActionDefault hold
Top rightStart, or reset, the active preset's long clock0.5s
Bottom rightStart, or reset, the active preset's short clock0.5s
Top leftEnter low power mode; hold again to wake1.0s
Bottom leftOn Ready, open the settings menu; otherwise clear the clock0.5s
Top left, twice quicklyStop or start the game clock2 taps

The two right-hand buttons always run whichever preset is active — see Sports below — rather than a fixed 40 and 25 seconds.

The bottom-left button does two jobs because on the Ready screen there is no clock to clear. Hold it there and you get the reference Watchy menu; hold it while a clock is up and it clears back to Ready.

A short tap does nothing. Every action needs a deliberate hold, so a button brushed against a sleeve mid-game cannot reset the play clock. A short confirmation buzz fires the instant a hold registers, so you know the clock started without looking down.

The one exception is the game clock. Picking a duration from the menu only arms it — a double tap of the top-left button is what starts it, the first time and every time after. Two taps stop a running clock, and two more start it again — one buzz for started, two for stopped, so the two are told apart without looking down. A single tap still does nothing, and holding that same button for a second still puts the watch into low power mode: a press long enough to be a hold is nowhere near short enough to be a tap.

Holding a timer button while that clock is already running restarts it from its full value.

Sports

The right-hand buttons run whichever preset is active. Seven ship in the box — six fixed sports plus one editable Custom slot:

NameDescription
Footballfootball
Lacrosselacrosse shot
Base NCAANCAA baseball
Base NFHSNFHS baseball
Soft NCAANCAA softball
Soft NFHSNFHS softball
Customuser set

Their clock lengths and buzz marks are in Buzz pattern, below. Football reproduces exactly what this firmware shipped with before presets existed, so a watch that has never opened the menu behaves the same as it always did.

The active choice comes from the menu's Sport row, which opens a scrolling picker: UP/DOWN moves, MENU selects and persists, BACK leaves the stored choice alone. Like the time zone, it is kept in NVS, so it survives a reflash — the sport a watch is set to is a property of who is carrying it, not of the firmware on it.

Each row shows a preset's name and its two clock values; the footer below shows the highlighted preset's description, its position in the list, and its two warning marks as warn <first>/<second>. The final-countdown value isn't there — it's 5 for every fixed preset, so it never tells two of them apart, and it's shown spelled out on the Custom editor instead, the one preset that can change it.

The six fixed presets are read-only. Edit Custom opens the one preset that can be changed: five fields — Long, Short, Warn 1, Warn 2, Final — with MENU stepping to the next field and committing once past the last one, BACK stepping back, and UP/DOWN changing the value under the cursor, the same interaction Set Time uses. The two clocks clamp to 1–199 seconds; the three marks clamp to 0–199, where 0 turns that mark off. Editing Custom does not select it — pick Custom from the Sport screen to make it active, the same separation the zone picker keeps between "known" and "in use".

Game timer

The play clock counts the interval between plays. The game clock counts the period those intervals sit inside — 8, 10, 12 or 15 minutes — and it is the first row of the settings menu, because it is the row reached for mid-game.

Menu → Game Timer → pick a duration. The press puts that duration on the clock, stopped, and closes the menu — back to Ready with the clock paused in the header. It does not start counting down until a double tap of the top-left button says go.

The game clock takes the header over from the wall clock. While one is set the top right reads 12:34 and the time of day is not shown at all; the battery gauge stays where it is. This is deliberate: during a period the number worth the space is how much of the period is left.

Above 30 seconds remaining the reading is truncated to the nearest five seconds, and the panel is refreshed only when that reading changes — so about once every five seconds, rather than once a second for fifteen minutes. At and below 30 seconds it is exact and refreshes every second. It is never rounded up: the header does not claim more time than is left.

A paused clock is drawn inverted — the digits in the background colour inside a solid block. Not blinking, which would cost a panel refresh twice a second for as long as the clock stayed stopped.

Re-opening Game Timer while a clock is set puts Stop at the top of the list. Picking a duration over a clock that has already had time taken off it — running or paused mid-period — takes two MENU presses rather than one — the footer asks for the second — because wiping a period that is actually in progress is the only irreversible thing on that screen. A clock that is armed but has never been started skips that second press: nothing has been lost, so there is nothing to confirm, and correcting the duration you just picked is the likely reason you are back on this screen at all. Stop is not gated; a period stopped by mistake is restarted from the same screen.

Low power mode does not stop the period. The remainder is handed to the RTC chip on the way down and taken back on the way up. With a game clock set the deep-sleep timer is never armed against the NTP resync schedule — only ever against the period ending, and only when the clock is actually running; a paused clock arms no timer wake at all, and sleeps on the wake button alone until somebody presses it. A period that runs out while the watch is asleep, and was still running when it went down, wakes the watch up to buzz. The RTC counts in whole seconds, so each sleep/wake cycle can cost the period up to a second — which is why the last 30 seconds, where exactness matters, are meant to be watched rather than slept through. With no RTC set there is nothing to measure a sleep against at all, so a running clock is stopped on the way into low power mode rather than losing an unknown amount of the period silently.

The automatic NTP resync is suppressed for as long as a game clock is set. Bringing the radio up blocks for several seconds with the buttons dead, which is not something to do in the middle of a period.

Buzz pattern

Every preset buzzes on the same four events, at the marks that preset sets:

EventBuzz
First warning, at warnAtSeconds remainingWARNING_BUZZ_COUNT (1) short buzz
Second warning, at warn2AtSeconds remainingWARNING_BUZZ_COUNT_2 (2) short buzzes
Final countdown, at or below finalCountdownFrom1 short buzz (150ms) on each second mark
Expire, at 01 long buzz (1000ms)

A mark of 0 turns it off — Football's second warning ships off, which is why the stock clock only ever buzzes once early. A mark that falls at or inside the final countdown is silently swallowed by the per-second buzz, which already covers it. The two buzz counts and the expire length are global, in settings.h; the marks themselves are per-preset, in RefSport.cpp:

NameLongShortWarn 1Warn 2Final from
Football402510–5
Lacrosse1202030105
Base NCAA1202030105
Base NFHS802030105
Soft NCAA902030105
Soft NFHS602020105
Custom402510–5

Every mark above is in seconds remaining, matching what the clock counts down. This is worth being deliberate about, because ReadyRef — the commercial timers this preset table is modelled on — quote their pre-warnings in seconds elapsed. Their football timer's "30 second pre-warning" on a 40 second clock is the same moment as Football's Warn 1 of 10 above: 30 seconds in is 10 seconds left. Getting that backwards would fire the warning at the wrong end of the play.

Buzzes are deliberately blocking, and fire before the screen redraws: the buzz is the cue you actually react to, and an e-paper refresh takes most of a second. This costs no accuracy, because remaining time is always recomputed from the timestamp the clock started at rather than accumulated tick by tick.

Screens

Every screen carries a battery gauge at the top right. To its left is the wall clock — or, while a game clock is set, the game clock in its place.

Ready — shown at boot and on wake. Both of the active preset's clocks stacked to line up with the two right-hand buttons that start them. The footer shows the active sport's name, in capitals, in place of HOLD TO START — the thing worth checking before kickoff is which preset is loaded, not how the buttons work.

Running — the current clock, large, updating every second. The header is the same wall clock and battery gauge every screen carries; it does not say which of the two clocks is counting.

Time expired — 00 holds for EXPIRED_HOLD_MS (3s), long enough to register the delay of game, then the watch drops back to Ready on its own. Starting a new clock during that window cancels the return.

Game over — the period has run out. GAME / OVER in the large face, PRESS ANY BUTTON in the footer, 0:00 still in the header. The buzzer runs three buzzes every 2.5 seconds until a button goes down, and stops repeating after GAME_OVER_BUZZ_TIMEOUT_MS (60s) so a watch left in a bag cannot buzz its battery flat — the screen stays either way. The press that dismisses it does nothing else: it will not sleep the watch or start a play clock on the way out. A play clock still counting down when the period ends is abandoned.

Sleeping — low power mode.

Menu — held open from Ready. Navigation follows the reference: UP/DOWN to move, MENU (bottom left) to select, BACK (top left) to leave. It also drops back to Ready by itself after MENU_TIMEOUT_MS, so a menu opened by accident cannot strand you mid-game. Nine entries do not fit the panel at once, so the list scrolls a seven-row window, keeping the highlighted entry in view the same way the time zone picker already does. One of the nine is conditional — Sync NTP — and without it eight rows remain, which still scrolls by one.

Every screen the menu opens times out on the same rule, and a timeout always discards: Set Time leaves the clock alone, Edit Custom leaves the stored preset alone, and the two pickers leave their stored choice alone. Only pressing MENU past the last field commits. This matters more than it sounds — these screens repaint about twice a second, so one left open would otherwise hold the panel refreshing until the battery went flat.

EntryWhat it does
Game TimerArm an 8, 10, 12 or 15 minute game clock, or stop one that is set
AboutVersion, board name, battery, time, uptime, last sync, RTC type
Sync NTPConnect and set the clock from NTP_SERVER. Only listed once Setup WiFi has connected
TZ: namePick a US time zone from a scrolling list
DST: Auto/OffTurn the daylight saving rule on or off
Set TimeSet the clock by hand, no WiFi needed
Setup WiFiCaptive portal to save credentials
Sport: namePick one of the seven presets from a scrolling list
Edit CustomSet the five Custom fields by hand

The Game Timer, Sport, TZ and DST rows show their current value rather than fixed text, so the menu doubles as the status display for all four. DST toggles in place and redraws with a fast partial refresh; everything else opens a screen.

Sync NTP is hidden until Setup WiFi has connected successfully, since with no credentials stored it could only ever report a failure. The watch remembers that in NVS (RefWifi.cpp), so it survives a reflash — but a watch upgraded from a firmware without that flag has nothing stored and will hide the row until Setup WiFi is run once more. A setup that fails or times out clears the flag again, correctly: that screen wipes the saved credentials before it raises its access point.

There is no "Show Accelerometer". The reference has one, but nothing on a play clock reads the sensor, and leaving it out means the BMA423 is never powered up at all. There is no "Vibrate Motor" buzz test either — the buzzer announces every warning mark and every expiry, so a dedicated screen for it earned a menu row it did not need.

Time zones and daylight saving

The RTC holds UTC. The zone offset is applied on the way out, every time the clock is read, which is what makes the two menu entries cheap: changing zone or flipping the DST switch takes effect on the next redraw and never rewrites the clock chip.

The TZ entry lists all eleven US zones by name, with their standard offset on the row and the abbreviations and region underneath:

ZoneStandardDaylightWhere
EasternUTC−5 ESTEDTNY, DC, Atlanta, Miami
CentralUTC−6 CSTCDTChicago, Dallas, Minneapolis
MountainUTC−7 MSTMDTDenver, Salt Lake, Albuquerque
ArizonaUTC−7 MST—most of Arizona
PacificUTC−8 PSTPDTLA, Seattle, SF, Las Vegas
AlaskaUTC−9 AKSTAKDTmost of Alaska
AleutianUTC−10 HSTHDTwestern Aleutians
HawaiiUTC−10 HST—Hawaii
SamoaUTC−11 SST—American Samoa
AtlanticUTC−4 AST—Puerto Rico, USVI
ChamorroUTC+10 ChST—Guam, N. Marianas

DST: Auto means the US federal rule is applied when the date calls for it — forward at 02:00 local standard on the second Sunday in March, back at 02:00 local daylight on the first Sunday in November — not that the clock is shifted year round. Nothing needs doing at a changeover: the offset is computed from the instant being displayed, so the watch is right on both sides of it and right again if it is rebooted or asleep across it. DST: Off pins the zone to standard time all year. The five zones with no daylight saving ignore the switch either way.

Both settings are stored in NVS, so they survive a reflash — the zone is a property of where the watch is, not of the firmware on it. DEFAULT_TIME_ZONE and DEFAULT_DST_AUTO in settings.h are only the starting point, used until the menu has been used once.

The rule is the one in force since 2007 (Energy Policy Act of 2005). It is verified against the real transition dates for 2024–2027 and 2030 in every zone; see Testing below. Set Time is exact except for the one hour a year that springing forward deletes — typing 02:30 on that morning stores 01:30, because 02:30 never happens.

Timekeeping

The time comes from the watch's RTC chip, which RefRtc probes for at boot — a PCF8563 at 0x51 on the V2.0, an RV-3028-C7 at 0x52 on the C6 board. It keeps running through low power mode and through a reflash, so the watch only needs setting once. The About screen reports which one was found.

The chip is kept in UTC, not local time. That is what lets the zone and DST settings change with no clock write and no drift, and it means an NTP sync needs no offset applied to it.

Drift is handled two ways. Set Time sets it by hand, in local time. Sync NTP sets it from the internet, on demand from the menu. It also runs itself automatically once WiFi credentials have been saved, on a schedule that needs both of these to be true: the watch has sat untouched — no button press, no sleep entry — for NTP_RESYNC_HOURS (3 by default), and at least NTP_MIN_SYNC_INTERVAL_HOURS (24) have passed since the last attempt, so a run of idle moments in a row cannot trigger back-to-back radio activity. Sleep entry counts as activity in its own right, so putting the watch away resets the quiet clock rather than letting it tick through the night. Set NTP_RESYNC_HOURS to 0 to only ever sync by hand. A PCF8563 drifts roughly a minute a month, so even a daily sync keeps that under a second. The C6 board's RV-3028-C7 is factory trimmed to about half a minute a year, and needs the sync far less.

The two chips do not share a register layout, and the difference is the kind that fails quietly: the PCF8563 holds the date at 0x05 and the weekday at 0x06, while the RV-3028 has the weekday at 0x03 and the date at 0x04. Decoding one with the other's map yields a day of the month between 0 and 6 — wrong, but shaped like a date. tests/rtc_test.cpp pins both layouts against a stub I2C bus, which is the only part of this that can be checked without hardware.

An automatic sync blocks for several seconds while the radio comes up, which is why it waits for quiet rather than firing the moment nobody is looking. That holds even in low power mode: the watch arms a deep-sleep timer against the same schedule, wakes itself when a sync falls due, syncs, and goes straight back to sleep — the SLEEPING screen already on the panel is never touched. It never runs while a clock is counting.

The header clock is repainted on its own partial window when the minute rolls over, so keeping it live costs one ~400ms refresh a minute rather than a whole screen. It is deliberately not updated while a clock is counting down: the tick path stays reserved for the countdown, so the time can sit stale for as long as the active clock runs — up to 199s on Custom at its ceiling — and catches up as soon as the clock stops.

Repo structure

text
watchy-ref-counter/
├── README.md          this file
├── platformio.ini     build config; one env per supported board (V2.0, C6)
└── RefCounter/        the sketch (also a valid Arduino IDE sketch folder)
    ├── RefCounter.ino main loop and the IDLE/RUNNING/EXPIRED/GAME OVER/
    │                    SLEEPING states
    ├── settings.h     every tunable number, and nothing else
    ├── board.h        the pin map, per revision, and button polarity
    ├── Buttons.h/.cpp debounced reads with one-shot hold detection
    ├── Buzzer.h/.cpp  vibration motor
    ├── RefPanel.h/.cpp    the GxEPD2 panel instance and its pins
    ├── RefDisplay.h/.cpp  screen layout and e-paper refresh strategy
    ├── RefRtc.h/.cpp      the PCF8563 and RV-3028-C7 clocks, over I2C
    ├── RefClock.h/.cpp    timekeeping, NTP sync, battery
    ├── RefZone.h/.cpp     US time zones and the daylight saving rule
    ├── RefSegments.h/.cpp  where the countdown digits land, host-tested
    ├── RefSport.h/.cpp     sport presets and the custom slot
    ├── RefGameClock.h/.cpp the game clock, host-tested
    ├── RefDoubleTap.h/.cpp the two-tap gesture, host-tested
    ├── RefWifi.h/.cpp      whether WiFi has ever been set up, host-tested
    ├── RefMenuItems.h/.cpp the menu's row order and labels, host-tested
    └── RefMenu.h/.cpp      the settings menu

Dependencies

Three libraries, all from the registry:

LibraryFor
GxEPD2the GDEY0154D67 panel, including fast partial update
Adafruit GFXfonts and primitives
WiFiManagerthe captive portal behind "Setup WiFi"

Everything else is either this project's own or comes with the ESP32 Arduino core. Notably there is no RTC library: each RTC is a handful of BCD registers, and talking to them directly avoids a dependency that caused trouble — one whose master no longer compiles against a current core.

The folder is named RefCounter/ so it satisfies the Arduino IDE's rule that a sketch folder match its .ino, while platformio.ini points src_dir at the same folder. One copy of the source, two build systems.

Design notes

Why none of the Watchy library is used. Its Watchy::init() is the whole lifecycle — wake, draw one frame, deep sleep — and it ends in deepSleep() without returning, which cannot work for a clock that ticks every second. That alone forced an own main loop. Reusing just the menu then proved impossible too: Watchy::showMenu() hard-codes six entries, and showBuzz(), setTime() and showSyncNTP() each finish by redrawing it, so "Show Accelerometer" could not be dropped without it flashing back for 2.6s after most actions. With the menu written here anyway, the remaining pieces — a GxEPD2 wrapper, two RTC chips and an NTP call — were smaller than the dependency they justified.

Digits are drawn, not typed. The countdown is seven filled rectangles per digit rather than a font glyph. That keeps the countdown's exact bounding box knowable, which is what lets the partial-update window below be hard-coded safely — the claim now rests on layoutCount in RefSegments.cpp, which is host-tested against its own 199 ceiling, rather than on the countdown always being exactly two digits — and it drops the 14KB DSEG7 font from the build. The segment geometry is four numbers (SegStyle) per size, instantiated in RefDisplay.cpp, so resizing the digits is a one-line change.

Refresh strategy. Four tiers, cheapest first:

CallAreaCostUsed for
renderHeader()200x40 window~280msthe header's own reading changing
renderDigits()200x124 window~280msevery second of a running clock
render(v, false)whole screen, partial~400msstate changes (start, expire, wake)
render(v, true)whole screen, full~2.6sreturning to Ready

renderHeader() fires whenever the header's own reading changes: the wall clock's minute rolling over, or, while a game clock is set, that clock's reading moving on -- about once every five seconds above GAME_EXACT_FROM_SEC, once a second at or below it.

renderDigits() repaints only the countdown into the framebuffer and calls GxEPD2's displayWindow(), so only 62% of the panel is driven — the header, footer and battery are left standing. The window widened from 176px to the full 200px so it always covers the skinny hundreds bar; the extra cost every second is the price of never leaving a stale leading 1 behind when a clock crosses back under 100.

Partial refreshes leave faint ghosting, and only a full refresh clears it. Both routes back to Ready arrange for one -- except a Ready screen with a game clock running, where nothing schedules one until the period ends or is paused:

  • A clock expires. 00 holds for three seconds, then the return to Ready is itself the full refresh. One redraw does both jobs, and by then play has stopped.
  • You clear it by hand. The return is a partial refresh, so the button responds in ~400ms rather than freezing for 2.6s. The full refresh is queued for SCREEN_TIDY_DELAY_MS later and only fires once nothing is happening; starting a clock cancels it.
  • A game clock is paused, or resumed above GAME_EXACT_FROM_SEC. Same deferred full refresh as clearing by hand. Pausing always schedules one -- the inverted block it draws is the worst case there is for residue -- but a resume only schedules one above the exact zone; at or below it the resume cancels any pending tidy outright instead, because the 2.6s stall would cost more than the residue it clears there, and nothing can run the game clock's own tick while it blocks. A period that runs start to finish with nobody touching it gets no full refresh at all until it ends.

In every case the 2.6s stall never lands mid-down.

Power. The CPU drops to 80MHz, and the watch light-sleeps between button polls whenever no clock is running, waking on a button GPIO with a 250ms timer as a backstop. Low power mode is a real deep sleep with an ext1 wake on the top-left button, plus — as long as no game clock is set — a timer wake armed against the NTP resync schedule so the watch can correct its clock unattended. Set LIGHT_SLEEP_WHEN_IDLE to false in settings.h to fall back to plain polling if your board misbehaves.

Accuracy. The countdown is derived from esp_timer_get_time() against the main crystal. Light sleep during e-paper busy-waits is accounted for using the calibrated RTC slow clock, which drifts a fraction of a percent — on the order of a tenth of a second across a 40 second count.

Configuring

Everything lives in RefCounter/settings.h. The ones you are most likely to touch:

c
static const char     DEFAULT_SPORT[]      = "Football"; // until set in the menu
static const uint16_t CUSTOM_LONG_SECONDS  = 40;  // the Custom slot's factory
static const uint16_t CUSTOM_SHORT_SECONDS = 25;  //   values, likewise only a
static const uint16_t CUSTOM_WARN_SECONDS  = 10;  //   starting point
static const uint16_t CUSTOM_WARN2_SECONDS = 0;   // 0 = off
static const uint16_t CUSTOM_FINAL_FROM    = 5;
static const uint32_t TIMER_HOLD_MS        = 500;  // hold to start / reset
static const uint32_t SLEEP_HOLD_MS        = 1000; // hold for low power mode
static const uint32_t BUZZ_EXPIRE_MS       = 1000; // buzz at zero
static const uint8_t  WARNING_BUZZ_COUNT   = 1;    // buzzes at the first mark
static const uint8_t  WARNING_BUZZ_COUNT_2 = 2;    // buzzes at the second
static const uint16_t GAME_EXACT_FROM_SEC  = 30; // exact from here down
static const uint16_t GAME_COARSE_STEP_SEC = 5;  // coarse grid above it
static const uint32_t GAME_TAP_MAX_MS      = 400; // longer is a hold, not a tap
static const uint32_t GAME_DOUBLE_TAP_MS   = 500; // window between two taps
static const uint8_t  GAME_OVER_BUZZ_COUNT = 3;   // buzzes per cycle at zero
static const uint32_t GAME_OVER_CYCLE_MS   = 2500; // and how often they repeat
static const bool     DARK_MODE           = true;  // true = white on black
static const bool     CLOCK_24_HOUR       = false;
static const char     DEFAULT_TIME_ZONE[] = "Eastern"; // until set in the menu
static const bool     DEFAULT_DST_AUTO    = true; // apply the US rule by date
static const uint32_t NTP_RESYNC_HOURS    = 3;  // 0 = only sync by hand
static const uint32_t NTP_MIN_SYNC_INTERVAL_HOURS = 24; // floor since last try

DEFAULT_SPORT and the five CUSTOM_* values are likewise only a starting point. The clock lengths themselves moved to the on-watch menu — Sport picks among the six fixed presets, and Edit Custom changes the Custom slot's numbers on the watch, with both choices kept in NVS across a reflash. Editing these constants and reflashing only changes what a watch starts on before anyone has touched its menu.

DEFAULT_TIME_ZONE and DEFAULT_DST_AUTO are only defaults — the menu's TZ and DST entries override them and the choice is kept in NVS across reflashes.

The four game clock durations are not here. They are a table in RefGameClock.cpp — 8, 10, 12 and 15 minutes — because they are the shape of the feature rather than something to tune. GAME_OVER_BUZZ_MS, GAME_OVER_GAP_MS and GAME_OVER_BUZZ_TIMEOUT_MS are in settings.h too, left out of the block above only because they are rarely worth touching.

DARK_MODE flips the whole theme, panel border included. The stock Watchy 7_SEG face ships with its own DARKMODE true, which is why it is white on black; there is no inversion in the display driver itself.

Clock values are limited to 1–199. The display draws two full-size digits plus, for 100 and up, a skinny leading 1 — just the two vertical bars of a 1, one segment thick — to their left; the two full digits shift right to make room. There is no room for a fourth glyph, which is why 199 is the ceiling.

The timing values are no longer reflash-only: they sit behind the on-watch Sport and Edit Custom entries, which need a deliberate hold from the Ready screen to reach and time out on their own if left open, the same protection against a fumbled button that the rest of the menu has. The six fixed presets cannot be edited at all — only the Custom slot can, and only from the watch.

If the buttons on your unit sit in different positions than the diagram above, swap the four role defines at the bottom of RefCounter/board.h rather than editing the sketch.

Installing

This firmware supports two boards: the Watchy V2.0 (ESP32) and this repo's own ESP32-C6-MINI-1 design in board-files/. V1.0, V1.5 and V3 were dropped — the V1 revisions put the up button and the battery tap on other pins, V1.0 carries a different RTC chip entirely, and V3's ESP32-S3 target has been superseded by the C6 board. board.h stops the build if any of their revision flags is set, rather than flashing a pin map built for other hardware.

Option A — PlatformIO (recommended)

Requires PlatformIO Core or the VS Code extension.

Nothing to check out first — the three libraries are pulled from the registry on the first build. Plug the watch in, then build and flash. Pick the env for your board — watchy_v2 (the default) or watchy_c6:

bash
pio run -e watchy_v2 -t upload

watchy_c6 pulls a different PlatformIO platform — the pioarduino fork — because the official espressif32 tops out at Arduino-ESP32 2.0.17, which has no ESP32-C6 support at all. Note that the board has never been fabricated, so nothing in that env has run on anything.

The first build downloads about 1.5GB of ESP32 toolchain and takes a few minutes; later builds take under a minute.

Option B — Arduino IDE

  1. Board support. In Preferences → Additional Board Manager URLs add: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json then install esp32 (2.0.5 or newer) from Tools → Board → Boards Manager.

  2. Libraries. Tools → Manage Libraries, then install GxEPD2, Adafruit GFX Library and WiFiManager (tzapu). Accept the dependency prompts. Do not install the Watchy library; this sketch does not use it.

  3. Board target. Tools → Board → ESP32 Arduino → ESP32 Dev Module for the V2.0. The pin map is this project's own, so the board only has to be the right chip. (The C6 board is PlatformIO-only here; the IDE's ESP32-C6 support depends on a 3.x core that this project does not otherwise require.)

    Then set the revision. The IDE has no build-flag field, so uncomment this line near the top of RefCounter/board.h — it has to go in that header, which every source file includes, not in the .ino, which would only set it for itself:

    c
    // #define ARDUINO_WATCHY_V20

    Under PlatformIO this is handled by build_flags and no edit is needed.

    Also set Tools → Partition Scheme to Huge APP, or the WiFi stack will not fit.

  4. Open and upload. Open RefCounter/RefCounter.ino, select the serial port under Tools → Port, and hit Upload.

If upload fails

The watch must be awake to enumerate over USB. If it is in low power mode, hold the top-left button to wake it first.

On the C6 board, there is no button to hold: the download-boot strapping pin is IO9, and this board deliberately puts no button on it, so a stuck or dirty button can never drop the watch into the bootloader by accident. Forcing download mode means shorting the TP1 test pad to ground at reset. The V2.0 has no button on GPIO 0 and relies on the USB serial chip's auto-reset instead, so there is no button to hold there either; if auto-reset is not working, it is a cable or port problem rather than a timing one.

Testing

RefZone.cpp, RefSegments.cpp, RefSport.cpp, RefWifi.cpp, RefMenuItems.cpp, RefGameClock.cpp and RefDoubleTap.cpp carry no panel, no GPIO and no radio, so they compile on a host and the daylight saving rule, the digit layout, the preset table, the WiFi flag, the menu's row order, the game clock and the two-tap gesture are all checked off the watch — this is exactly the kind of bug (a changeover date, a digit running off the panel, a clamp, a menu row in the wrong place) that is expensive to find on hardware and cheap to catch here.

bash
./tests/run.sh

tests/tz_test.cpp walks the exact transition instants for 2024, 2025, 2026, 2027 and 2030, checks January and July in all eleven zones, checks that DST: Off pins every zone to standard time, and round-trips 1,460 local times through local → UTC → local. tests/tz_edges.cpp prints what Set Time does inside the two transition hours. Both build the shipped RefZone.cpp against a stub Preferences that reports nothing stored, so the settings.h defaults apply.

tests/segments_test.cpp pins layoutCount's numbers for the two styles the panel actually uses — the two-digit and three-digit layouts, the exact pixel x positions, the 100/99 boundary where the hundreds bar appears and disappears, and clamping above 199 — then checks, exhaustively and for both the big (RUNNING/EXPIRED) and small (Ready) styles, that no digit runs off either edge of the panel for every value 0 through 199. SMALL is not a theoretical case: the Ready screen draws both of the active preset's clocks in it, and Lacrosse, Base NCAA and Custom all reach past 100. It checks layoutRows the same way, including the invariant that the upper, middle and lower segment rows abut with no gap or overlap.

tests/sport_test.cpp checks the shipped preset table against the numbers in Buzz pattern above, that Custom is always the last entry, that an out-of-range index falls back to the first preset rather than reading off the end of the table, and that every name and description fits the menu row and picker footer they render into. It also exercises persistence itself: the stub Preferences gained a switch (PreferencesStub::enable) so a test can turn storage on, which the time zone tests deliberately never do. With it on, sport_test confirms the selected sport and the edited Custom fields both survive a simulated reboot (a fresh RefSport::begin() call), and that a garbage index left in NVS clamps back to the first preset rather than being trusted.

tests/game_clock_test.cpp covers the whole game clock: that a pause and a resume neither lose nor invent time, that the expiry edge fires exactly once and never again, that the header's reading is coarse above 30 seconds and exact below it and — checked at every second of the longest clock — never rises and never claims more time than remains, that every value fits the five glyphs the header is laid out around, and that a clock frozen for a deep sleep comes back with the right remainder, including one that slept clean past its own end and must still produce the edge its buzz hangs off.

tests/double_tap_test.cpp covers the gesture: two taps inside the window and two just outside it, a press one millisecond past the tap ceiling and a full sleep hold (neither is a tap, and both clear whatever tap was banked), a third tap starting a fresh pair rather than completing a second one off the same press, and a pair straddling millis() wrapping.

tests/wifi_test.cpp checks that a watch with nothing stored — or with NVS unavailable — reads as never set up, and that the flag survives a simulated reboot in both directions.

tests/menu_items_test.cpp pins the menu's row order with and without its one conditional row, that Sync NTP is absent until WiFi is set up, and that Setup WiFi shifts from slot 5 to slot 6 as that row appears above it — which is the case the menu's redraw depends on, since running Setup WiFi inserts a row above the one the user is standing on. It also checks that every label fits the 18 glyphs the panel has room for, and that the removed buzz test has not crept back in.

Nothing else here has automated tests, and none of this has run on hardware — see below.

tests/board_test.cpp and tests/board_c6_test.cpp add a second kind of check: they assert the V2.0 and C6 pin maps and each board's BOARD_NAME, which until now nothing did for the C6 at all. tests/run.sh then compiles board.h three more times, once per retired revision flag, to confirm each is rejected rather than quietly building the V2.0 map.

tests/rtc_test.cpp runs the real RefRtc against a stub I2C bus (tests/stub/Wire.h), where a device is a flat file of registers. It covers both chips' BCD decoding, both register layouts, the two "the time is not set" flags — the PCF8563's low-voltage bit and the RV-3028's power-on reset bit — and a write-then-read round trip. Mutating the RV-3028 reader to use the PCF8563's date register, or to skip the power-on reset check, fails it.

Known limitations

  • None of this has been run on a watch. It builds clean for both supported boards and the time zone, digit-layout and sport-preset logic are tested on a host, but no part of it has been exercised on real hardware. The least proven pieces are RefPanel::begin() (GxEPD2's stock init rather than the reference firmware's tuned one), light sleep, and whether the four buttons are physically where board.h says they are. RefRtc's BCD decoding and chip probing used to head that list; they are now covered by tests/rtc_test.cpp against a stub bus. That covers the register layouts, the BCD conversion in both directions and the failure paths; it says nothing about whether either chip answers at its address on a real board, and the stub models none of clock stretching, arbitration or the RV-3028's bus timeout.
  • Sport presets add their own untested territory: whether the leading 1 actually clears from the panel when a clock crosses 100 → 99 (the widened refresh window is the fix; only a real panel confirms it), whether nine menu rows scroll legibly with the highlight landing on the right row, and whether the Custom editor's five rows fit without the descenders clipping. NVS is assumed to survive a reflash for the refsport namespace the way it reportedly does for refzone, but that has never been confirmed either.
  • Longer presets mean longer runs of partial refreshes: a 40s Football clock was already 39 consecutive displayWindow ticks before the deferred full refresh, but a 120s Lacrosse clock is 119 and Custom at its 199 ceiling is 198. The full refresh on the way back to Ready still runs and still clears it, so nothing is broken, but how much ghosting a run that long leaves on a real panel in between is untested like everything else here.
  • The game clock's header is the same untested bet as the digits above, over a longer run: about 204 window refreshes across a fifteen minute period, with no full refresh in between. A pause always schedules one, because the inverted block it draws is the worst case for residue; a resume schedules one only above GAME_EXACT_FROM_SEC, and at or below it cancels any pending tidy outright instead, because a 2.6s stall in the last 30 seconds costs more than the residue it clears -- the watch cannot see the period expire while the refresh blocks. A period that runs start to finish above the zone with nobody touching it gets none until it ends. Dismissing GAME OVER does a full refresh, so it is cleared then -- how much it accumulates before then is unknown, like everything else here.
  • Buttons are not sampled during a buzz or a screen refresh. A hold that starts and ends inside one of those windows is missed; a hold you keep held is always caught, up to ~400ms late.
  • The GAME OVER screen does not sleep. Every other waiting path drops into light sleep between button polls; this one spins at 20ms for as long as the screen is up, which is until somebody presses something. The buzzing stops on its own after a minute, but a watch left showing GAME OVER goes on drawing active-CPU current until it is dismissed. Reaching the light sleep helper from there would mean the sketch's first forward declaration or moving the helper above the Game Over pair, and a sleep path inside an alarm is not something that can be tested here.
  • The game timer adds its own untested territory: whether the header's swap between the wall clock and the game clock leaves no ghost of the other behind on a real panel, whether the inverted block behind a paused clock actually clears the battery gauge at the pixel level, and whether a double tap is comfortable to perform on a watch with these buttons at all. The thresholds (GAME_TAP_MAX_MS, GAME_DOUBLE_TAP_MS) are a guess that has never been tried by a thumb.
  • A period expiring while a menu sub-screen is open — Set Time, Edit Custom, either picker, either sync screen — is not noticed until that screen returns, which is up to MENU_TIMEOUT_MS (15s) late. The menu's own top level does notice and gives up, so the common case is covered; the sub-screens each run their own polling loop and none of them knows about the game clock.
  • A double tap performed entirely inside a light sleep window, a buzz or a panel refresh can be missed, the same way a hold can — buttons are not sampled during any of those windows, whatever gesture is riding on them. The press that wakes the watch out of light sleep is caught, so in practice this is the second tap of a pair landing inside a refresh that the first tap started.
  • Carrying a period through low power mode costs up to a second of it per sleep/wake cycle, because the RTC counts in whole seconds. Sleeping the watch repeatedly during a period will drift it.
  • Continuous running is the worst case for battery. Expect several hours of active use on a full charge; use low power mode between games.
  • Bringing up WiFi for an NTP sync blocks for several seconds, and buttons are ignored for that whole time. It only happens after the watch has sat untouched for NTP_RESYNC_HOURS (3 by default) hours, and never during a countdown, but it is a real pause if you catch it.
  • Only US time zones are listed. Elsewhere, pick whichever standard offset matches and turn DST off, or add a row to the table in RefZone.cpp.
  • The daylight saving rule is the current US one, hard-coded. If Congress makes daylight saving permanent, this needs a firmware change.
  • The firmware measures 1.21MB of the 3MB huge_app partition and 52KB of RAM on the C6, and 1.11MB / 56KB on the V2.0. Comfortable on both. Dropping the Bluetooth time sync took 396KB off the C6 and 739KB off the V2.0, which is the BLE stack no longer being linked in.
  • [env] does not pin platform = espressif32, and the C6 environment installs the pioarduino fork under exactly that name. Once the C6 has been built on a machine, watchy_v2 resolves to that fork too and quietly builds on Arduino-ESP32 3.x rather than the 2.0.17 the comments in platformio.ini describe. Both cores compile this source, so nothing breaks — but the V2.0 firmware you get depends on what else you have built, which is not a property a reproducible build should have.

Parts

70
QtyValueFootprintReferences
910KResistors_SMD:R_0402R1, R4, R5, R6, R7, R8, R10, R14, R15
71uF/50VCapacitor_SMD:C_0603_1608MetricC2, C5, C6, C7, C8, C9, C10
4BTNWatchy:K2-1114SA-A4SW-06SW1, SW2, SW3, SW4
4MBR0530Diodes_SMD:D_SOD-123D1, D2, D3, D4
34.7uF/50VCapacitors_SMD:C_0805C3, C4, C12
2100KWatchy:R_0402R19, R20
2100KResistors_SMD:R_0402R12, R13
2100nFCapacitor_SMD:C_0603_1608MetricC1, C14
21KResistors_SMD:R_0402R16, R17
24.7KResistors_SMD:R_0402R2, R3
24.7uFCapacitor_SMD:C_0402_1005MetricC11, C13
2GNDTestPoint:TestPoint_Pad_D1.0mmTP5, TP6
110uH 1AInductors:Inductor_Taiyo-Yuden_NR-40xxL1
11N4001Diodes_SMD:D_SOD-123FD6
1220KWatchy:R_0402R18
13Resistors_SMD:R_0402R9
132.768KHzCrystal:Crystal_SMD_3215-2Pin_3.2x1.5mmY1
13V3TestPoint:TestPoint_Pad_D1.0mmTP4
1680KWatchy:R_0402R11
1AO3400ATO_SOT_Packages_SMD:SOT-23Q1
1BMA423Housings_LGA:LGA-12_2x2mm_Pitch0.5mmU4
1BatteryWatchy:1.25T-2PWT (Molex 532610271)J3
1CJ2301TO_SOT_Packages_SMD:SOT-23Q4
1CP2102Housings_DFN_QFN:QFN-24-1EP_4x4mm_Pitch0.5mmU3
1ESP32-PICO-D4Housings_DFN_QFN:QFN-48-1EP_7x7mm_Pitch0.5mmU1
1FPC24(0.5MM)Watchy:24_Pins_0.5mm_Pitch_ZIF_Connector_UPJ1
1GPIO0TestPoint:TestPoint_Pad_D1.0mmTP1
1LEDLEDs:LED_0603D5
1LOGOWatchy:sqfmi_duckG***
1LOGOWatchy:sqfmi_logoG***
1ME6211C33M5G-NTO_SOT_Packages_SMD:SOT-23-5U2
1Micro USBWatchy:USB_Micro-BJ2
1PCF8563BSPackage_DFN_QFN:DFN-10-1EP_3x3mm_P0.5mm_EP1.7x2.5mmU6
1S8050TO_SOT_Packages_SMD:SOT-23Q5
1SCLTestPoint:TestPoint_Pad_D1.0mmTP2
1SDATestPoint:TestPoint_Pad_D1.0mmTP3
1SWRA117DWatchy:SWRA117DAE1
1TP4054TO_SOT_Packages_SMD:SOT-23-5U5
1UMH3NTO_SOT_Packages_SMD:SOT-363_SC-70-6Q2
1Vibration_MotorWatchy:Motor_HeaderM1

The 69 most common of 70 parts.

More from jamesjnadeau/watchy-ref-counter

1
  • 4 layers33.8 × 46 mmWatchy ref c6, the printed circuit board in 3D

    Watchy ref c6

    jamesjnadeau/watchy-ref-counter

    I have clone the repo locally at ../Watchy

    62 parts

Similar boards

  • 2 layers33.8 × 46 mmWatchy, the printed circuit board in 3D

    Watchy

    xywatch/watchy-hardware-v2

    watchy hardware v2 with typec

    64 parts8
  • 2 layers25.4 × 12.7 mmMorphwatch, the printed circuit board in 3D

    Morphwatch

    ccadic/The603-200

    One of the most strange Vintage Connected Watch project - 192 LED and ESP32

    40 parts110Apache-2.0
  • 2 layers33.8 × 46 mmWatchy, the printed circuit board in 3D

    Watchy

    MrT-Stephens/Watchy-MrT-Stephens

    This is my version of the Watchy by sqfmi and the website is "https://watchy.sqfmi.com".

    63 parts1
  • 4 layers91.4 × 88.4 mmSAcre, the printed circuit board in 3D

    SAcre

    Cosmin-DB/SAcre

    Diseño electrónico de un dispositivo portátil basado en ESP32.

    93 parts
  • 2 layers49.7 × 31.7 mmCommBadge, the printed circuit board in 3D

    CommBadge

    romanvrable/openmic

    Open, as in open source, audio processing code and PCBs

    47 parts2GPL-3.0
  • 4 layers33.8 × 46 mmMorphWatch STM32, the printed circuit board in 3D

    MorphWatch STM32

    deebot/MorphWatch-STM32

    The Repo contains KiCAD hardware files and software for Morph Watch

    64 parts12
  • 2 layers38 × 60 mmCrossometer mini, the printed circuit board in 3D

    Crossometer mini

    fredszaq/crossometer-mini

    Design files for crossometer-mini device

    63 parts2CERN-OHL-S-2.0
  • 4 layers87 × 87 mmEboard, the printed circuit board in 3D

    Eboard

    pacew/eboard

    103 parts

Questions

How big is the V2-baseline PCB?

It measures 33.8 × 46 mm and has 4 copper layers, 1.6 mm thick.

What parts does the V2-baseline use?

70 parts, built around the CP2102, ESP32-PICO-D4, BMA423 and ME6211C33M5G-N. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the V2-baseline KiCad files?

From the jamesjnadeau/watchy-ref-counter repository on GitHub, at the commit this page was made from: the board is board-files/elec/layout/v2-baseline.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the V2-baseline design in my own project?

Its repository states no licence, so its author keeps all rights: ask jamesjnadeau before reusing the design.