← ALL PROJECTS

Baja Telemetry System

Live race telemetry over ESP-NOW

Baja Telemetry System

Overview:

Two ESP32 boards that get live race data to the pit. One sits on the car with an IMU and GPS on a shared I²C bus and sends telemetry over ESP-NOW. The other runs in the pit, makes its own WiFi network, and serves a dashboard.

The IMU reads at 100 Hz and frames go out at 10 Hz.

How the link works:

Baja Telemetry System

Both boards sit on the same WiFi channel. The car broadcasts until a receiver answers, then switches to unicast so frames get 802.11 acks and hardware retries. If the receiver goes quiet, it goes back to broadcasting. No MAC addresses are hardcoded, so either board can be swapped without reflashing the other.

Every frame is self-contained. A receiver that missed 500 frames decodes the next one and is current again.

Design decisions:

Position is stored as 32-bit microdegrees instead of floats. A float only resolves latitude to about half a metre, which is wider than the car. The integer version is the same eight bytes and gets about a centimetre.

Frames carry a magic number and a version number, so old receiver firmware rejects newer frames instead of showing garbage.

Packet loss is counted over sequence numbers, not over received frames. Counting received frames makes the number useless when the link is bad.

The GPS and IMU are read from one task, since two tasks on one I²C bus corrupt it.

Testing:

Host-compiled tests cover the frame layout and the loss accounting, so no hardware is needed. A separate build target fakes a lap, which lets the whole link be tested on the bench.

Enlarged photo