Project Details

Design Goals:

AimTracer was designed around a few practical requirements:

  • Small and light enough to mount on a (match air-) pistol
  • No permanent modification of the pistol
  • Useful for both live-fire and dry-fire training
  • Automatic shot detection without a trigger-mounted switch
  • Immediate feedback after every shot
  • Native support for iPhone and Android
  • Fully local data storage without accounts or cloud services
  • Open raw data instead of an inaccessible proprietary score
  • Reproducible sessions that can be compared with electronic target reports

The device deliberately evaluates the shooting process rather than predicting the hit. Target alignment, sight picture and the exact aiming point remain outside the scope of an IMU-only system.

Hardware

The complete sensor unit is built around a single Seeed Studio XIAO nRF52840 Sense:

  • Nordic nRF52840 microcontroller
  • 64 MHz ARM Cortex-M4F processor
  • 256 KB RAM
  • 1 MB internal flash and 2 MB onboard flash
  • Integrated Bluetooth Low Energy radio and antenna
  • Integrated LSM6DS3TR-C six-axis IMU
  • Three-axis gyroscope
  • Three-axis accelerometer
  • Integrated digital PDM microphone
  • USB-C connection
  • BQ25101 LiPo charger
  • Board dimensions of approximately 21 × 17.8 mm

Additionally:

  • Internal 3.7 V, 150 mAh LiPo battery
  • Physical power switch
  • Custom 3D-printed enclosure and pistol mount for
    • 10mm mounting for weight bars (as seen on my Walther LP 300 XT)
    • 30mm, 30.5mm and 33mm compressed air cylinder mounting for different brands like Walther, Steyr or Feinwerkbau.
    •  Picatinny mount, for mounting on real guns (or also replicas or co2 weapons)

No external sensor board, microphone module or additional signal wiring is required.

The current mounting profile places the XIAO with its component and sensor side facing down, PCB underside facing up and USB-C connector pointing toward the shooter. The mount must be rigid: movement between the sensor and pistol would appear as movement in the measurement.

Sensor Configuration

The firmware uses the following acquisition settings:

  • IMU acquisition rate: 416 Hz
  • Gyroscope range: ±500°/s
  • Gyroscope scale: 0.0175°/s per LSB
  • Accelerometer range: ±8 g
  • Accelerometer scale: 0.000244 g per LSB
  • IMU interface: 400 kHz I²C
  • PDM microphone rate: 16 kHz
  • Microphone mode: mono
  • Microphone gain: 20
  • Default live-data rate: 25 Hz
  • Configurable live-data range: 5–50 Hz

At startup, the device collects 256 stationary gyroscope samples and calculates the zero-rate bias for all three axes. A new calibration can also be requested from the app. The device must remain motionless during this process.

Shot Detection

AimTracer combines acoustic and motion information instead of relying on one sensor alone.

The firmware continuously monitors:

  • PDM microphone peak amplitude
  • Change in accelerometer values
  • Maximum angular velocity reported by the gyroscope

Three detection modes are available:

  • Audio only
  • Motion only
  • Audio and motion within a shared time window

The combined mode is the default. It helps reject conversations and shots from neighbouring lanes while also avoiding triggers caused by ordinary pistol movement.

Current default values are:

  • Microphone threshold: 7,000 raw PCM units
  • Acceleration-delta threshold: 1,500 raw LSB
  • Gyroscope threshold: 2,000 raw LSB
  • Audio/motion coincidence window: 40 ms
  • Trigger refractory period: 1,200 ms

These values are starting points. They can be changed from either app and sent to the running firmware over Bluetooth. Live fire and dry fire may require different threshold settings.

A manual test trigger is included for calibration, debugging and checking the complete capture pipeline without relying on automatic detection.

Ring Buffer and Shot Capture

Sensor acquisition runs continuously while the device is armed.

A circular buffer always retains the latest movement data. When a trigger is detected, AimTracer preserves the movement before the trigger and continues recording afterward.

Default capture window:

  • 500 ms before...
Read more »