TREMOR12W: tremor measurements on Apple Watch
After learning how to transfer data from the Apple Watch to the iPhone, I have been working on the TREMOR12 app by creating a WatchKit extension to perform tremor measurements on the Apple Watch and send them to the iPhone. You can browse the code in the “watch” branch in the GitHub repo.
Despite the official Apple documentation saying that watchOS2 supports the CMDeviceMotion class, apparently it does not. Maybe it is hardware related and we will have to wait for the next Apple Watch that is supposed to appear this year, but currently it seems that only the accelerometer is available. That is confirmed by several posts on StackOverflow.com and also this sample code.
Things get worse. I managed to implement the accelerometer from the Apple Watch for tremor measurements and send the data as CSV to the iPhone:
From there I can export the (anonymous) data to e.g. Dropbox and use the modified TREMOR12WP Jupyter Notebook to process the data and even produce a nice graph:
- The CMAccelerometer class does not have a timestamp (compared to CMDeviceMotion) so I cannot annotate the time of measurement to the samples. Maybe a solution could be developed using the device time, but the timestamp allows milliseconds security which is better (and working in the iOS version).
- Dealbreaker: if you rotate the Apple Watch on your wrist, it will deactivate. This will stop measurements and there is no way to disable that feature! The only solution that I am aware of, would be to implement the HealthKit framework (in particular the HKWorkoutSession). This will keep the app in the foreground instead of deactivating it. Still, that does not solve the other issues described above.
In conclusion, at the moment it seems to early for a broad range of tremor measurements on the Apple Watch, but I expect improved opportunities from future hardware upgrades. For now, implementing HealthKit may have some advantages. For the future, combining HealthKit with ResearchKit could be a winning combination as it allows to combine data measurement with storage and informed consent for study participation.
Will be continued…. For now, here are the current images of TREMOR12W: