Month: April 2018

My OpenAPS G4 Case

Speed Read This
Posted by on April 13, 2018

I have type 1 diabetes, an autoimmune condition which requires I constantly measure my blood sugar and use insulin to control it. The simplified model is: blood sugar goes up as a result of food and as a result of time, down as a result of insulin, and the goal is to keep it inside a narrow range. I have a Dexcom G4 continuous glucose sensor, which measures blood sugar every five minutes, and a a Medtronic insulin pump, which gives insulin on command; but until recently, there was no way to make these talk to each other, so I had to make all insulin-delivery decisions by hand.

OpenAPS is an open source project which takes continuous glucose monitor data, and uses an insecure 900MHz radio protocol to command the pump. It works, and it works very well! One thing I found left a lot to be desired, though, was the case hardware–none of the options people had designed were both sufficiently protective, and small enough to fit in my pocket. (While I was waiting for the case to be printed and to arrive, I broke the USB OTG connector off my Explorer Block, by keeping it in my pocket with only an antistatic bag for protection, thus demonstrating that a good protective case is indeed necessary). So I downloaded the trial version of Fusion 360, measured all the parts carefully, and designed one. This post documents the case, what parts it works with and how to assemble an OpenAPS rig using it if you are using the right components (in particular, an Intel Edison and a Dexcom G4).

The rest of this post is aimed at people who use OpenAPS or are looking to get started with OpenAPS, who arrived here via a link from the “Get your rig hardware” section of the OpenAPS documentation. It is probably not as interesting to others.

Parts:

The end result is pocket sized (albeit just barely), and fairly close to the theoretical limit of how small it can be without exposing a connector to impact. It looks like this:
Photo of OpenAPS case+G4+battery fully assembled

Start with the case:
OpenAPS case for G4+Edison, disassembled

Mount the Intel Edison on the Explorer Block, and plug the USB OTG cable into the USB port labelled “OTG”. Thread a regular USB cable through the hole in the case and conect it to the Explorer block, and put the Explorer block in the case.
OpenAPS case with Explorer Block and USB cable

Plug in the G4. It should fit in the slot tightly.
OpenAPS-case-R2-withDexcom

Next, we’re going to guide the cable to prevent the USB port on the Explorer block from getting damaged if the cable gets pulled on. (This risk is not theoretical; before I built this case, I broke the connector off one Explorer Block that way). This will also give limited protection from moisture. Start by placing two pieces of electrical tape over the hole, one on each side of the cable:
OpenAPS-case-R2-strainrelief1

Add a horizontal piece of tape to guide the cable to the end, followed by a vertical piece to secure it in place. If you ever yank on the cable too hard, this will come off and absorb most of the force, protecting the rest of the rig from damage.
OpenAPS-case-R2-strainrelief2

Next, tape the top. Be careful not to cover too much of the speakers, or alerts migth stop being audible. Finally, hook up the battery.
Photo of OpenAPS case+G4+battery fully assembled

One limitation of this setup is that, because the battery is connected via USB instead of via the 3.7V power connector on the Explorer Block, the OpenAPS software can’t measure the battery’s charge level and warn you when it’s low. This is unavoidable, since if you power it via the 3.7V power connector instead, then it can’t communicate with the Dexcom G4, since USB OTG requires 5V power and it doesn’t have the circuitry to step 3.7V up to 5V. I’ve addressed this by adding a software feature which measures uptime, and delivers an alert when it’s been running for a duration which suggests the battery is probably low; since the rate of drain is fairly consistent, and since I’m swapping two identical batteries and always charging them fully before connecting them, this is good enough. This feature will probably land in OpenAPS 0.7, or (if you must) you can use my fork.

This is the second revision. The first was about 10% bigger on each axis than it needed to be, and had sharp corners. If someone wanted to make a third revision, the one thing that could be improved would be to carve out a compartment on the bottom for two AAA batteries, for use as pump spares.