Inspiration
Many people with Parkinson's walk with short, shuffling steps, and some experience "freezing," where their feet feel stuck to the floor. Physical therapists have a surprisingly simple tool for this: rhythm. Walking to a steady beat, known as rhythmic auditory cueing, helps patients find a steadier pace and take longer strides. The catch is that it usually happens in a clinic, with a therapist adjusting a metronome by hand. I wanted to put that therapist's metronome in a patient's pocket, and make it smart enough to adapt on its own.
What it does
StrideSync listens to your walk and plays a beat that walks with you.
- Detects steps. With the phone in a pocket or on a belt clip, the accelerometer picks up each heel strike.
- Measures cadence. It calculates steps per minute and how consistent your step timing is.
- Locks on. A beat starts at your natural pace and shifts its phase so each beat lands on a footfall.
- Ramps gently. Once you're in sync, the tempo rises a couple of percent at a time to encourage longer, quicker steps. If you fall out of sync it backs off, and if you stop or freeze it holds a steady beat and never speeds up.
- Reports. Each session uploads to a therapist portal showing cadence, consistency, sync quality, and trends across sessions.
How I built it
- Android app (Kotlin + Jetpack Compose). Raw accelerometer data at ~100 Hz is filtered and run through adaptive peak detection that is tuned for the low-amplitude, shuffling steps typical of Parkinson's gait.
- Phase-locked loop. Borrowing the beat-matching idea from DJ software, a PLL compares each step to the nearest beat and nudges the beat's timing. It couples tightly while locking on, then loosens during the ramp so the beat can lead the walker instead of chasing them.
- Synthesized metronome. Instead of time-stretching songs, I generate clicks directly with
AudioTrackso every beat lands on an exact audio sample. That gives precise tempo and phase control with no audio artifacts. - Safety-capped ramp controller. A state machine (calibrating → locking → ramping → holding → stepping back → paused) enforces hard limits on how fast and how far the tempo can rise.
- Foreground service so cueing keeps working with the screen off.
- Simulated walker. A synthetic gait generator that gradually entrains to the beat, letting me test and demo the whole pipeline without walking laps around the room.
- Firebase backend. Firestore stores session summaries, and a TypeScript + Chart.js portal on Firebase Hosting visualizes them for therapists.
Challenges I ran into
- Two clocks. Android sensor timestamps and audio timestamps use different time bases. Mixing them made the phase lock drift until I converted everything to one clock.
- Latency. A beat isn't heard the instant it's written, and Bluetooth headphones add a delay of their own. I had to measure and compensate for output latency to line beats up with real footsteps.
- Leading vs. following. If the beat follows your steps too faithfully, it can never pull your pace upward. Balancing lock-on strength against the ramp was the core design problem.
- Subtle steps. Shuffling steps make weak accelerometer spikes, so fixed thresholds missed them. Adaptive thresholds fixed that.
- Samsung battery management kept killing the sensors at screen-off until I configured the app for unrestricted background use.
Accomplishments that I'm proud of
- A complete loop, from sensor to beat to sync measurement to adaptive tempo, running in real time on a phone.
- Beats that genuinely land on footfalls, not just at the right tempo.
- A simulator realistic enough to show the lock → ramp → step-back behavior live.
- An end-to-end product in 24 hours, solo: mobile app, cloud backend, and therapist dashboard.
What I learned
- Signal processing on real, messy body motion is very different from textbook examples.
- Control-systems ideas like PLLs and hysteresis map neatly onto human-in-the-loop problems.
- A deterministic replay/simulation mode is the best investment you can make in a hardware-dependent hackathon project.
What's next for StrideSync
- Validation with physical therapists and people living with Parkinson's.
- Therapist-set session plans: target cadence, ramp rate, and limits per patient.
- Freezing-of-gait detection with dedicated cueing to help restart walking.
- Music with strong beats as an alternative to the metronome, plus haptic cues for noisy environments.
- Wear OS support for wrist or ankle sensing.
- Proper clinical-grade privacy and security before any real-world use.
StrideSync is a hackathon prototype, not a medical device.
Built With
- audiotrack
- authentication
- chart.js
- cloud
- compose
- coroutines
- firestore
- foreground
- gradle
- hosting
- jetpack
- kotlin
- samsung
- sensormanager
- service
- typescript
- vite