Inspiration

I spend a lot of time in the gym, and one of the easiest ways to waste that time is to repeat the same movement without realizing that your reps are getting faster, shorter, or less consistent. When you train alone, there usually isn't anyone watching every rep and telling you when your execution starts to drift. I wanted to build something small enough to wear on your wrist that could learn what a good rep looks like for you and give useful feedback after each set.

What it does

Motion Coach is a wrist-worn movement tracker that learns a personal reference for an exercise and compares future reps against it.

The wearable measures motion using an IMU and streams the data over Bluetooth. The software automatically detects individual reps and measures things like rep duration, movement range, peak velocity, consistency, and similarity to your reference.

After a set, the system decides whether there was a meaningful issue, such as moving too quickly or shortening your range. If there is, it generates a short coaching explanation and speaks it out loud. Good sets are recognized too, but the coach stays quiet unless there is something useful to correct.

Each exercise gets its own calibration profile, so the same wearable can adapt to movements such as bicep curls, lateral raises, and triceps extensions.

How I built it

The wearable uses a XIAO ESP32-C5 connected to a 6-axis IMU. The ESP32 samples accelerometer and gyroscope data at roughly 50 Hz and streams compact packets over Bluetooth Low Energy.

On the backend, Python and FastAPI process the sensor stream. During calibration, the system records a quiet baseline and five reference reps. Instead of hard-coding a sensor axis, it uses PCA to learn the dominant direction of motion for that exercise.

A deterministic state machine then segments the continuous signal into reps and computes metrics such as:

  • rep duration
  • angular excursion
  • peak angular velocity
  • consistency
  • reference waveform similarity

The measurements are converted into structured RepMetrics and SetMetrics.

A deterministic deviation layer first determines which problems are actually supported by the measurements. Jev is then used to prioritize between valid coaching issues rather than inventing problems from raw sensor data. Gemini turns the resulting decision into natural coaching language, and ElevenLabs speaks the feedback.

The frontend is built with React + TypeScript and shows the live sensor connection, rep count, set metrics, coaching decision, and calibration state.

Challenges I ran into

The biggest challenge was turning noisy wrist movement into reliable rep boundaries.

Early versions would sometimes count five fast reps as ten or eleven because small rebounds in the wrist velocity looked like new repetitions. I ended up redesigning the rep state machine so a rep cannot finish from a simple direction change alone. It now requires meaningful movement in both phases of the rep, sufficient angular excursion, and timing constraints learned from calibration.

Calibration caused another major problem. Initially, movement was accidentally included in the "resting" portion of calibration, which made the estimated sensor noise extremely high and corrupted the reference profile. I replaced that with an explicit hold-still phase before recording reference reps.

I also discovered that giving an AI model unrestricted access to all of the metrics produced strange coaching decisions. For example, an obviously faster set could sometimes receive range-of-motion advice. I fixed this by making the measurements deterministic first: the software identifies which deviations actually exist, and Jev can only choose between those valid candidates.

Finally, coordinating Bluetooth, cloud inference, text-to-speech latency, and a clear user interface was much harder than any individual component.

Accomplishments that I'm proud of

The biggest accomplishment is that the entire system works with a real wearable rather than prerecorded or simulated sensor data.

I built an end-to-end pipeline from:

physical movement → BLE sensor stream → automatic rep detection → movement metrics → intelligent decision → natural-language coaching → spoken feedback

The system can calibrate itself to a user's movement without requiring a fixed sensor orientation, detect reps automatically, distinguish normal, fast, and shortened movements, and keep separate calibration profiles for different exercises.

I am also proud that the AI is not responsible for inventing measurements. The signal processing determines what physically happened, while the AI is used only where interpretation and communication are useful.

What I learned

I learned a lot about working with real sensor data. A signal that looks obvious to a human can become surprisingly difficult once noise, momentum, sensor orientation, and different movement speeds are involved.

I also learned that calibration is extremely important. A personalized reference made the system much more useful than trying to define one universal "correct" rep.

Another major lesson was that AI works much better when it is given bounded responsibilities. Instead of asking a model to look at sensor numbers and decide everything, I got much more reliable results by calculating objective facts first and only asking AI to prioritize and explain them.

I also learned how important UX is for a hardware system. Clearly showing when calibration starts, when a set begins, and when analysis happens made the system much easier to understand and test.

What's next for Motion Coach

The next step is supporting more movements and collecting a larger dataset across different users, speeds, loads, and sensor placements.

I would also like to improve the motion model beyond a single wrist sensor by experimenting with additional IMUs or different placements, which could make it possible to estimate more complex movements and distinguish technique problems more accurately.

Longer term, I want to move more of the signal processing onto the wearable itself, reduce latency, and build a library of personalized exercise profiles so Motion Coach can become a general-purpose wearable training assistant rather than a prototype for a few movements.

Built With

Share this project:

Updates

Submission history