Recognising Ṭawāf from motion alone
Seven circuits have a signature. How accelerometer and gyroscope traces let guidance advance itself without the pilgrim touching a screen.

Asking a pilgrim to tap a counter seven times while performing Ṭawāf is asking them to divide their attention at exactly the moment they least want to. Worse, taps are lost: a phone in a bag, a hand carrying a child, a moment of emotion at the Black Stone.
What a circuit looks like in data
Ṭawāf is a constrained walk on a roughly circular path, anticlockwise, at a pace set by the crowd. In the gyroscope's yaw channel it appears as a slow, sustained heading rotation accumulating 360 degrees per circuit — a signal almost nothing else in a pilgrim's day produces.
- Heading integration gives the circuit count directly, with drift corrected at each pass of the Yemeni corner.
- Step cadence separates walking Ṭawāf from being pushed in a wheelchair, which changes the vertical acceleration profile entirely.
- Pauses at the Multazam or in supplication are recognised as pauses, not as completion.
- Saʿī differs cleanly: it is linear, with a hard reversal at each end rather than a continuous turn.
Why we still show a manual counter
Because ritual correctness belongs to the pilgrim. The automatic count is a suggestion rendered alongside a tap counter the pilgrim can override at any point, and the app never declares a rite complete on the pilgrim's behalf. Confidence below threshold falls back silently to manual and says so.
“A model that is right 97% of the time is a wonderful convenience and an unacceptable authority.”
Inference runs on the phone. No motion traces leave the device; only the resulting circuit count syncs, and only when the pilgrim has consented to trip progress being visible to their group.
Last updated 18 May 2026
