ESP8266-based CGM-monitor for Nightscout, Part 1
In order to make it easier to keep track of out daugters glucose levels at night I have started devlopment of a CGM-monitor. The monitor will use data from the API for our daughets Nightscout installation.
The Nightscout Foundation is the maintainer of the Nightscout sotfware. The software was developed as OSS as a reaction to that the medical companies development was perceived too slow by a community of parents to children with diabetes type 1. The parents did see the benefits of collecting data for analytical purposes and also later on as a way to create an open or closed loop system with monitoring and adjustment of insulin pumps. The tagline of the Nightscout Foundation is appropriately #WeAreNotWaiting.
About a year ago our, then to be 7 year old daughter, was diagnosed with diabetes type 1. The diagnosis require us to constantly keep track of her glucose levels and admnister insulin if the level is getting too high or dextrose, or other carbohydrates, if the levels are geting too low.
This is especially challenging at night. When she recieved an Abbot Freestyle Libre glucose monitor from the hospital we realized that is was possible to monitor the glucose levels remotely with some additional equipment.
We bought a Sony SmartWatch 3 that was downgraded to an earlier Android Wear version to which it was a patch that unlocked the NFC-reading capability on the watch so that it could be used with, in our case, Freestyle Libre Alarm. Recently Ambrosia Systems have started to ship it’s BluCon device that significantly simplifies getting started with CGM-monitoring.
All the monitoring in Nightscout can be done in any modern webrowser, on desktop or mobile, at our installation. But since it requires us to pick up the phone I started to think about making a device with a display that can show the latest readings that can be placed on the bedside table. This is fairly easy to accomplish since Nightscout provieds an API that can be enabled. The sensor is read every 5 minutes so the readings can be fetched every 5 minutes or more.
Since I have some eperience with the ESP8266 so I ordered a couple of OLED displays. Now I have started to implement the UI. The UI consists at the moment of two screens;
- the first will display the lastest readings (5 - 10 readings)
- the second screen will have the latest reading in numbers
Both screens will have a common status bar that will display the current trend and the time of the latest reading.
The UI is getting finished and the next up is to impement calling the Nightscout API and the parsing of the JSON to get the readings.