A Garmin watch detects sustained, high-amplitude wrist shaking and tells your phone.
โ Install on your Garmin watch
The watch reads its accelerometer 25 times a second and counts how often the movement crosses an amplitude threshold. Two things then have to be true at once: enough of those crossings inside a five-second window, and at least three seconds of them running without a break. The second condition is what separates shaking from a single hard knock, which reaches the count on its own inside one second.
When both hold โ roughly three to three and a half seconds after the shaking starts โ the watch vibrates, beeps and lights the screen, and posts a short signal to this server. The server then pushes a notification to every browser subscribed to that watch.
Detection happens entirely on the watch, so it keeps working with the phone off, out of range or out of signal โ the phone is only a louder speaker. To keep notifications useful rather than noisy, the watch tells the server at most once a minute even while it keeps buzzing on the wrist every few seconds.
The alarm is aimed at whoever is nearby, not at the person wearing the watch. Someone in the middle of an event cannot act on their own watch buzzing. The sound and vibration are there for anyone within earshot; the notification reaches someone in another room.
this-site/s/CODE to reach the setup page.That is it. From then on the watch sends an alert whenever it triggers.
Apple does not allow notifications for sites opened in a Safari tab, so at step 2 the page will ask you to install it as an app:
Requires iOS 16.4 or newer. Always open it from the Home Screen icon afterwards: in a Safari tab, subscribing is unavailable again.
On the watch: Menu โ Test fires a real alarm and reports whether the signal reached the server. The watch vibrates and a notification arrives on the phone.
Everything is open source โ the Connect IQ watch app and this server live in one repository:
github.com/geminixandroid/garmin-shake-detector
Licensed under GPL-3.0-or-later.
If you need something clinically founded rather than a personal experiment, look at OpenSeizureDetector: a separate project that streams the watch's accelerometer to a phone and analyses it there with a proper frequency-domain algorithm.
Bug reports and pull requests are welcome. If you run your own instance, the watch app's
server address is a build-time constant in ShakeDetectorPhone.mc.