Smart Golf Ball with BLE Connectivity and Motion Tracking
A golf ball that reports its own flight data sounds like a gimmick until you try to build one.
0
Project description
A golf ball that tells you how hard you hit it, how fast it spun, and where it landed — that's a hardware and firmware problem before it's a golf problem. We built one as an internal proof of concept, and the design decisions are worth walking through because they apply to any small, battery-powered, motion-sensing product.
What the ball actually has to do
The ball needs to survive a driver swing (impact forces north of 1,000 g), log acceleration and angular velocity for a few seconds per shot, and push that data to a phone over BLE. It has to fit inside a 42.7 mm sphere, weigh close to a regulation 45.9 g so it feels right, and run for a round of 18 holes on one charge. Those constraints drive everything.
We split the build into three layers: a rigid sensor core, a cast urethane shell around it, and the BLE firmware that ties it together. Embedded software services work like this lives or dies on the second and third layers — the silicon is the easy part.
The sensor core
The chip is an nRF52840. We picked it over the ESP32 for three reasons: BLE 5.0 with long-range PHY, a Cortex-M4F that's idle at a few microamps, and USB for charging and debug. The ESP32 is great for Wi-Fi products, but for a coin-cell-class BLE device the nRF52 is the right tool.
Motion sensing is a Bosch BMI270 IMU — 16-bit accelerometer and gyro, 0.65 mA at full rate, and a 2 KB FIFO so the M4 doesn't have to wake for every sample. We run it at 800 Hz during a swing window. A driver swing is roughly 0.3 seconds of meaningful motion, so 240 samples per axis is plenty to reconstruct the impact profile.
Power is a 12 mAh LiPo pouch, charged through a small pogo-pin pad on the core. We measured 3.1 mA average during a two-second logging window and 4 µA in deep sleep. That gives us about 40 rounds between charges with the BLE radio off during play.
Firmware: waking up at the right moment
The interesting firmware problem is knowing when a swing is happening without draining the battery. A continuous 800 Hz stream would kill the cell in a day.
We use the BMI270's built-in any-motion interrupt as a wake source. The nRF52 stays in System ON sleep with the IMU in low-power mode at 50 Hz. When acceleration crosses 1.5 g for two consecutive samples, the interrupt fires, the M4 wakes, and we bump the IMU to 800 Hz. We log for 2.5 seconds, then go back to sleep. Total wake time is about 3 seconds per shot.
The firmware runs on Zephyr RTOS. We use a single high-priority thread for IMU capture and a lower-priority thread for BLE. The capture thread reads the FIFO in 32-sample bursts over SPI at 8 MHz — fast enough that we never miss a sample. Zephyr's device driver model and its power management hooks saved us weeks compared to bare-metal.
Turning raw samples into a shot
Raw IMU data is useless to a golfer. We compute four things on-device before sending anything over BLE:
- Clubhead speed — integrated from the accelerometer during the downswing, corrected with the gyro.
- Ball speed — derived from the impact spike and the post-impact velocity vector.
- Spin rate — from the gyro's magnitude right after impact.
- Launch angle — from the accelerometer's orientation at the moment of peak velocity.
We do this on the nRF52 in about 40 ms using a fixed-point implementation of the integration. Sending four floats instead of 2,400 raw samples cuts the BLE payload by roughly 99%. That matters when the phone is in a pocket 30 meters away.
BLE and the companion app
The ball advertises as a custom GATT service. We use a single characteristic with a 64-byte payload: shot ID, timestamp, and the four metrics packed as little-endian floats. The phone subscribes to notifications, so the ball pushes each shot as it happens — no polling.
Pairing is handled with LE Secure Connections and a 6-digit passkey printed inside the charging case. We didn't want a ball that anyone on the range could connect to.
One thing we learned: BLE connection intervals matter more than you'd think. We use a 15 ms interval during a round and drop to 500 ms when idle. That alone shaved 20% off our current budget.
PCB and mechanical
The PCB is a 4-layer rigid board, 28 mm across, with a 0.8 mm thickness so it fits the core. We designed it in KiCad. The antenna is a meandered inverted-F on the top layer with a keep-out zone — the urethane shell is RF-transparent, but the battery pouch isn't, so we oriented the antenna away from it.