With Pebble watches not being available any more, and Android Wear devices being very expensive, I am still wondering about an alternative seizure detector hardware platform.
I have heard about ESP8266 modules – they are small microcontrollers with built in wifi capability. Although most people connect them to another microcontroller, it is possible to write your own software to run directly on it so I am wondering if it may be possible to make a seizure detector watch with them – It would need an ESP8266 module, an accelerometer chip and a LiPo battery, and put it in a 3D printed case.
I have just got an ESP8266 module with a built in USB interface. This is a bit on the big side, but about the same size as a Pebble Time, so not out of the question (top image on right)
I have also got a few smaller modules that do not have a USB interface, so will take a bit more programming, but they are a lot smaller (bottom image on right)
The most surprising thing is the cost – the big one with extra hardware was just over £5, but the small ones are less than £2 each – it is hard to believe anyone can manufacture things and ship them from China for that price….
I have set up the compiler toolchain from https://github.com/pfalcon/esp-open-sdk, and obtained the tools to interact with the boards from https://github.com/espressif/esptool, and finally obtained some example programmes from https://github.com/esp8266/source-code-examples.git, which includes a ‘blink’ example.
After a bit of faffing to get the Makefile to work with my new cross compiler, ‘make’ will compile the programme, and ‘make flash’ will write it to the board.
After which – the on-board LED flashes on and off every second – success – the Microcontroller equivalent of ‘Hello World!’.
Next steps are:
- Connect an accelerometer chip to the board, using the SPI or I2C interface and try to read data from it (like I did using an Arduino back in 2013 – Soldering onto Surface Mount ICs).
- Port the Pebble_SD seizure detector algorithm to the board to see if it will fit.
- Get it to act as an OpenSeizureDetector network data source so that other devices can connect to it to detect alarms etc.
- See if we can get the power consumption down enough that running it off a watch battery is feasible.
- If it seems feasible, re-commission my 3D printer and try to make a case.
- Think about adding an optical heart rate and blood saturation measurement to it.
The video below is not exciting, but it proves we can at least run a programme on one of these tiny (and very cheap) boards.