← Range notesMEAILY.FYI
Card
No. 01
Date
Topic
Code
Read time
7 min

Range card · Code

A $30 range computer, built with Claude

How I turned a pocket ESP32 gadget into a shot timer and ballistic calculator, two jobs that normally take $900 or more of range kit, with Claude writing the code.

Range Buddy home screen on the Cardputer, a grid of eight tiles from Timer to Info

Two gadgets come to the range with a lot of shooters. One is a shot timer: it beeps, listens for your shots and tells you how fast you were. The other is a ballistic calculator: you tell it the rifle, the load and the air, and it tells you how many clicks to dial at 600 yards.

Bought separately, a good pair costs somewhere between about $900 and $1,200. I wanted both in my pocket, and I didn’t want to pay for them. So I built one on a $30 computer the size of a credit card, with Claude writing nearly all of the code. The result is Range Buddy, open source under MIT.

What it would cost to buy

Here is what the commercial versions sell for, at prices listed by US retailers when I checked in December 2026:

Job Product Price
Shot timer CED7000 Gen 2 $139.95
Shot timer AMG Lab Commander $189
Shot timer Shooters Global SG Timer 2 $329
Ballistic calculator Kestrel 5700 Elite with Applied Ballistics $749
Ballistic calculator Kestrel 5700X Elite with Applied Ballistics $899 ($779 on sale)
Both M5Stack Cardputer-ADV running Range Buddy $29.99 (£27.40 in the UK)

The cheapest pair is a CED7000 plus a Kestrel 5700 Elite, at about $890. The top pair is about $1,230. Range Buddy runs on hardware I could buy for the price of a box of decent ammo.

That’s not a fair fight on every point, and I’ll come back to where the expensive kit still wins.

The hardware

The Cardputer-ADV is a tiny ESP32-S3 computer from M5Stack with a keyboard, a 1.14” screen and, importantly, everything the two jobs need already built in:

  • a microphone and speaker on one audio codec, for the start beep and for hearing shots;
  • a motion sensor, which works as an inclinometer for uphill and downhill shots and as a level for cant;
  • a 56-key keyboard for typing in rifle data and scoring hits;
  • a microSD slot for logs and backups, and Wi-Fi for a companion web page.

No add-ons, no soldering, no phone.

Timer screen showing 0.00 seconds, a random 2 to 4 second start delay, and shot, split and best readouts
The shot timer, waiting for Enter. Random start delay of 2 to 4 seconds.

How I built it with Claude

I’ve been writing software for over ten years, but I’d never written firmware for an audio codec or a ballistic solver. What I had was a clear idea of what I wanted on the range. Claude, working in Claude Code on my PC with the Cardputer plugged in over USB, did the rest of the heavy lifting. A few things made that work.

Research and a plan before any code

The first thing Claude produced wasn’t code. It was a plan: what this exact hardware can and can’t do, and what that means for the design. Some of what it found shaped everything after:

  • The ESP32-S3 in this model has no extra RAM, so there’s no room for big audio buffers. Audio has to stream through small ring buffers.
  • The stock audio examples can’t use the mic and the speaker at the same time. The codec chip itself can, if you drive it directly. That matters, because a timer that goes deaf while it beeps misses shots fired on a par beep.
  • The motion sensor has no compass, so the direction of fire for Coriolis has to be typed in.
  • There’s no open Bluetooth protocol for the popular chronographs, so muzzle velocity is entered by hand.

Then it went through the feature lists of commercial timers (Pocket Pro II, CED7000, AMG Commander, SG Timer 2), dry-fire apps and solvers (Kestrel with Applied Ballistics, Strelok Pro, Hornady 4DOF), and turned the gaps into a roadmap ranked by how much each one matters. That list is how a hobby project ended up with USPSA and IDPA scoring, all eight Steel Challenge stages and a truing tool.

A core you can test without the device

The maths and the logic (the trajectory solver, the shot detector, the timer, drills and scoring) live in a plain C++ library with nothing device-specific in it. That means it compiles and runs on a normal PC, where 43 automated tests check it. The solver is checked against published manufacturer data: for Hornady’s 6.5 Creedmoor 140 gr ELD-M it lands within about 1% at 500 and 1,000 yards.

Ballistic solver for Hornady 140 grain ELD-M at 200 yards: 0.5 mil up, 0.0 left, 5 clicks, time of flight 0.23 seconds, 742 metres per second
The solver: 200 yards, 0.5 mil up, 5 clicks. Time of flight, velocity, Mach and density altitude underneath.
DOPE card table from 100 to 350 yards with elevation in mil and wind holds for 2, 4 and 6 metres per second
A DOPE card with wind holds for 2, 4 and 6 m/s. It exports to CSV on the SD card.

