Building diabetes technology is like building a mountain bike

I’ve had the opportunity to meet some fantastic people through our work with #DIYPS and #OpenAPS, one of whom is Eric Von Hippel, an MIT professor and researcher who work on user innovation. He shared a great example of user innovation that I was previously unfamiliar with, but is an awesome parallel for what we in the diabetes community are doing.

History: bike manufacturers used to make bikes for riding on flat surfaces. Some people wanted to ride their bikes down mountains, but existing bikes weren’t too comfortable (they didn’t have spring-based seats – ouch!). So, bikers started customizing and modifying the bikes they had. Eventually, bike manufacturers saw the demand and started building mountain bikes with the same features that the original mountain bikers had used. (And if you don’t like my paraphrased version of this story, Wikipedia is always your friend!)

The parallels:

We in the diabetes community have seen a series of needs that are not being met with our existing, FDA approved medical devices that are out on the market. From not-loud-enough alarms to not enabling us to track critical information like temporary basal rate history on the pump itself, these are the needs that drove me (and Scott) to first build #DIYPS and then to close the loop. At the same time, the need for remote data access is what drove John Costik and then the other Nightscout founders and developers to build an amazing, community-based open source tool to enable real-time remote data sharing.

Are there commercial products coming to market or are in the market that meet some of these needs now? Sure. But remember, I’ve had diabetes since 2002. In 2013, when Scott and I first started working to solve my need for louder alarms, there was NO commercial solution available for either remote data access or alarm customization. Thus the need for #DIYPS, which we built in 2013, and Nightscout, which blossomed in early 2014. And even though tools like Dexcom SHARE and MiniMed Connect have come to market (and in some cases, more quickly with help from the community communicating to the FDA about the critical importance of these tools), they came in 2015, which is a long time to wait for new tools when you’re dealing with diabetes 24/7/365. And when we managed to close the loop, again with help from the amazing #wearenotwaiting community, in December of 2014? Well, it’s now nearing the end of a year (and with amazing continued results from #OpenAPS not just for me, but for 13 additional people and potentially more to come soon), and we are AT LEAST a year and a half, if not more, away from any commercial device to reach the market. Not to mention: I’m not sure that the first generation of closed loops commercially available will be good enough for me.

The commercial entities are getting there. And, I always want to give them credit – I have a closed loop, but I can’t have one without a solidly working insulin pump and an excellent CGM system. They are, for the most part (with the exception of some missing features), making good, solid safe products for me to use.

The manufacturers are also starting to be open to more conversations. Not just “listening”, which they’ve sort-of/maybe done in drips over the past, but actual two-way conversations where we can share the needs that we know of in the community, and discuss what can be incorporated into their commercial product pipeline more quickly. This is progress starting to be made, and I’m excited to see more of it. It seems like there is a refreshed mindset and energy in the industry, as well as an understanding that we all care deeply about safety and that we’re all in this together to make life with diabetes less of a burden – like riding downhill on a mountain bike rather than a road bike.

“Should I build an artificial pancreas?” (It’s a personal question)

Given that many (7 almost 8!) of us have closed the loop with OpenAPS, and sometimes show pictures of great overnights like the below, and given the fact that diabetes is a complicated, annoying, unfair disease, there is a lot of interest in closing the loop. Scott and I definitely get that, which is why we started the #OpenAPS movement.

I have been asked more and more lately, “Are you going to make this available to less tech-savvy people?” and “Should I build one?”.

Less insulin needed and OpenAPS reduced accordingly

The answer to the first question is emotionally hard, because a DIY build of a medical device that auto-adjusts insulin will always involve some technical knowledge – or at the very least, a growth mindset and willing to learn many new things to build a technical knowledge in order to proceed through the murky process of building a not-100%-documented artificial pancreas. You don’t have to be a programmer or an engineer; but you do have to have time and energy to spend learning as well as doing. I say this every day: the DIY part is important.

(And, I know people always want to hear “yes! It’ll be out on X date, and just as easy as installing Nightscout.” But it’s not as easy as installing something like Nightscout and never will be.)

That leads into the second question as an explanation of why it’s not as easy as we would wish:

Even if you have a very technical background, you’ll still spend time learning new languages, new pieces of software, and building pieces of your own. Things will break, things will need to be improved, and you need to have the knowledge of what’s going on and understand the logic of what you’re trying to achieve at each stage in order to be able to troubleshoot both the code part of things and the diabetes part of things.

It is hard. And it is a lot of work.

What you don’t see when someone says they’ve (DIY) closed the loop:

