TL;DR
Two modes
- WORK — 25 min by default, the bar goes green → orange → red.
- BREAK — 5 min by default, the bar goes blue → light blue.
- Power-on always starts WORK.
- Every session starts with a 5-second grace period (yellow for WORK, violet for BREAK), then a beep, and the countdown begins.
Buttons (they work the same in WORK and BREAK; B changes the length of the mode you are in)
| Button | Press | Hold |
|---|---|---|
| M5 (front, under the screen) | Screen dark: show the time (like a pose change). Screen on: restart the current mode (on release); press again within 5 s → switch WORK ⇄ BREAK. While 00:00 blinks: start the other mode. |
1.5 s: sound on / off. 3 s: tap-to-wake in horizontal poses on / off. The screen shows what releasing will do. |
| B (right side) | 1st press only shows the length for a second, then the countdown (the session keeps running). Each next press +1 min (1–60), and 1 s after the last press a new session starts with it. | Adds minutes quickly. |
| Power (left side) | Off: switch on. On, screen lit: sound on / off. | 1.5 s: tap-to-wake in horizontal poses on / off. 6 s: switch off. |
On the StickS3 the power button belongs to the power chip and the firmware cannot see it: a press switches on or restarts, a double press switches off, holding it enters flashing mode. Use the M5 button holds for sound and tap there.
Poses
- Face down → pause (screen off, deep sleep).
- Face up again → resume exactly where it stopped.
- Flat or on a long edge → landscape. On edge B the image flips.
- On its end (USB up or down) → portrait.
- Tapping the table shows the time for 5 s. On its end this always works; in horizontal poses only with
TAPon. - Once a minute the remaining minutes fade in and out for 5 s.
When a session ends (beeps, then 00:00 FINISHED blinks for 2 min)
- Move it to another pose and hold it for 1 s (edge A ⇄ edge B, or from its end onto its side) → the other mode starts: WORK → BREAK, BREAK → WORK.
- Face down, then face up → the same mode starts again.
- M5 → same mode (press again within 5 s to switch).
- B → a single press shows the length (the blinking goes on); more presses set a new length and start.
- Do nothing → after the 2 minutes of blinking it goes into deep sleep. Then only two things wake it: the M5 button, or turning it face down for about a second and back to any visible pose. Both start the same mode again; changing the pose or pressing B no longer does anything.
Supported models (the board is detected at boot; one firmware for the ESP32 models, a separate build for the ESP32-S3)
| Model | Status | Notes |
|---|---|---|
| M5StickC (original) | ✅ tested | No buzzer: the red LED blinks instead of beeping, and the power button's short press switches the LED (LED ON / LED OFF). Smaller 80×160 screen: compact status line; in portrait it shows only the mode and battery (option flags such as NO LED / TAP appear in landscape). Only units with the MPU6886 IMU (early SH200Q units are not supported). |
| M5StickC Plus v1.1 | ✅ tested | Main target; all features as described here. |
| M5StickC Plus2 | ⚠️ untested | Prepared from the docs, not yet run on a device. No AXP192: power held by GPIO4, PWM backlight, buzzer without the 5 V boost, power button (C) on GPIO35. Its IMU interrupt is not documented, so orientation is polled once a second (no deep sleep while paused, no tap-to-wake). |
| M5StickS3 | ✅ tested | ESP32-S3, its own build. Speaker instead of the buzzer; the BMI270 reaches the ESP32 through the power chip (taps and wake-on-motion as on the Plus); no RTC, so time comes from the less accurate ESP32 clock. The power button belongs to the power chip (double press: off). While on USB it does not sleep, so it can always be flashed. |
| M5StickC Plus SE | ❌ not supported | No motion sensor (IMU). The firmware recognises it and shows "Unsupported device" (E1) instead of running. |
Flashing — quickest way (no tools to install)
- Connect the device over USB and switch it on.
- Open the web installer in Chrome or Edge (not Safari).
- Press Connect, pick the port with
usbserialin its name (on the StickS3:usbmodemor "USB JTAG/serial"), press Install. The installer picks the right build for the chip by itself. The device restarts; saved settings are kept. - Close the installer: the page reads the device's self-check and shows the result under the install button — the model it found, or "Unsupported device" with the reason. The device shows the same: "Unsupported device" on its screen, or five short beeps, means this model is not supported — see Is my M5Stick supported?.
On macOS, if the port is busy, run killall scrod first (see below).
Flashing from source: install PlatformIO, run scripts/flash.sh, choose the device, confirm.
Details: Build and flash.
Contents
- TL;DR
- Features at a glance
- Cheat sheet
- How it works
- Build and flash
- Is my M5Stick supported?
- Power design and battery life
- Hardware notes
- Known limitations
- Project layout
Features at a glance
- Two timers: WORK (default 25 min) and BREAK (default 5 min), each with its own length (1–60 min).
- Face down pauses, face up resumes, exactly where it stopped.
- Five screen layouts: flat, either long edge, and either end. The image is always upright.
- Countdown bar behind the digits that drains every second and changes colour:
- WORK: green → orange → red;
- BREAK: blue → light blue.
- Unobtrusive display: a 5-second glance once a minute that shows only the minutes and gently steps the brightness up and down.
- Tap the table to see the full
MM:SSfor 5 seconds. Always on when standing on an end, switchable for horizontal poses. - 5-second grace period at the start of every session, so you can change your mind and switch modes. A start beep marks the moment the session really begins.
- Distinct sounds for the start and end of WORK and BREAK. Sound can be muted.
- End of session: the screen blinks for 2 minutes. Move the device to another pose to start the other mode, or turn it face down and back to repeat the same one.
- Low-battery warning that you can see from across the room: a yellow dot below 40 %, red below 20 %.
- Very low power: light sleep while running, deep sleep while paused, crystal RTC timekeeping, radios never turned on.
Cheat sheet
| You do | It does |
|---|---|
| Switch on: press the power button (left side) | The device starts and begins a new WORK session. |
| Switch off: hold the power button for about 6 seconds | The screen goes dark and the device powers off completely. |
| Put it face down | Pauses. The screen goes dark and the device sleeps deeply. |
| Turn it face up (any visible pose) | Resumes from exactly where it paused. |
| M5 button (big, under the screen), screen dark | Shows the time for 5 s, like a change of pose. |
| M5 button, screen on | Restarts the current mode (when released). |
M5 button while 00:00 blinks |
Starts the other mode (WORK → BREAK or BREAK → WORK). |
| M5 again within 5 s (during the yellow / violet grace period) | Switches to the other mode and starts it. |
| B button (right side), single press | Shows the current mode's length (SET WORK / SET BREAK) for a second, then the countdown for the usual 5 s: the session keeps running. During the finish blinking, the blinking goes on and its 2 minutes are not reset. |
| B further presses / hold | +1 minute per press (wraps 60 → 1); holding repeats quickly. 1 s after the last press the new length is saved and a new session starts. |
| Power button (left side), short press, screen on | Sound on / off (SOUND ON / SOUND OFF). |
| Power button, hold ~1.5 s, screen on | Tap-to-wake in horizontal poses on / off (TAP ON / TAP OFF). |
| M5 button, hold 1.5 s / 3 s | The same as the power button's short press / hold: sound / tap-to-wake on / off. While you hold, the banner shows the change; it applies on release. |
| Tap the table (tap poses) | Shows the full MM:SS for 5 s. |
| Session ends, then move it to another pose for 1 s | Starts the other mode (WORK → BREAK or BREAK → WORK). |
| Session ends, then face down and back up | Starts the same mode again. |
| Nothing done for 2 minutes after the end | Deep sleep. Wake it with M5, or face down for about a second and back to any visible pose (same mode). |
How it works
Switching on and off
- On: press the power button on the left side (screen facing you, USB at the bottom). A new WORK session starts right away.
- Off: hold the power button for about 6 seconds until the screen goes dark. The power chip (AXP192) cuts the power completely. The timer stops and nothing runs until you switch it on again.
- On USB: while the cable is connected the device is powered and charging; you still switch it off the same way.
- What survives switching off: both session lengths, the sound setting and the tap setting. The running session does not: switching on always starts a fresh WORK session.
- Holding the button to switch off passes the 1.5-second mark that toggles
TAP, soTAP ON/TAP OFFmay flash on the way. The device powers off before that change is saved, so your tap setting stays as it was. - You don't need to switch it off between sessions: face down it sleeps deeply and draws very little power.
Two modes: WORK and BREAK
| WORK | BREAK | |
|---|---|---|
| Default length | 25 min | 5 min |
| Bar colour while running | green → orange → red | blue → light blue |
| Grace-period colour | yellow | violet |
| Start signal | one longer beep | one short beep |
| End signal | three short beeps | two long beeps |
| Status label | WORK |
BREAK |
Power-on always starts WORK. Switch modes with a second press of the M5 button during the grace period, or by changing the pose when a session ends.
Starting a session and the grace period
Every session — after power-on, after the M5 button, after changing the length with B, or after a mode switch — starts with a 5-second grace period:
- A 25-minute session starts at 25:05 and a 5-minute session at 5:05.
- During those 5 seconds the bar is yellow (WORK) or violet (BREAK).
- Pressing M5 again in that window switches to the other mode, which starts with its own grace period. Each further quick press switches again.
- When the grace period ends, the start signal sounds and the bar takes the mode's colour. The timer then shows exactly the full length, e.g.
25:00.
While a session runs
The timer keeps running in every pose where the screen faces you. To save battery and stay out of your way, the screen stays dark most of the time. It turns on:
- Once a minute (glance): at every minute mark the screen shows only the remaining minutes (e.g.
24), static, while the backlight steps up and down over 5 seconds (levels 7 → 8 → 8 → 8 → 7). The two digits are as large as the landscapeMM:SSin every pose, so in portrait they are much bigger than the full portrait time. - For 5 seconds with the full
MM:SS: when a session starts or resumes, when the device moves to a different pose, or when you tap the table in a tap pose.
Pausing and resuming
- Face down (held for ~0.3 s) pauses the timer immediately. The screen and its power supply turn off and the ESP32 enters deep sleep.
- The accelerometer stays awake in a micro-power mode. When the device moves, it wakes the ESP32, which checks the pose before turning on the screen. A bump while still face down just goes back to sleep without lighting anything.
- Turning it face up (or onto any visible pose) resumes the timer from the exact remaining time, to the millisecond.
- There is a hysteresis band between "face down" (z < −0.6 g) and "visible" (z > −0.3 g), so tilting the device does not flip it between states.
When a session ends
-
The end signal sounds: three short beeps for WORK, two long beeps for BREAK.
-
00:00 FINISHEDblinks (500 ms on / 500 ms off) for 2 minutes. -
During the blinking you can:
- move the device to another pose and hold it there for 1 second (e.g. from one long edge to the other, or from standing on an end to lying on its side) → the other mode starts;
- press M5 → the same mode restarts (press again within 5 s to switch);
- press B once → see the length (the blinking goes on); press it more → set a new length and start;
- turn it face down → the screen turns off at once.
-
If nobody does anything during the 2 minutes (or it is turned face down), the device goes into deep sleep: the screen is off and the timer does not run. Only two things wake it:
- the M5 button → the same mode starts again;
- turning it face down for about a second and then back to any visible pose (flat, an edge or an end) → the same mode starts again.
In deep sleep a plain change of pose (without going face down first) and the B button do not wake it: the pose switch to the other mode works only during the 2 minutes of blinking.
Poses and screen layouts
| Pose | Layout | Tap to wake |
|---|---|---|
| Flat, screen up | landscape | when TAP is on |
| On long edge A | landscape | when TAP is on |
| On long edge B | landscape, rotated 180° | when TAP is on |
| On its end, USB up | portrait | always |
| On its end, USB down | portrait, rotated 180° | always |
| Face down | — (paused) | — |
A new pose must be stable for a few samples (~0.5 s) before the layout changes. A layout change shows the screen for 5 seconds.
The screen
- Bar: a white rounded frame with a bar inside whose level drops every second in proportion to the remaining time and changes colour with the mode.
- Time: large digits in the middle with a black halo, so they stay readable over any bar colour.
- Status line: at the bottom in landscape, at the top in portrait. It shows:
- left:
WORK,BREAK,SET WORK,SET BREAK,PAUSEDorFINISHED(red); - right: battery percentage, a low-battery dot, and the flags
MUTE(sound off) andTAP(tap-to-wake on in horizontal poses; not shown in portrait, where tapping always works).
- left:
- Banners:
SOUND ON/SOUND OFFandTAP ON/TAP OFFappear in a box over the time for 2 seconds.
Tap to wake
When the screen is dark, a light tap on the table (or any small vibration) shows the full MM:SS for 5 seconds.
- Standing on an end: always on.
- Flat and on both long edges: off by default. Toggle it by holding the power button for ~1.5 s while the screen is on, or the M5 button for 3 s.
- In tap poses the accelerometer samples at 100 Hz with a 40 mg threshold to catch light taps. Otherwise it samples at 12.5 Hz with an 80 mg threshold to save power and ignore the desk.
The power button's long press is reported by the power chip at 1.5 s, while you are still holding the button. The TAP setting therefore changes at once but is saved only 6 seconds later. If you keep holding the button to switch the device off, it powers down before the change is saved, so switching off never changes the setting.
Sound
- A short press of the power button, while the screen is on, or holding the M5 button for 1.5 s toggles the sound.
MUTEshows in the status line while the sound is off. - Power-button presses while the screen is dark are ignored, so you cannot change anything by accident in your bag.
Battery indicator
- The percentage is always shown in the status line.
- Below 40 %: a bright yellow dot appears and the percentage turns yellow.
- Below 20 %: both turn bright red, visible from a distance.
- Right after power-on the power chip needs a moment to measure the battery. Until it has a value, nothing is shown, rather than a misleading
0%.
What is remembered
| Setting | Survives power-off | Changed with |
|---|---|---|
| WORK length | yes | B button in WORK |
| BREAK length | yes | B button in BREAK |
| Sound on / off | yes | short press of power button, or M5 held 1.5 s |
| Tap-to-wake in horizontal poses | yes | long press of power button, or M5 held 3 s |
| Current session, mode, pause state | across sleep only | — |
Power-on always starts a fresh WORK session. Settings are written to flash only when they change, never to track the countdown.
Build and flash
Web installer
The web installer (GitHub Pages, ESP Web Tools) flashes the current release from Chrome or Edge with one button. It picks the ESP32 or ESP32-S3 build from the connected chip, writes the bootloader, partition table and firmware at their own offsets and leaves the settings partition alone, so saved settings survive. It resets the device when done and releases the port; the Close button on the "Installation complete!" screen closes the installer (press Connect again for another device). Then the page restarts the device over the same port, reads its first-boot self-check line and shows the result under the install button: "Identified: production branch by .github/workflows/pages.yml, on every push to that branch and on every version tag, so the version in the page header always follows the newest tag. The page counts visits, connections (a port picked), finished or failed installs, and how often its "No port selected" help (and which OS tab) is opened, anonymously with GoatCounter (no cookies).
Without building: release image
Every release has two files. Each contains the bootloader, partition table and firmware; flash it at offset 0x0:
M5StickPomodoro-vX.Y.Z.bin: ESP32 models (StickC Plus, StickC, StickC Plus2), the same for all of them.M5StickPomodoro-vX.Y.Z-S3.bin: the StickS3 (ESP32-S3); with esptool use--chip esp32s3.
Ways to flash it:
- In the browser, by hand: open the Espressif web flasher in Chrome or Edge, press Connect, pick the device, set Flash Address to
0x0, choose the file and press Program. Then press Disconnect (or close the tab); while the page holds the port the device stays in reset. If it still shows nothing, switch it off and on. - With esptool:
esptool.py --chip esp32 write_flash 0x0 M5StickPomodoro-vX.Y.Z.bin
Writing the full image also resets the saved settings (session lengths, sound, tap) to their defaults. If the port is busy or missing on macOS, see the scrod note below.
From source
You need PlatformIO, either the CLI or the VS Code extension. PlatformIO downloads everything else: the espressif32@6.4.0 platform and the M5Unified@0.2.25 library (with M5GFX).
-
Connect the M5Stick over USB and switch it on. The USB serial port only exists while the device is powered.
-
Flash with the helper script:
scripts/flash.shIt lists the connected devices and lets you choose one; the others are not touched. Then it checks the chosen device and shows its chip, flash size, MAC, model and current firmware. It restarts the device once to read its boot log. It flashes only after you confirm.
--port /dev/cu.usbserial-XXXXpicks the device directly.--expect "M5StickC"refuses to flash unless the device is identified as that model.--yesskips the questions;--listonly lists the devices;--env testflashes the test build.- On macOS, the VoiceOver braille service (
scrod) grabs new USB serial ports and blocks flashing. The script stops it when it holds the chosen port.
Plain PlatformIO works too:
pio run -t upload --upload-port /dev/cu.usbserial-XXXX. -
Optionally, watch the log:
pio device monitorOn boot you should see
profile=M5StickC Plus(orM5StickC),IMU INT self-test: asserted=1 released=1andWORK: new 25 min session.
A test build with a 2-minute default WORK session:
scripts/flash.sh --env test
Lengths already set with the B button are stored in flash and override the defaults. The defaults come from -DSESSION_MIN=25 and -DBREAK_MIN=5.
Is my M5Stick supported?
At its first start after flashing, the firmware checks what the board really has: the display and its size, the power chip, the motion sensor (IMU) and whether its reading is plausible, the clock chip (RTC) and whether it runs, and the audio codec on the StickS3. The result must match one of the supported models in src/boards.h. If it does not, the timer does not run and the device says why:
- On the screen: "Unsupported device", an error code and the reason. Look-alikes are named, e.g. "Looks like M5StickC Plus SE, which has no motion sensor".
- Five short beeps (or five LED flashes on the original StickC): the same message for a board whose screen is missing but whose sound is known. Without a screen they repeat every 10 seconds for a minute.
- In the USB log: a line
UNSUPPORTED: <code> <reason>; a supported device logsIDENTIFIED: <model> .... Both tools read it after flashing: the web installer shows it under the install button when you close the installer, andscripts/flash.shprints it.
| Code | Meaning | Typical cause |
|---|---|---|
| E1 | No motion sensor (IMU) | M5StickC Plus SE; an early M5StickC with the SH200Q sensor |
| E2 | The motion sensor gives an implausible reading | a damaged sensor |
| E3 | The power chip does not match the model | another board that looks the same to the display check |
| E4 | No display, or one of another size | a board without a screen, or another model |
| E5 | The clock chip (RTC) is missing or not running | a damaged or missing RTC |
| E6 | The audio codec is missing (StickS3) | another ESP32-S3 board |
| E9 | Unknown board | any ESP32 or ESP32-S3 board that is not an M5Stick this firmware knows |
The web installer and scripts/flash.sh can only see the chip type before flashing, so they install on any ESP32 or ESP32-S3 device. The check happens afterwards, on the device.
Safety. The firmware cannot "brick" the device. The ESP32's flashing mode lives in the chip's ROM, and the firmware never writes eFuses or turns on flash encryption or secure boot. On a device it does not recognise, it drives no pins and writes to no chips, and it never powers off or deep-sleeps while it may be on USB, so the port stays available for flashing something else. On battery, an AXP192 board powers off after 2 minutes on the refusal screen; the M5 button shows the message again before that.
Getting back to flashing mode:
- StickC, StickC Plus, StickC Plus2: nothing to do. The USB bridge puts the chip into flashing mode by itself; the device only has to be switched on, since the port disappears while it is off.
- StickS3: its USB is inside the chip and stops while the chip sleeps. This firmware does not sleep while USB power is present, so it flashes like the others. For any other firmware: connect USB, then hold the power button until the green LED flashes (flashing mode, tested); press it once afterwards to start the new firmware.
Power design and battery life
- Radios off: Wi-Fi and Bluetooth are never initialised.
- CPU and supplies: the CPU runs at 80 MHz. The AXP192 5 V boost (EXTEN) is on only while beeping, because the buzzer is powered from it.
- Running: the ESP32 is in light sleep. It is woken by a hardware timer at the next minute mark, by the buttons, or by the accelerometer interrupt on GPIO35.
- Paused / finished: deep sleep with the backlight (LDO2) and the LCD logic supply (LDO3) off. It wakes on the MPU6886 wake-on-motion interrupt and, after a session ends, on the M5 button.
- Timekeeping: the BM8563 crystal RTC keeps time, not the ESP32's drifting RC sleep clock. Pause and resume are aligned to the RTC second tick.
- Display: the screen is dark except for the short glances; frames are rendered off-screen and pushed in one go.
- Flash: written only when a setting changes.
Estimated battery life (calculated, not measured; 120 mAh battery):
| State | Estimated current | Estimated runtime |
|---|---|---|
| Session running | ≈ 3.5–4 mA | ≈ 30 h of continuous counting |
| Paused / finished (deep sleep) | ≈ 0.1–0.5 mA | weeks |
Extra screen time from taps and pose changes and frequent beeps reduce these numbers.
Hardware notes
Found while building this on the device:
- MPU6886: in low-power cycle mode it reads ~0 g unless
ACCEL_CONFIG2hasDLPF_CFG = 7. - Buzzer: the buzzer (GPIO2) is powered from the AXP192 5 V boost (EXTEN) and stays silent without it.
- GPIO35: shared by the MPU6886 INT (configured open-drain) and the BM8563 INT (its interrupts are disabled).
- Power button: wired to the AXP192, not to the ESP32. Short and long presses are latched in AXP192 register
0x46and read over I2C; the chip reports no release event. The minimum visible backlight level is LDO2 level 7 (2.5 V), so the glance fades in 0.1 V steps. - USB serial: the serial port disappears while the device is switched off with the power button (observed on the device), so switch it on before flashing.
- USB-UART bridge back-powering: while the cable is out, a driven UART TX line (idle HIGH) back-powers the USB-UART bridge through its RX pin, and the bridge then does not enumerate when the cable is plugged into a running device. It only appeared after deep sleep released the pins. The firmware therefore connects TX only while the AXP192 reports USB power.
- Opening the serial port restarts the device: the bridge drives EN / GPIO0 through DTR / RTS for automatic flashing, so a serial monitor restarts the timer when it connects.
Known limitations
- B button after a session ends: it cannot wake the device from deep sleep; ESP32 ext1 cannot wake on "any of these pins low". Use M5 or the face-down/up gesture first.
- Power button: works only while the screen is on, because it is polled over I2C.
- Glance brightness: it steps instead of fading smoothly. Smoother fading would need software PWM, which keeps the CPU awake.
- Battery percentage: it is estimated from the battery voltage and reads high while charging.
Project layout
platformio.ini environments: m5stick-c-plus (default: StickC, StickC Plus, StickC Plus2), m5stick-s3 (StickS3)
and test (2-minute WORK session)
src/main.cpp the firmware
src/boards.h board profiles: one row per supported model
scripts/flash.sh choose a connected device, check it and flash it (scripts/flash.py does the work)
scripts/build_release.sh build the single-file release image into dist/
.github/workflows/release.yml CI build; publishes a release with the image for every v* tag
scripts/build_web.sh build the web installer site into dist/web
scripts/render_docs.py render README.md and PORTING.md into the site, so it always matches the repository
scripts/draw_diagrams.py draw the SVG diagrams in docs/ (and the picture in the web installer header)
web/index.html the web installer page
.github/workflows/pages.yml publishes the web installer to GitHub Pages from the production branch (on pushes and tags)
PORTING.md supported models, adding a board profile, notes on other M5Stick models
docs/ the diagrams used in this README and on the web installer page (SVG)