We have made some progress with an Android Wear version of OpenSeizureDetector (long train journeys for work have their uses!). It is not ready for testing yet, but it is starting to take shape. What we have got is:
- A very simple Android Wear app that does the basic seizure detection calculations – collects acceleration data and does Fourier Analysis to get us a frequency spectrum.
- Packages the analysis results into a message that is sent to the OpenSeizureDetector app on the phone.
- The development version of the OpenSeizureDetector phone app (V3.0.0) has an ‘Android Wear’ data source that works in a similar way to the Pebble data source – it waits for the watch to send it data, and displays the data on the screen, raising alarms when necessary.
- You can see it running on the phone and my Android Wear watch below
For those who are interested, the source code for the watch app is at https://github.com/openseizuredetector/AndroidWear_SD
and the updated phone app is the V3.0.x branch at https://github.com/OpenSeizureDetector/Android_Pebble_SD/tree/V3.0.x
Any offers of help would be gratefully received!!
What is left to do?
- Check the seizure detection calculations on Android Wear – I think the values are higher than the equivalent Pebble one, so we must have units wrong somewhere.
- Provide a way of editing the seizure detection settings for the Android Wear seizure detector (They are hard coded at present – need to provide a user interface on the phone to edit settings, and ability to send settings to the watch), and maybe allow on-watch editing too?
- Add ability to start the seizure detector watch app from the phone, so it starts when the OpenSeizureDetector phone app starts.
- Add a user-interface to the watch like we have on pebble – ability to raise alarms manually, and mute alarms if you are doing something that is liable to trigger a false alarm.
- Find out why it does odd things when I disconnect the debugger from the watch – it was working fine for half an hour with the USB debugger connected, and is showing FAULT now I have disconnected it….. (seemed to need a manual re-start…). I think it may be going to sleep after a while….
- Some Android Wear devices have heart rate monitors – maybe use that to look at heart rate and blood oxygen saturation too? (I’ll need to get a watch with these sensors to try that though – my Sony SmartWatch 3 does not have them).
With Pebble watches no longer being produced we will need a different hardware platform if we keep the OpenSeizureDetector project going.
We could just leave it and use the Embrace watch, but I am not that happy with Embrace for two reasons:
- I am not convinced about its detection reliability – I can not make it go off doing what I think of as seizure-like movements (but other people report it working well for them, so it could just be me).
- The alarm annunciation infrastructure is very complex – the watch talks to the paired phone, which uses a wifi or mobile internet connection to connect to the Empathica servers. The servers then use the mobile phone infrastructure to make a phone call. But I mostly want a device in the next room to go ‘beep’, so I would rather have a more direct connection (OpenSeizureDetector uses WiFi so avoids a lot of the infrastructure)
So, given that I am looking for an alternative platform for OpenSeizureDetector. It is very tempting to try to make one – it would be fun to do the electronic design and firmware, but that would be a big undertaking, and not something I could do in my spare time, so I need a commercially available platform.
I have been looking at Android Wear, which has been suggested by a few people – I did not use this before because Android Wear devices are so much more expensive than Pebble Watches. For Android Wear to be feasible, we need to confirm a couple of things:
- We can obtain accelerometer readings at a high enough frequency (~50 Hz), and do Fourier analysis on it to do the seizure detection.
- The battery consumption has to be reasonable.
I have made a proof-of-concept Android Wear app to test it out. The App does the following:
- Starts a background service that collects accelerometer data for about 5 seconds, then calculates a Fourier Transform of the data….then repeats indefinitely.
- The activity connects to the service and shows the number of samples collected, so you can see it is doing something.
It does not look very exciting – see picture of it running on my Sony Smartwatch 3 above.
...but most importantly, it is surprisingly (suspiciously so if I am honest) frugal with the battery. The second half of this trace has the new app running, and it is still only draining of the order 1% per hour.
So based on this, I think porting OpenSeizureDetector to Android Wear is feasible. There is quite a lot to do to get it working though:
- Communication to the phone (both settings and alarm status updates)
- On-watch user interface (mute, manual alarm etc.)
- Port Seizure Detection algorithm – the acceleration units are different in AndroidWear compared to Pebble, so we need to do some scaling so that the seizure detector settings can be the same.
- Package the Android Wear App – it will probably be a different Google Play Store app, so we will need to integrate that into the OpenSeizureDetector Android App.
Fortunately there are a couple of other people interested in helping, so there is a fair chance of getting this finished this year.