For every “I had such a great night” picture someone posts, that probably represents at least (10?+) hours of working on building or troubleshooting their system. Scott and I have each spent hundreds of hours working with my system, from trouble shooting, to building in new features, to reaffirming that things are all working as planned, etc. That figure should be a bit lower for new people as a result of our efforts, but it will never be as easy as just plugging something in, giving it your weight, and letting it take over. The system only does what you program it to do.

I often say this is “not a set-and-forget” system. And this is also true in the wearability of it. Right now, I use a Raspberry Pi and Carelink USB stick to communicate with my pump. They’re great, but the separate power source I also have to keep charged, plus keeping the USB in range of my pump, plus making sure it’s all working, can be a headache sometimes. (Which is why I’m so glad we made an offline mode, to reduce one of the biggest headaches of using the system.) When I’m on the go during the day, sometimes I don’t take it with me, or I choose to stop and un-power it and resume it when I get home. At this point, I wouldn’t be surprised if most people use it for nighttime use only (at least for the most part). But even with nighttime use only, there’s still constant changing of the code (in some cases daily), tweaking, altering, fixing, breaking, and un-breaking various parts.

Did I mention it was a lot of work?

And does a closed loop prevent all lows and highs? No.

It’s important to realize this is not a cure. I work really hard to do eating soon mode before meals to prevent spikes from the amount of carbs I choose to eat. I still have to test my blood sugar and calibrate my CGMs multiple times a day. I still have to change out my pump site every 2-3 days, and deal with the normal hassles of wonky pump sites, etc. I still have some highs – although the loop helps me handle them and I spend less time above range. And I still have some lows – although usually they’re from human error related to bolusing, the loop helps prevent them from always being a true low and/or blunting the drop so I don’t require as much correction. But diabetes is still a good amount of work, even with a closed loop.

Is it worth it to self-build an artificial pancreas?

This is a personal question. It’s a lot of work, with risk involved.

For me, I have decided and continue to decide that it’s worth it.

But only you can decide if the work and the risk are worth the potential rewards for you.

Does the FDA care more about safety than people with diabetes do?

Today my inbox was suddenly flooded with links to a video with some commentary about artificial pancreas technology at a conference by a representative of the U.S. FDA. The implication many people are getting after watching the video clip is that this FDA representative is implying that people are being unsafe by building their own artificial pancreas. He mentions it is consumer prerogative to build an artificial pancreas – which is correct. The implication of his analogy is that changing your car and killing yourself is similar to a DIY artificial pancreas effort.

The scary takeaway from the video, in my opinion, as well as other public comments in the past, is the implication that the FDA cares more about the potential harms of taking action than the almost certain harms of inaction. And it’s increasingly frustrating that the FDA appears to imply publicly that those of us in the #wearenotwaiting community are doing things unsafely as a result of taking action.

Safety is what drives the #wearenotwaiting movement. In my case, I refuse to sleep another night with the fear that I won’t wake up in the morning because there’s not an FDA-approved system on the market that will wake me up if my life is in danger, let alone a system that can take action and change the situation to be more safe. So I built my own (#DIYPS), because the current FDA-approved CGM devices were not (and still are not) loud enough to wake me up at night, putting me at risk of dying in my sleep. And yes, it ultimately turned into an artificial pancreas – with the same goal of ensuring I wake up every morning, safely (alive). That is my prerogative for sure.

But I fail to see why the FDA, which collectively has no particular knowledge of these systems (especially as they have no jurisdiction, acknowledged on all fronts, over what I do myself – it’s my prerogative), is making public statements implying that these types of systems are categorically unsafe.

