>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
Python

How to Build Your Own Golf Radar Tracker with Raspberry Pi

OpenFlight Logo

Commercial golf monitors like TrackMan or Bushnell cost between two and twenty thousand dollars. For amateur practice sessions in a garage or backyard, that's insane money. The OpenFlight project offers an alternative: build a functional shot analyzer yourself using affordable Doppler radars and a Raspberry Pi. The basic setup costs around $400, and the extended version with launch angle control comes in under $560.

The project is written primarily in Python with a React web interface. Developer jewbetcha released the source code under the AGPL-3.0 license and actively develops the codebase together with the community.

How the System Works

The main challenge in tracking a ball strike is that events happen in fractions of a millisecond. If you read data from a standard sensor on a timer, it's easy to miss the moment the club contacts the ball.

OpenFlight solves this with a combination of a hardware acoustic trigger and a radar ring buffer.

The system architecture consists of four main components:

  1. The SparkFun SEN-14262 acoustic sensor picks up the sound of club-ball impact. It generates a hardware interrupt with a delay of approximately 10 microseconds.
  2. The 24 GHz OmniPreSense OPS243-A radar continuously writes raw quadrature I/Q data to a ring buffer at a sampling rate of 30 kSPS. On trigger signal, it dumps 4096 samples (approximately 136 ms around the moment of impact).
  3. An additional millimeter-wave radar TI IWR6843 with custom firmware measures the vertical launch angle of the ball and the clubhead path trajectory.
  4. Raspberry Pi 5 running Linux calculates physical parameters, runs a ballistic flight model, and delivers data via WebSockets to a local React dashboard.

What OpenFlight Can Measure

The OPS243-A radar unit detects the frequency shift of the reflected radio signal. At the base frequency of 24.125 GHz, each 1 mph of speed produces a Doppler shift of approximately 71.7 Hz. The project filters the spectrum and calculates several parameters:

  • Ball speed in the range from 35 to 200 mph with accuracy of approximately ±0.5%.
  • Club speed, which the software calculates from the signal spectrum a few milliseconds before the acoustic peak.
  • Smash Factor, or energy transfer ratio (ball speed divided by club speed).
  • Estimated carry distance based on a mathematical ballistic model.

The launch angle in the basic configuration is calculated approximately. If you connect the TI IWR6843 board, the system reads the true geometric angle and experimental club path.

By the way, there's a separate mode swing-speed for swing training without a ball. In it, the acoustic trigger is disabled, and the software reads peak speeds in a continuous stream.

Hardware and Assembly Details

The device can be assembled on a breadboard without complex soldering. The repository contains a detailed component table with links.

Basic equipment kit:

  • Doppler radar OPS243-A ($249)
  • Raspberry Pi 5 single-board computer ($130)
  • SparkFun SEN-14262 sound sensor ($18)
  • Seven-inch touchscreen display for standalone operation ($46)
  • Power supply and auxiliary wiring ($27)

If you need launch angle, you'll need to add the TI IWR6843LEVM module ($156). Previously, the author used K-LD7 modules, but they are now deprecated due to the maximum measurable speed limitation of 62 mph.

There's an important power consideration. The Raspberry Pi can't handle both radars running simultaneously over USB. So the OPS243-A connects via GPIO UART pins (/dev/ttyAMA0), and the TI board takes the USB port. The ready-made firmware for TI IWR6843 is already in folder firmware/releases/, so you won't need to build it in the Texas Instruments environment.

Quick Start

Installation on a fresh Raspberry Pi OS 64-bit is reduced to an interactive script:

git clone https://github.com/jewbetcha/openflight.git
cd openflight
./scripts/setup/setup.sh

The script will configure port access permissions, update dependencies, and set up autostart. After that, the tracker launches in kiosk mode:

# Базовый запуск со звуковым триггером
scripts/start-kiosk.sh

# Запуск с угловым радаром IWR6843 (значения геометрии замеряются по месту)
scripts/start-kiosk.sh --iwr6843 \
  --ops-port /dev/ttyAMA0 \
  --iwr6843-tee-m 1.372 --iwr6843-net-m 4.064 \
  --iwr6843-tilt-deg 5.5 --iwr6843-radar-height-m 0.229 \
  --iwr6843-ball-height-m 0.021

If the radar hasn't arrived yet but you want to poke around the code, running with the --mock flag generates synthetic shot data for UI debugging.

The web interface opens locally on port 8080. If you deploy it on a TV or tablet via http://openflight.local:8080/display, you get a convenient screen for the practice area.

There's a simple Python API for developers. Getting metrics in your own scripts takes literally ten lines:

from openflight.rolling_buffer import RollingBufferMonitor

monitor = RollingBufferMonitor()
monitor.connect()
monitor.start()

print("Готов к удару...")
shot = monitor.wait_for_shot(timeout=60)
if shot:
    print(f"Скорость мяча: {shot.ball_speed_mph:.1f} mph")
    print(f"Дистанция: {shot.estimated_carry_yards:.0f} yd")

monitor.stop()
monitor.disconnect()

Current Limitations and Weak Points

The author honestly documents the physical limitations of the chosen approach.

First, cosine error: if the ball doesn't fly exactly along the radar's line of sight, the measured speed will be slightly lower than the actual speed. The radar should be positioned exactly 1-1.5 meters behind the ball on the target line.

Second, ball spin rate measurement is still experimental. In enclosed spaces, the short flight path and parasitic signal reflections create noise, so live multi-tepper isn't currently used in distance calculations. The project team is currently working on a new algorithm for Doppler sideband dechirping (scripts/analysis/replay_spin_dechirp.py).

Who Will Find This Project Useful

OpenFlight is a great example of applied digital signal processing on affordable hardware.

The project will appeal to:

  • Golf enthusiasts who want a simulator for home practice without overpaying for proprietary branded boxes with closed subscriptions.
  • Embedded systems developers and DSP enthusiasts who want to dig into real I/Q radio data, FFT, and noise suppression algorithms.
  • Creators of their own sports simulators (the project already has connectors to GSPro and OpenGolfSim).

The codebase is well-structured, tests run through pytest with a virtual environment on uv, and the documentation on installation geometry and calibration is spelled out in detail. Definitely worth trying.

Related projects