A versatile shot timer for live fire and dry fire practice, built on the M5StickC Plus2 (ESP32). Detects shots via microphone and/or IMU, records split times, supports Bluetooth audio output, and can be fully configured over WiFi from a phone or browser.
| Component | Details |
|---|---|
| M5StickC Plus2 | Core device — M5Stack Store |
| External Buzzer | Optional but recommended. Active buzzer on GPIO 25/GND and GPIO 2/GND for louder local audio |
| Bluetooth Speaker/Headset | Optional. Any A2DP-compatible device for wireless audio prompts |
- Download the latest
.binfrom Releases - Open the Espressif Web Programmer
- Click Connect and select the device COM port
- Set Flash Address to
0x0, select the.binfile - Click Program — this may take up to 5 minutes
# In a new folder (e.g. C:\Users\%USERNAME%\Documents\SendItTimer):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip esptool
# Find your device COM port
Get-PnpDevice -Class 'Ports' | Where-Object { $_.Present } | Select-Object Name, Present, Status
# Flash (replace COM6 with your port)
esptool -p COM6 write_flash 0x0 merged.binStandard shot timer using microphone detection. Press the front button to arm — after a configurable random delay, a beep sounds and the timer starts. Records elapsed time and splits for each detected shot.
Audio-only mode — no microphone needed. A random delay is followed by a programmable sequence of beeps at user-defined intervals (par times). Useful for practicing draws and presentations to a par time.
Combines microphone detection with IMU (accelerometer) recoil detection. A shot is only registered when both a sound peak and a subsequent recoil impulse are detected within a 100ms window. Greatly reduces false positives in loud environments.
- Split timing — records and displays each shot's elapsed time and split from previous
- Configurable random start delay — prevents anticipation of the start beep
- Adjustable shot limit — cap shots at 1–99, or set to 0 for unlimited
- Bluetooth A2DP — stream start beeps and par tones to any Bluetooth speaker/headset
- BT audio offset calibration — compensate for Bluetooth latency to keep buzzer and speaker in sync
- WiFi settings page — configure all settings and upload new firmware from a phone browser
- Left/right hand orientation — flip the screen for left- or right-hand use; button mapping adjusts automatically
- Auto-sleep — configurable light sleep timeout (Off, 1, 2, 5, or 10 minutes); disabled when Bluetooth is connected. Any button wakes the device.
- Device status screen — battery voltage/%, IMU readings
- Dual-core FreeRTOS — buzzer runs on Core 0 to avoid blocking display/logic on Core 1
SELECT MODE
├── Live Fire
├── Dry Fire Par
├── Noisy Range
└── Settings
├── Live Fire
│ ├── Max Shots (0 = unlimited, 1–99)
│ ├── Shot Threshold (mic sensitivity, RMS)
│ ├── Min 1st Shot (ms delay before 1st shot registers)
│ ├── Start Delay Min (ms, minimum random pre-beep delay)
│ ├── Start Delay Max (ms, maximum random pre-beep delay)
│ └── Calibrate Thresh.
├── Dry Fire
│ ├── Par Beep Count (1–10)
│ └── Par Time 1–10 (0.1–10.0 seconds each)
├── Noisy Range
│ ├── Recoil Threshold (G-force, 0.5–5.0)
│ └── Calibrate Recoil
├── Beep Settings
│ ├── Beep Duration (ms)
│ ├── Beep Tone (Hz)
│ ├── Post Beep Delay (ms)
│ └── Tone Sweep
├── Bluetooth
│ ├── Connect / Disconnect
│ ├── Volume (0–127)
│ ├── BT Audio Offset (ms, -1000 to +500)
│ ├── Auto Reconnect
│ └── Scan for Devices
├── Device
│ ├── Orientation (Right/Left hand)
│ ├── Auto Sleep (Off / 1 / 2 / 5 / 10 min)
│ ├── Device Status
│ └── WiFi Settings (opens WiFi AP for browser config / OTA)
├── Power Off Now
└── Exit
The device can host a WiFi access point for browser-based configuration and over-the-air firmware updates.
- Navigate to Settings → Device → WiFi Settings
- Connect to the WiFi network:
- SSID:
ShotTimer - Password:
shottimer
- SSID:
- Open a browser and go to
http://192.168.4.1 - The settings page mirrors the on-device menu — edit any setting and tap Save Settings
- To update firmware, scroll to the Firmware Update section, choose a
.binfile, and tap Upload Firmware. The device reboots automatically on success.
WiFi is only active while on the WiFi Settings screen. It shuts off when you exit to preserve battery life.
Install these exact versions — other versions may not be compatible:
| Library | Version | Source |
|---|---|---|
m5stack:esp32 board |
2.1.4 |
Arduino Board Manager |
esp32:esp32 board |
3.3.2 |
Arduino Board Manager |
M5StickCPlus2 |
latest | Arduino Library Manager |
M5GFX |
0.2.7 |
Arduino Library Manager |
M5Unified |
0.2.5 |
Arduino Library Manager |
ArduinoJson |
latest | Arduino Library Manager |
ESP32-A2DP |
1.8.7 |
GitHub — install manually |
ESP32-BT-Scanner |
latest | GitHub — install manually |
M5MicPeakRMS |
latest | GitHub — install manually |
ESP32-A2DP, ESP32-BT-Scanner, and M5MicPeakRMS are not in the Arduino Library Manager. Download the ZIPs from the links above and install via Sketch → Include Library → Add .ZIP Library.
-
Install Arduino IDE 2.x from arduino.cc
-
Add board manager URLs — go to File → Preferences and add both URLs to "Additional boards manager URLs":
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json -
Install board packages via Tools → Board → Boards Manager:
- Search
m5stack→ install M5Stack version2.1.4 - Search
esp32→ install esp32 by Espressif Systems version3.3.2
- Search
-
Install libraries via Tools → Manage Libraries:
M5StickCPlus2(latest)M5GFXversion0.2.7M5Unifiedversion0.2.5ArduinoJson(latest)
Install manually (download ZIP from GitHub, install via Sketch → Include Library → Add .ZIP Library):
-
Select the board — Tools → Board → M5Stack → M5StickC-Plus2
-
Select your port — Tools → Port → choose the COM port for your device
-
Open the sketch — open
code/code.ino -
Upload — click the Upload button (or Sketch → Upload)
This project uses arduino-cli. Install it, then install the board packages above.
Run these from inside the code/ directory:
| Target | Description |
|---|---|
make or make build |
Compile only |
make flash |
Upload firmware to device |
make merge |
Create a single merged .bin (bootloader + partitions + firmware) |
make release |
Clean build + merged binary for distribution |
make monitor |
Open serial monitor at 115200 baud |
make clean |
Remove build artifacts |
Edit the
DEVICEvariable at the top of the Makefile to match your device's serial port (e.g./dev/cu.usbserial-XXXXon macOS,COM6on Windows).
All .h and .cpp files must be in the same directory as code.ino:
code/
├── code.ino
├── config.h / config.cpp
├── globals.h
├── timer_modes.h / timer_modes.cpp
├── input_handler.h / input_handler.cpp
├── display_utils.h / display_utils.cpp
├── audio_utils.h / audio_utils.cpp
├── bluetooth_utils.h / bluetooth_utils.cpp
├── nvs_utils.h / nvs_utils.cpp
├── ota_utils.h / ota_utils.cpp
├── system_utils.h / system_utils.cpp
| Button | Action |
|---|---|
| BtnA (front) — short press | Select / Confirm / Start |
| BtnA (front) — long press | Back / Cancel / Return to mode select |
| BtnB (side) | Scroll / Adjust (direction depends on orientation) |
| BtnPWR (top) | Scroll / Adjust (direction depends on orientation) |
Button directions (up/down) swap automatically when you switch between Right Hand and Left Hand orientation.
Pull requests are welcome. Please target the dev branch.


