Insulin Nation

Confessions of a Diabetes Hacker

There is a quiet hacking revolution taking place in the Type 1 diabetes community. You can identify its followers by the popular hashtag #WeAreNotWaiting.

There are currently thousands of individuals running an app known as Nightscout to upload real-time blood glucose readings from their Dexcom continuous glucose monitors to their own private servers. This allows hundreds of parents to keep close watch over the health of children with Type 1. While this kind of customized surveillance can be done with current diabetes technology, it has yet to be approved by the FDA. Many of us have decided that we are not waiting for that agency’s blessing.

I was diagnosed with Type 1 four months ago. At that time, I knew nothing about diabetes. I was in disbelief when I discovered that if I wanted to see my glucose levels in real time, I would need to carry around an extra, bulky device in my pocket. If I wanted to see that data anywhere else, I would need to plug it into a computer and upload it. If a loved one wanted to check in to see if I was doing alright, they would need to call me and hope I answered. This seemed anachronistic in the wireless age.

I promptly got to work on a project I have dubbed DexDrip, a wireless bluetooth bridge that would allow real-time blood glucose readings from a sensor to be delivered straight to my phone. I started by researching the Nightscout project. After doing some digging, I soon discovered an underground community of individuals working on similar projects to mine. Skirting just outside the peripheral vision of the FDA, they are working on all sorts of projects, including their own closed-loop artificial pancreas systems. Some are working in groups, others are working alone, but all share the same goal of making lives for people with diabetes easier, better, and (although they are taking personal risks) safer.

Finding these people was difficult because many want to remain anonymous, but I was amazed by the community; everyone was there to help me. Once I discovered how to intercept transmissions from my Dexcom transmitter, it was pretty straightforward to steer the signal to my smartphone.

The math presents a bigger challenge. Every 12 hours, the Dexcom receiver asks the user to enter his or her current blood glucose value so it can recalibrate. I couldn’t find a way to work around this automatic recalibration request. If I was going to cut the receiver out of the equation, I would need to write my own calibration algorithm.

(Editor’s warning – There be complicated math ahead!)

After closely watching and logging the numbers spit out by my Dexcom, it became apparent that the math wasn’t as complicated as I would have thought. They were using a basic linear regression with a little bit of out-of-band (OOB) error handling. I set out to write a new algorithm, one that would use a weighted least squares linear regression, pulling weights to lower the confidence of certain calibration entries depending on a variety of factors.

I was about two weeks into the project when Dexcom announced their new 505 algorithm. As it turned out, it also used a weighted least squares linear regression, but it was unclear what they were using for weights. I was unsure how mine would compare to theirs.

(Editor’s note – Complicated math section done.)

I decided to find out. I held a weeklong event on Twitter which I called the #BattleOfTheDexes. Every 12 hours I would perform a meter test just as the Dexcom requested and I would compare the regular continuous glucose monitor with my creation. I was pleased to find that my algorithm outperformed in accuracy for the entire life of a sensor.

Of course, this was a singular example—one person, one sensor, nothing conclusive—and there is certainly room for improvement in my algorithm that can only really be done with large amounts of data. I hope to make things even more accurate and prove my algorithm more conclusively.

My homemade DexDrip runs on my phone all day, every day, and serves as my primary source of glucose monitoring data. There is still work to be done—safety improvements, security improvements, features to be added, the list may never end—but I want, and believe others need, a more convenient, more accurate, cloud-connected CGM.

That is why I am not waiting.

Insulin Nation takes no position on DIY diabetes tech hacks. As always, we urge you to consult with your medical care provider before making any change in your diabetes self-care routine.

Thanks for reading this Insulin Nation article. Want more Type 1 news? Subscribe here.

Have Type 2 diabetes or know someone who does? Try Type 2 Nation, our sister publication.