As a matter of fact, every DIY system I’ve seen is safer than the FDA-approved standard of care available for people with diabetes. The thousands of people using Nightscout, which is currently a DIY remote view-only monitoring system? Provides more safety and security for people with diabetes, not to mention it is helping achieve better outcomes for people with diabetes than they were able to achieve before with the standard of diabetes care as it exists today. (This was originally for the most part because of restricted access to data, although while that has improved there’s still interoperability issues getting access to real-time data in the same place from the 3+ average devices a person with diabetes uses…unless they have Nightscout or another DIY tool running.) The dozens of people working on their DIY version of an artificial pancreas system (many of whom are collaborating and sharing data in the #OpenAPS community)? These systems are safer than the standard of care, which is to let an insulin pump continue to overdose you if you are dangerously low while you sleep.

(You can see some of my personal data from #DIYPS, before we closed the loop, here and more about outcomes after we closed the loop and had #OpenAPS here. My closed loop artificial pancreas system continues to work excellently nine plus months in, and you can continue to watch my outcomes as I post them to Twitter regularly using the #DIYPS and #OpenAPS hashtags. I’ve also shared the other powerful lessons that DIY tech has helped me learn about diabetes care that helps all people with diabetes, regardless of technology.)

Are there risks to DIY efforts? Yes. But there’s risks to living with diabetes regardless. And as a person with diabetes, I am well aware of the risks that I choose to take. Diabetes is a disease in which you carry around large amounts of a lethal drug in your pocket that you are supposed to inject daily in order to save your life. As a person with diabetes, we are nothing but aware of the multitude of risks of living with this chronic disease 24/7/365.

In fact, even without a DIY artificial pancreas system, I am at risk every day simply from using my FDA-approved insulin pump that does not accurately track how much insulin I am given. (Read more here about how most insulin pumps on the market calculate IOB only from boluses, and often do not provide a record let alone incorporate any temporary adjustments to your basal rates and do not in any case track the impact of suspending your pump completely.)

And as someone who has founded the #OpenAPS movement, with the goal of an open and transparent effort to make safe and effective basic Artificial Pancreas System (APS) technology widely available to more quickly improve and save as many lives as possible and reduce the burden of type 1 diabetes…..we approach it with safety first in mind, and is a big part of why the DIY part is critical and is a part of our number one priority of safety.

Not everyone will choose to go the DIY route. In fact, most people do not and I am told all the time “Oh, I would never do that.” And that’s fine! Everyone can choose what they want for themselves.

But technology has made it increasingly feasible for those of us who want to improve our own safety to do so, because the industry and the FDA are not moving quickly enough to meet our needs.

That, indeed, is our prerogative – to increase our own safety.

Context – give me my data (on my device)

Today I saw that Medtronic announced a partnership with IBM. You can read about it on Twitter, where I first saw it, or elsewhere online. There’s lots of news articles and PR about it, too, which I haven’t read yet in great detail.

My initial reaction:

Pointing out that I can't get temp basal histories on my insulin pump

Additional context:

When I reduce my insulin (either by “suspending” the pump’s activity altogether, or by reducing my basal rate with a “temp” or temporary basal rate), there’s no record of it visible on my insulin pump.

None, at all.

Suspended for 15 minutes while I’m in the shower? No record of it if I accidentally resume insulin activity before checking to see when I suspended it.

Same for if I go running and activate a reduce basal rate (again, a “temp”) of 0.3u/hour instead of my usual 1.3/hour. That’s 1u less of insulin than I normally get. If I cancel it, or if that hour ends without me noticing it?

No record at all.

Which means if my blood glucose skyrockets an hour later, it will take me much longer to catch up with insulin if I don’t realize that I’m -1u (negative one unit) below what my body is used to.

Suspending your pump for 3 hours to go swimming? Same deal. Your body has less insulin than it’s used to, but you have to manually and mentally keep track of it.

The reverse is true as well – if you are sick and your body is more resistant to insulin than usual, and you use a higher basal rate than your usual as a way to additionally correct for a high BG?

No record of the additional insulin you’re putting into your body above your baseline basal profile.

THIS IS DANGEROUS.

And yet this is the FDA approved medical device that everyone is happy that I’m using? Even with critical flaws that endanger my life every day?

And the world has a problem with patients “hacking” or otherwise finding ways to access this critical data since we can’t get it from our approved devices?

This is backwards.

Medtronic and other pump brands track how much “insulin on board” (aka IOB) you have…but this number is wrong, because it doesn’t calculate the lack of insulin if you adjust your basal rates (examples above).

This is something I’ve been doing with #DIYPS to compensate for the inaccessibility of data from my FDA-approved medical device. Instead, I have to calculate for myself the “net” IOB number that takes into account any ‘negative’ corrections from suspending or negative or positive temp basal rates. These make a huge difference in my diabetes care.

We’ve learned from talking to people about #DIYPS for a year and a half that many people don’t use temporary basal rates, even though they’re very effective to ward off future lows and highs.

Why?

For one thing, it’s because there’s no record in their pumps. It’s too hard, and too much guesswork when there’s no record.

I don’t understand why the pump companies seem to ignore this. (If someone has a pump that tracks net IOB and/or shows a history of temporary basal rates and suspension, let me know. I’m familiar mainly with Medtronic’s pumps.)

This is not ok.

So while I think there’s a lot of potential for Medtronic to do more things with diabetes data (like this or this) through this partnership with IBM’s Watson? In the meantime, I’d like them to start with something much more simple – and with guaranteed impact.

Give me, the patient, my data that I need – directly on my medical device – so I can safely take care of myself and better manage my diabetes.

(Note – I realize FDA approval cycles on pumps take a long time, and this is unlikely to get fixed in current pumps. But future pumps? This should be fixed across the industry. And in the meantime? Companies can and should make it much easier to access data from the pumps via their approved uploader methods and make it easier to read the data. Right now, it’s not even easy to see the data off your pump. Let’s change this.)

Why the DIY part of OpenAPS is important

I had the chance to talk about DIYPS and OpenAPS during a demo session in DC last week. (Thank you to Gary from Quantified Self and Marty from the National Academy of Sciences for making this possible!)

I walked away with several insights:

  1. Many people don’t know about diabetes; fewer have a realization of current diabetes tech. In several cases as I was describing the closed loop artificial pancreas, people stopped me and were wowed – but not by the closed loop. They were impressed by the CGM.
  2. Others think that this type of technology is already out on the market.

So, I believe we have a long way to go in communicating and advocating for this type of technology. We know it’s behind where it should be – and we want it to catch up. That’s a big part of the OpenAPS goals to help the FDA, device companies, and everyone involved move a little faster than they might otherwise, because #WeAreNotWaiting.

But here’s the other question I was often asked: “How many people have you given this to?”

I frequently embarked on an explanation of how we can’t “give” away #DIYPS or the OpenAPS implementation – in fact, we can’t and won’t give away the code, either. Some of that is because the FDA says no – and some of it is common sense and principles that both Scott and I hold.

Here’s why I think it is so important to keep the DIY in DIYPS and each OpenAPS implementation that is in progress:

  • You need to have a deep understanding of the system before even considering using it on yourself. You need to know what it’s trying to do in all situations, including the fringe cases (the “this is unlikely to happen but if it does…”), so that you know when it’s working – and when it’s not – whether it’s 3pm in the afternoon at work, or 3am and you wake up and find something is not right and the system is not working.
  • You need to go step by step and test and ensure at each stage that it is working as expected – both in a “this is what it should be doing” and “it is giving out the correct amount of insulin”. Remember, insulin is a lethal drug. It’s also a lifesaving drug. It’s important to remember both of these things and balance the risks accordingly.

From the conversations I’ve had with people interested in learning more or getting a DIYPS-type system for themselves, they fall into two categories:

  1. “How can I buy it from you?”
  2. “What do I need to do to make one?”

Given my above reasoning, the second question is my favorite. The first one scares me, if someone does not then switch to the #2 question. Many people do go from #1 to #2, which is great.

DIYPS, for me, and OpenAPS implementations, for others, are works in progress. They’re not perfect. They’re better than what’s out there (like sleeping through alarms when you’re low at night), but they also have big risks. And it’s important to know, and respect these risks, and understand the limitations of the system, before being able to take advantage of this type of system – and to build the system with appropriate safeguards. (This is one of the reason we have OpenAPS, for example, designed to accept multiple failure points – like walking out of range, loss of connectivity, etc.)

The ability to buy a “black box” type system where you don’t know exactly how it works, but you trust that it works? That will be coming from the major device manufacturers in several years – hopefully sooner rather than later, and that’s something that OpenAPS will hopefully help make happen more quickly.

So to answer the #2 question, what do you need to make a DIYPS or OpenAPS of your own?

I’ll answer the technical aspects of this question in another post, but the first thing I always say is: “The willingness to build and test and test and test some more before ever considering using it on yourself.”

#DIYPS & #OpenAPS

Since I‘ve been using #DIYPS for over a year and also had the closed loop version running for more than two months with excellent results, I get several questions every week about how/when we’re going to make it available to other people. #DIYPS is an individual implementation that we built, and because of FDA regulations it’s not something we can give to another person to use. (Not to mention it’s not been tested for more than n=1, etc.) But, both Scott and I are passionate about moving diabetes technology forward for all, and so this week we kicked off the OpenAPS project.

#OpenAPS is our initiative to build on the #DIYPS closed loop work and eventually make this type of technology available (and faster than the market and traditional research is otherwise moving) for more people with diabetes. We aim to encourage other independent researchers to build their own closed loop implementations based on the OpenAPS reference design, and share their results and help us improve the design further. We are also working toward clinical trials that will enable more people to test and use the system during the research phase, but without having to code and build their own implementation of a closed loop artificial pancreas system. And all of this will be done in an open, transparent way so people can ask questions, monitor progress, and get involved at various stages.

The Open Artificial Pancreas System (#OpenAPS) is an open and transparent effort to make safe and effective basic Artificial Pancreas System (APS) technology widely available to more quickly improve and save as many lives as possible and reduce the burden of Type 1 diabetes.

We believe that we can make safe and effective APS technology available more quickly, to more people, rather than just waiting for current APS efforts to complete clinical trials and be FDA-approved and commercialized through traditional processes. And in the process, we believe we can engage the untapped potential of dozens or possibly hundreds of patient innovators and independent researchers and also make APS technology available to hundreds or thousands of people willing to participate as subjects in clinical trials.

At the end of the process, we hope to have produced an FDA-approved #OpenAPS reference design and reference implementation that can be used by any medical device manufacturer with minimal regulatory burden. We believe this will in turn allow manufacturers (and the academic research teams they work with) to turn more of their attention to designing and testing more advanced APS systems, and thereby accelerate the pace of innovation toward new and improved Type 1 diabetes treatments, and eventually a cure.

In the mean time, it will make basic overnight closed loop APS technology widely available to anyone with compatible medical devices, thereby reducing the burden of Type 1 diabetes on everyone who lives with the disease.

I’ll continue to post here often with data and updates from my experience & work with #DIYPS, which I’m continuing to use. But I also encourage you to bookmark OpenAPS.org if you’re interested in watching that work move forward, too – and as always, we’ll be on Twitter with #DIYPS and #OpenAPS as @DanaMLewis and @ScottLeibrand (and you can email us for #DIYPS or #OpenAPS info at Dana@OpenAPS.org and Scott@OpenAPS.org).

#DIYPS Closed Loop – One month of data & it still works great

My name is Dana Lewis and I have a closed loop artificial pancreas (that I built) that I use every night. Also see: woot!

Tweet that says "I love you #DIYPS closed loop"

We closed the loop in December (click here for more details about the first week of data & basics on how the closed loop works; or here to learn more about the basic non-closed loop #DIYPS and how far we’ve come in a single year), and I’ve been using it almost nonstop since.

When to loop – or not

I’ve only been limited in using the closed loop for overnight when I inadvertently fried the SD card in the Raspberry Pi (a known issue that’s related to the number of times you plug/unplug it from power source). We promptly ordered a second Pi as a backup, and by the time it arrived, Scott managed to revive the first one, so I now have two ready to run at any time. (Because of course you need emergency backups of your essential organs!)

When I first started looping in December, I originally intended to only use it at night, but it was hard to not loop during the day, too. The idea that I could sit at my desk and work for 3-4 hours straight, and not worry about my BGs, is so appealing!

However, it’s not really practical for me to want to use 24/7 every day…yet. This is where the versions of APS that will come to market in 3+ years will be great, because it will be all-in-one (or at least limited in excess pieces you have to carry). To wear it 24/7, I have to have enough batteries to power the raspberry pi and keep it in range, which means constantly picking it up and moving it around, carrying it in my bag from meeting to meeting, etc. I’ve decided it’s not worth it for every day, but it is awesome to have the choice when sitting through an important interview to have it running and have more security and peace of mind.

Back to using the closed loop for overnights

When we first showed our closed loop efforts off, we had about a week’s worth of data that already showed improved overnight blood glucose (eAG) and time in range, plus reduced number of #DIYPS alarms.

After a month, the results of using a DIY closed loop artificial pancreas system overnight continue to look promising:


We also recently added another screen to #DIYPS so I could access and review “what happened last night”, or what was the output of the closed loop. I usually look at the net impact per hour (how much above or below my normal basal rates I ended up getting), but also at the individual numbers of how much above and how much below I ended up getting every hour. Here’s a visualization:

Tweet illustrating how DIYPS closed loop works overnight with micro corrections to keep blood glucose in range

Using closed loop activity to spot trends and change basal rates

We also built a 7 day and 30 day view of this closed loop activity history so I can look at trends by hour overnight (versus manually compiling and visualizing them, like I did in our first closed loop data post here).

When we first looked at the data for overnight closed loop net insulin activity, I could spot a trend easily – the loop temped low from midnight to 2am, leveled out, then increased with higher temps after 5am. I can easily see why it often ends up temping low after I go to sleep, because I often do a half unit or so if I’m riding “high” (130 – ha!), and feel safe doing so with the loop to catch any more drop than I desire. (This pattern was consistent at 7, 14, and 30 days, although the average net insulin amount varied slightly.)

However, when I first started looping overnight in December, I had rises around 2am that the loop had to handle by providing higher temporary basal rates than my scheduled basals. I upped my midnight basal rate as a result, but it looks like I upped it too far since the closed loop often temps low now during that time frame. My next step is to probably change my midnight basal to be lower by 0.1u, and see if that reduces the amount of low temps needed from 12-2am, without causing spikes. My theory is that this alone may also reduce the number of higher temps from 2-4am, because those may be a result of the lower temps earlier on. Thus, I am starting overnight basal tweaking with this one change and seeing how much of a ripple effect it has for the rest of the night as well.

In pursuit of…what? Or: what are we optimizing for?

My BG averages overnight (and during the day) are excellent (well within the “normal” range <120) and time in range is continuing to grow (85% & counting) with using the closed loop #DIYPS. So, beyond minute basal tweaking, what’s next?

At this point, I think the next goal is encouraging other independent researchers to get up and running on their own closed loop overnight APS.  Do we really need to wait another 3+ years for APS technology to come to market?  What exactly would #WeAreNotWaiting look like if we applied it to closed loop Artificial Pancreas technology research? What do you think?

How does a closed loop artificial pancreas work when you DIY? Or: #DIYPS closed loop is working!

We closed the loop with #DIYPS and now have a DIY closed loop artificial pancreas running right now (for me, aka n=1.)

Here’s what a closed loop #DIYPS artificial pancreas looks like:


(A raspberry pi powered with a battery (shown) or via an outlet; a Carelink USB plugged into the Pi and in close proximity to the pump; a Medtronic insulin pump (an older version, thanks to a family from CGM in the Cloud for sharing it!); and of course my CGM and Android uploader phone that’s sending my data into the cloud/#DIYPS)

Here’s how a closed loop artificial pancreas or “#DIYPS closed loop” works:

Over the past year, we’ve been using #DIYPS to process BG, insulin on board and carbohydrate decay in real time. This yields real-time predictive alerts of three kinds: more insulin needed (X.X units of bolus insulin); less insulin needed (temp basal to zero insulin for X minutes); or carbs needed. Using this algorithm and my data entered (insulin taken or reduced; carbs ingested); we’ve seen significant results not only for the first 100 days, but also sustained over an entire year for improved average glucose, improved a1c, and improved time in range.

Closing the loop with #DIYPS

Three weeks ago, we mentioned at D-Data Exchange 2014 that we were planning to close the loop with #DIYPS…by August 1 (our wedding date :)).

The FDA was even in the room.

Two weeks later…we closed the loop.

It was this simple:

  • Thanks to Ben West’s awesome work, we plugged the Carelink USB into the Raspberry Pi. Thanks to a generous family from the CGM in the Cloud Facebook group, we acquired an old 522 insulin pump that could talk to the Carelink USB. (My current pump is too modern to work with this setup.)
  • Once we established that the Pi/USB setup could read from the pump, we started connecting #DIYPS to the system to close the loop.
  • Normally, #DIYPS provides 3 types of recommendations (see above). We reconfigured it so that while “looping”, it only enables the pump to do temporary basal rates instead of boluses. If #DIYPS says I need more insulin, it tells the pump to begin a temporary basal rate for 30 minutes above my normal basal rate. If #DIYPS says I need less insulin, it tells the pump to begin a temporary basal rate lower than my normal basal rate for 30 minutes, effectively reducing my net insulin.
  • When something changes and I need to do more or less insulin, #DIYPS tells the pump to increase or decrease the temporary basal rate, or resume my normal basal rate.
  • Note: there is a maximum basal rate that the pump can provide. This is a safety check so that #DIYPS cannot recommend a seriously dangerous basal rate. In fact, if I need more insulin than #DIYPS closed loop can safely provide using a 30 minute temp basal, the system will alarm and alert me to that state (although I usually already know about it). Same for if I was dropping fast and needed carbs in addition to reducing insulin; it would alarm and recommend carbs above and beyond reducing insulin.

I’ve been ‘looping’ (using #DIYPS closed loop) for a little over a week. Here are some of my overnight results:

As you can see, the outcomes are awesome. In fact, they are better than I expected!

#DIYPS closed loop results are significant

Here’s a break down that shows on an example night (Sunday night, 12/14 through Monday morning, 12/15) of how #DIYPS performed:

You can see that around 10:30 (not pictured, but in the graph), I was running low and needed some temp basals to zero, then later some higher temp basals to accommodate the resulting rise in BG. Later, my normal basal rates sufficed until another point overnight when I needed less insulin to prevent a low.

While this is 1/9 or so example nights, this is pretty much how it works every night. BGs drift up? Temp basal higher (usually 1.6 or 1.8, which is <=.5u above my normal). BGs drifting low? Temp basal lower or in extreme cases to zero to prevent a low.

What happens if the closed loop artificial pancreas fails/stops working?

If the loop stops working*, #DIYPS continues to work normally (processing all data and pushing recommendations), and my pump goes back to my normal basal profiles after any existing temp basal rates expire (which would be a max of 30 minutes). No big deal and no more dangerous than I would be walking around with my pump acting normally.

*I’ve found numerous ways to make the system stop working: no battery power; being too far away from the USB stick so the pump can’t communicate; no cell signal to provide wifi as a hotspot to the Raspberry Pi; if the pump battery goes low, RF gets turned off and the USB can’t talk to the pump; if there’s no cell signal or wifi at all, I can’t upload CGM data to #DIYPS anyway; if the SD card gets corrupted inside the Raspberry Pi; etc.

So, there’s many points of failure. But it doesn’t matter. #DIYPS closed loop is safer for me (disclaimer: just me! I’m the only one doing this as a personal experiment to my own body) than if I just had a pump and a CGM, because it can reduce insulin and prevent lows. And it can increase insulin slightly and prevent rebounds.

After about a week’s worth of data, here’s the results of #DIYPS (what I’ve been using for the past year) versus the week of closed loop #DIYPS:


The target BG is especially awesome, because we have the closed loop targeting a BG of 115!

It’s also worth noting the reduction in alarms. Remember, I sleep through CGM alarms, so we built #DIYPS. #DIYPS makes a lot of alarms – sometimes upwards of 40 a night (those are really bad nights!). With the closed loop nights, there are very few alarms..and they’re usually alerts about things #DIYPS closed loop is taking care of on it’s own (see all of those no-hitters above!).


What’s next with #DIYPS closed loop

We’re going to continue and iterate on the closed loop and keep making it better. I’m definitely going to keep using it overnight – it’s like having a working pancreas, the kind where you can go to sleep without fear.

We’re also adding this to the ‘things we’ve learned while working on #DIYPS’ list:

  • Calculating the carbohydrate absorption rate for an individual – how many carbohydrates your body absorbs in an hour
  • Tracking “carbs on board” or “carb decay” – how many carbohydrates are still being digested in your body and impact BG levels
  • “Net” IOB – tracking net IOB by incorporating “negative” boluses from temporary basal rates to zero
  • Preventing post-meal BG spikes/drops with early meal boluses and better understanding of insulin activity
  • and you can control overnight BGs solely using simple adjustments of insulin rates.

Thanks to everyone who made it through a really long post, and for the MANY people who have contributed in various ways to helping us close the loop with #DIYPS! Also, let us know what questions come to mind that we haven’t managed to answer above about how the system works, results, etc.

Why #DIYPS N=1 data is significant (and #DIYPS is a year old!)

As I’ve said many times, last year we set out to create a louder CGM alarm system. By adding “snoozes” so I didn’t drive my co-investigator crazy, we realized I might as well enter what I was doing, and be precise about it (aided by some quick bolus and quick carb buttons that made data-entry not the chore that it sounds). Thus, we had the data and the brains to realize that this made for some great predictions; much better than what you usually see in diabetes tools because they rely only on your insulin sensitivity factor (ISF) and correction rate, but don’t take into account carbs on board and their impact over time, etc.

(If you’re new to #DIYPS, read about the beginnings of it here. For more on this idea of carbs on board and the carbohydrate absorption rate and how significant it is for people with diabetes, read about that here.)

After I had spent 100 days using #DIYPS, Scott and I stopped to look and see what the impact was. For the long version, read this post about the results and the direct comparison to the bionic pancreas trial data that was available then. The short version: #DIYPS reduced my eAG and a1c significantly, reduced lows, reduced highs – aka my time in range was improved from 50% to regularly 80+%.

I have asked myself (and others have asked), are these results sustainable? Are these improved outcomes truly because of #DIYPS? It’s definitely worth noting I never changed what or how I ate. (I ate 120 grams of pizza (for science! ;)) several times to test the system, but I didn’t eat less or any healthier or otherwise change my diet.)
I can’t attribute these outcomes directly to #DIYPS alone, but I do believe they’re highly correlated. It’s hard to separate other contributing factors like the fact that I have more boluses per day using #DIYPS (which other studies have shown decreases a1c); or the fact that I spend less time high/low because with #DIYPS I actually can wake up at night and take action before I’m high or low.
So, it’d be hard to study specific factors and say “it’s all #DIYPS”. But, I’m pretty sure it’s mostly #DIYPS. Regardless, here’s the updated data about the sustainability of the results I’ve seen with #DIYPS over the past year:
Why this is significant
#DIYPS is currently n=1 (meaning one person is the study’s subject). But what is significant is that I have year’s worth of data and actual lab-tested a1cs that shows the outcome of this type of artificial pancreas work. And it (to date, but coming soon  / OMG this week!) hasn’t even been closed loop – I’m still the “human in the loop” making decisions and pushing buttons on my pump.Compared to the bionic pancreas and other artificial pancreas study trials where they have a few days and a few more (usually n=20 or so) subjects; they can look at the decrease in lows and highs and improved eAG…but they can only project what the a1c improvement is going to be.We’ve shown the improvements in lab-tested a1cs – see my graph above?

It all adds up
Scott and I are not the only ones working on a closed loop. The community of developers connected to the Nightscout community has nearly two hands full of people who are working independently on device interoperability to close the loop by freeing our data from devices and enabling us to work with our own algorithms regardless of which hardware device we use to support our diabetes management.When all of these n=1 studies add up, it matters. At some point in the near future, after we’ve closed the loop with #DIYPS (ah! this week! :)) and others have as well, we may have more n=1 hours on closed loop artificial pancreas systems than the (traditional) “researchers”. Scott and I are hoping that we can not only show the world how open source innovation and new regulatory paradigms can deliver safe and effective results for people living with T1D faster than traditional medical device development and traditional regulation; but that we can also change how all successful medical device companies approach interoperability, and how traditional medical researchers do research – possibly in partnership with patient researchers like us.

What we’ve been up to lately – closing the loop with #DIYPS and open process work

We’ve been quiet on the blogging front (yes, I admit, I blogged!) because we’ve been busy closing the loop. (We’re always active on Twitter, though – make sure you watch #DIYPS on Twitter for more real-time updates in between blog posts, and you can follow @ScottLeibrand and @DanaMLewis.)

That’s right.

Closing the loop.

It feels good to say that :).

We’re submitting a research proposal to Medtronic to get access to their research device that will enable us to send commands to my insulin pump. These commands will be generated from #DIYPS. Because that would remove the “human in the loop” component that’s a current part of #DIYPS (i.e.  me pushing the pump buttons), that would move #DIYPS from being not an artificial pancreas to a closed loop artificial pancreas system.

This is not what we imagined we would do when we set off nearly a year ago to do this work (make a louder CGM alarm system, enable remote monitoring, etc.), but this is awesome!

And, in the true #wearenotwaiting spirit, we’re not waiting for the research device to start this phase of our work. We got started with this phase of our research by getting a Raspberry Pi and hooking it up to the Carelink USB and sending commands to a test Medtronic pump.

(Note: this pump is not hooked up to my body! There is no insulin in it! We’re just testing to see how data can be read off the pump & fed into #DIYPS. There will be many tests with a pump not connected to my body and many safety checks and stages before we would get anywhere near to allowing this to run under waking, close observation let alone under observed sleeping conditions. Stay tuned for more on this later.)

Where we are with #DIYPS and Nightscout

We’ve been having many discussions with the other developers of Nightscout, and end users in the CGM in the Cloud Facebook group around this topic. Scott and I are both passionate about the open source part of our project and being open and transparent every step of the way. We’ve been learning a lot from #DIYPS and have some key features that we’re putting back into the overall Nightscout platform as a result. We’re calling this “#DIYPS-Lite”, or the “wip/iob-cob” branch of Nightscout. (This is not what the main community is using, it’s still an advanced test branch, but enables more advanced users to implement and take advantage of some of these features, like net IOB and COB.) We’ve also been contributing to the roadmap of Nightscout; as of this past weekend, we helped map out the priority list to show what are priorities of some of the core developers (including Scott and I); what’s currently being worked on; and what’s on the ‘backlog’ as a project we’re all interested in and is important to the community, but no one’s had a chance to jump in and start it yet.

Back to the closed loop update

We won’t be releasing any closed-loop systems to the public any time soon, because that would mean distributing an untested medical device system that controls administration of a potentially lethal drug (insulin), which the FDA (and anyone in their right mind) would (rightly) frown on.

Instead, we want to open up our process of developing such systems, so that other researchers (including independent ones like us, and those inside traditional research labs and companies) have a roadmap to follow for how to safely put together and test an open-source artificial pancreas system.  The more people and companies we have developing such systems, sharing their results, and learning from each other’s work, the closer we’ll be to having a system that could indeed be proven safe and effective to the FDA’s satisfaction, and eventually released to the public.  In the end, we suspect the companies and research labs developing APS systems will be the ones to commercialize them, but we are confident that our efforts will accelerate those timelines and result in a more dynamic, innovative T1D medical device ecosystem that will provide a bridge to a true cure.

We are hoping that we can show the world how open source innovation and new regulatory paradigms can deliver safe and effective results for people living with T1D faster than traditional medical device development and traditional regulation.  By doing so, we can change how all successful medical device companies approach interoperability, and get to a world where the latest ideas, algorithms, and software can be made available to everyone with T1D, regardless of what hardware they’re using.


(More to come next week as we mark 1 full year of #DIYPS in action (!) and we have some new data to share!)