Timing from the audio itself

The part I’m proudest of is the bit I understood least going in. Range Buddy doesn’t time shots with the processor’s clock. It drives the codec directly so the speaker and the mic share one audio stream, then finds the start beep in the mic signal and counts samples from there to each shot. Every delay in the chain (buffers, codec, the speed of sound to the mic) cancels out on every string.

Shot detection is classic signal processing: filter out wind and handling thumps, follow the noise floor, and only trigger on a rise sharp enough to be a gunshot rather than a voice or ringing steel. Fire three shots on the calibration screen and it sets its own sensitivity.

Drill library listing Bill Drill, El Presidente, FAST, Mozambique and 5x5 with their scoring method and par times
22 built-in drills, plus your own. Hits are scored with single keys after each string.

The device in the loop

Code that passes tests on a PC still has to survive real hardware. Claude added a USB command line to the firmware, including commands to press keys and dump the screen, so it could drive the Cardputer and see what it was showing. Every screenshot in this post came off the device that way.

Running on the real thing found the real bugs: the keyboard, codec and motion sensor share one internal bus and the two processor cores were colliding on it; the codec hummed if it was left powered across a reset; a format string crashed the rangefinder when it had no reading; and the board sometimes got stuck in download mode after flashing. Each one got fixed, written up in the project’s notes for next time, and the next build went on the device.

The whole commit history fits into one afternoon.

Rangefinder screen: an IPSC target 18 inches wide read as 2.00 mil gives a range of 250 yards
Ranging off the reticle: an 18" IPSC target that measures 2.0 mil is 250 yards away. One key sends the range to the solver.

What it does

As a shot timer: instant, fixed, random and spy start modes; up to four par beeps; auto-stop; splits labelled as draw, transition or reload; deleting false triggers; 22 built-in drills plus 8 of your own; USPSA (Comstock, Virginia Count, Fixed Time), IDPA and Steel Challenge scoring; personal bests and trends; and a dry-fire trainer with a par loop, a metronome and a reaction drill.

As a ballistic calculator: a point-mass solver with G1 and G7 drag, full atmosphere, spin drift, aerodynamic jump and Coriolis; two wind zones and a gust bracket; 8 rifle profiles; a library of 28 factory loads; DOPE cards; truing from the drop you actually saw; a zeroing assistant; a mil or MOA rangefinder; moving-target lead; reticle holds; and live cant from the motion sensor.

Level and angle screen showing shot angle minus 9.9 degrees, cant plus 61 degrees and a bubble bar
Shot angle and cant from the built-in motion sensor.

There’s also a red night theme, a Wi-Fi companion page for editing settings and downloading logs, over-the-air updates and JSON backups to SD.

Where the expensive kit still wins

I want to be straight about this, because “$30 versus $900” isn’t the whole story.

  • A Kestrel measures the weather. It has its own wind, temperature, pressure and humidity sensors, and it’s waterproof and built to be dropped. Range Buddy makes you type the conditions in, and the Cardputer is a plastic dev board.
  • Applied Ballistics is years of measured drag data. Range Buddy’s solver matches published data closely in my tests, but it uses the standard G1 and G7 models plus your own truing.
  • The timer hasn’t been checked against a commercial one yet. That’s the next range trip: the same strings on Range Buddy and on a reference timer, side by side. Until then, treat its split times as unproven.
  • It isn’t a product. You flash it yourself, and you should confirm your DOPE on paper before trusting any calculator, mine included.

What I took from it

The device was never the expensive part of a shot timer or a ballistic computer. The expensive part was the knowledge: the signal processing, the exterior ballistics, the scoring rules, the long list of small decisions. That’s exactly the part Claude carried. My part was knowing what a good range day looks like, making the calls, and holding the hardware.

Next up are a split histogram, light sleep between strings to save battery, and a small on-device model trained on recorded shots to tell a gunshot from everything else at a busy range.

The code, the plan and the roadmap are all on GitHub: mmeaily/cardputer-range-buddy.

Prices: RifleConfigurator shot timer guide (CED7000, AMG Commander, SG Timer 2); T.REX ARMS (Kestrel 5700 Elite); Graf & Sons (Kestrel 5700X Elite); The Pi Hut and CNX Software (Cardputer-ADV). Checked 4 December 2026.