How a Group of Amateur Hackers Transformed Diabetes Care
It's always been a lot of work to manage my diabetes. Then I met some fellow patients who change my life.
I was 12 when my immune system suddenly wiped out the insulin-producing beta cells in my pancreas. The first symptoms arrived when I was in Paris, on a family vacation. I started urinating like crazy, drinking litres of water each day to compensate. My memory of the Champs Élysées is not the beauty of the architecture but the number of public bathrooms I had to duck into along the way.
It was 1986, a different era in diabetes care, and the doctors I eventually saw told me I could still eat whatever I wanted, so long as I injected enough insulin to compensate. I was told that diabetes is manageable, that you can live a good life with it—both mostly correct though not always straightforward. Yet my diagnosis still changed how I saw myself. I contained a flaw, my body now a series of problems that constantly had to be solved.
Diabetes is a tricky disease, both to live with and to understand. It all comes down to the pancreas: in normal circumstances, the organ produces insulin, a hormone that controls blood glucose. Diabetics either can’t produce enough insulin (which causes the more manageable Type 2 diabetes) or any at all (Type 1). Because of this, our bodies can’t handle the sugar we consume. When blood-glucose levels drop too low or surge too high, it can lead to serious health complications.
Thankfully, new medical and technological advancements have allowed Type 1 diabetics—myself included—the opportunity to live full, relatively normal lives. Insulin pumps let us forgo regular insulin injections: these small devices run a thin tube through a tiny hole in the abdomen to deliver a programmable stream of medication. Sensors, called continuous glucose monitors (CGMs), can be placed under a diabetic’s skin and will send updated blood-glucose levels to users’ smartphones every five minutes. Managing Type 1, however, is still a full-time job—one where, if you don’t do it just right, you’ll feel terrible. Or get sick. Or die.
The magic number for blood glucose is typically 5 millimoles per litre of blood, and consistently hitting it is a challenge, even with the most up-to-date tech. Diabetics still need to consider many factors to determine how much insulin they need to take: what they’ve eaten (and are going to eat), how much exercise they’ve done (and will do). Everything from stress to sex can affect blood sugar. The trick for managing it all is to think like a pancreas—a problem, since nobody really understands how a pancreas thinks.
But what if a computer could do all the hard work for you? Enter the artificial pancreas, the holy grail of diabetes management. Currently, a person might use both an insulin pump and a CGM to help manage their diabetes. Unfortunately, these pieces of tech don’t talk to each other. The person with diabetes is still the one who’s constantly making decisions, monitoring and taking everything into account. But an artificial pancreas, also known as “the closed loop,” uses a piece of code to connect them, mimicking a real pancreas. Once connected, the loop would work in the background like any other organ.
It sounds like the stuff of science fiction. Officially, it will be at least another few years before people with diabetes can obtain an artificial pancreas. But, unofficially, well, that’s a different story.
How to Hack a Pancreas
I first met Kate Farnsworth and Pina Barbieri in November 2017. The mothers are based in the Greater Toronto Area and both have teenage daughters—ages 13 and 15, respectively, at the time—with Type 1 diabetes. Farnsworth tells me about the fear she felt when her then eight-year-old daughter, Sydney, was diagnosed in 2012. She began looking everywhere for information—and hope.
In May 2014, she found a Facebook group called CGM in the Cloud, an international community of over 30,000 members with a do-it-yourself ethos. Through the group, Farnsworth followed instructions on how to adapt Sydney’s CGM. Suddenly, she was able to pair Sydney’s CGM with a regular smart watch, giving her the ability to check Sydney’s blood-glucose numbers wherever she was. She was even able to set up an alarm to warn her whenever Sydney’s levels were trending too low.
Two years later, she heard about a group of amateur coders from the U.S., most of them Type 1 themselves, who were fiddling around with insulin pumps and CGMs, looking for ways to improve the devices. The amateur coders pooled their discoveries and created an iPhone program called Loop (an Android version, called OpenAPS, was also created around the same time). Loop is not available in the App Store or through any official channels—no doctors will prescribe it. Users need to find the instructions online and build the Loop app themselves. This bit of free code, paired with a hacked-together insulin pump and CGM, is an artificial pancreas. Farnsworth knew that Sydney needed to have it.
I feel uneasy about entrusting my life to homemade software thrown together by some DIY hackers. The technology sounds revolutionary—if it actually works—but it also feels like giving up control. After living with diabetes for 33 years, I have trouble believing that a few lines of code can understand my body better than I can.
“When Sydney started on Loop, my entire role as a parent changed. It went from me micromanaging her diabetes to the system doing almost everything,” Farnsworth says. She no longer needed to wake up in the night worrying about Sydney going low; Loop took care of it. “Every night she goes to bed, I sleep through the night, and she wakes up usually at the same number,” she adds. “It’s amazing.”
“Yeah, she actually gets some sleep,” says Barbieri.
Suddenly, an alarm goes off. It’s Barbieri’s smart watch. Her daughter Laura’s blood sugar is 17.3, which is very high. Barbieri texts her: “You okay?”
Laura: “Yeah, taking more insulin.”
This exchange between mother and daughter floors me. I’ve always felt that there’s something intimate in a blood sugar level: shame if you’re too high, pride in perfect 5s or 6s, anxiety if you go too low. It’s like having a daily report card on how you’re living your life. Managing the disease was my responsibility, and I’d tell myself that I needed the privacy. I’ve never shared my numbers with anyone other than my doctor. As I listen to Farnsworth and Barbieri, I wonder if I’ve been thinking about diabetes all wrong.
My First Artificial Pancreas
I spend the next few months reading posts in the Looped Facebook group, which, at the time I joined in January 2018, had about 6,500 members worldwide. Approximately 1,000 of them are already “Looping.” Others, like me, are simply curious. Farnsworth explains that since Loop has given her and Sydney so much, she feels compelled to give back to the community: she’s the creator of the Looped Facebook group and is one of the two volunteers who run the page, spending hours each week answering questions and offering advice.
The more I learn about Loop, though, the more hesitant I feel. For one thing, Loop requires having an insulin pump that can be hacked and reprogrammed, and these are rare: when medical-device developer Medtronic realized there was a security flaw in its products, it changed its design. This change makes Looping with new pumps impossible, meaning would-be Loopers need to find old, out-of-warranty devices. They also need to order a RileyLink from the United States—a Bluetooth device that lets an iPhone communicate with a pump. After all of that, they need to build the Loop app themselves.
So I’m not quite sure what to say when Barbieri calls to tell me that she and Farnsworth would like to organize a Loop-building session with me and a few others. Barbieri has an old, Loop-able pump I’m free to use. I can have her daughter’s extra RileyLink so long as I replace it. The entire cost of this life-changing artificial pancreas? $250. Amazed by the generosity of a virtual stranger, I thank her. But when she asks me to commit to a date, I’m evasive.
Days pass, and the dream of the closed loop clings to my imagination. I contact Health Canada’s Graham Ladner, scientific evaluator of the Medical Devices Directorate, to ask about the elusive artificial pancreas and whether we’ll ever see an approved version on the market. Ladner explains an insulin pump is usually a class III medical device, but once you “close the loop” by having the pump automatically communicate with a CGM, it becomes class IV, meaning more restrictions and more difficulty getting approval. Just like humans, machines can make mistakes, too.
If I’ve closed the loop and am using an artificial pancreas, my CGM could, for example, erroneously say I have a blood glucose level of 16.5. In truth, I may actually be at 7, but in a closed-loop system, the pump will automatically give me too much insulin. I’ll end up with severe low blood sugar and could lose consciousness.
Even in normal use, insulin pumps can be dangerous. According to a November 2018 CBC investigation, more people have died because of insulin pumps than any other medical device on the market, with Health Canada concluding they may have been a factor in 103 deaths and over 1,900 injuries from 2008 to 2018. Such potential risk only becomes magnified when you leave things to a computer algorithm. “The closing of the loop introduces new patient hazards,” Ladner adds, “and we need to be convinced that it’s safe.”
After I hang up the phone, I head back to the Looped Facebook group. I’m not sure what I’m looking for. Confirmation? A perfect solution? I read a mother’s comment about frustrations managing her child’s diabetes. Fellow Loopers offer a chorus of support and advice. I choke up, break down and cry. Maybe it’s the exhaustion of living with diabetes for three decades. But as I read the various Facebook comments, I’m amazed by the care people take in volunteering their time, feedback and insights. Which is why I decide to do it. Will the Loop be better than what I have? I don’t know. But, for the first time, I won’t have to do it alone.
The Perfect 5.0
It’s a Saturday morning when we all meet to build me my very own Loop. Farnsworth hands me an old purple Medtronic 554 pump. Barbieri passes me a lighter-sized box: the RileyLink. Once connected, these two devices will work alongside my CGM and the Loop code to create my artificial pancreas. We gather at a table. Farnsworth leads us through all the coding steps. A message appears on my laptop screen: “Please understand this project is highly experimental and not approved for therapy.”
By the end of the afternoon, I’ve built my first app and transferred it onto my phone. We connect finicky wiring to tiny battery packs and flick on our RileyLink switches. When I tap the Loop icon, I see graphs highlighting my glucose trends, active insulin, insulin delivery time and carbohydrate intake. My CGM numbers appear on the top row. To the right, it shows how much insulin the algorithm is adjusting. To the left, a small circle glows green. It means I’m Looping. My artificial pancreas is alive.
In the days that follow, Barbieri and Farnsworth continue to guide our group. At first, I feel overwhelmed and am constantly worried I’m going to forget something. Sometimes the RileyLink craps out and the Bluetooth goes down, and I feel panic in the moments before it reconnects. There’s no question that the system isn’t perfect. But after my first night’s sleep, I wake up to a perfect blood glucose of 5.0. And then it happens the next morning. And the next.
I’ve now been on Loop for over two years. I wake every morning to near-perfect blood sugars. The Looped Facebook group has grown exponentially since then, surpassing 23,000 members. In April 2019, the Omnipod, another commercial pump, became Loop compatible. And, in a gesture that shocked many, Medtronic recently announced that it will work with the FDA and competitor Dexcom to let their insulin pumps and CGMs speak to one another via Bluetooth and an app called Tidepool—essentially Loop gone legit.
With so much potential change on the way, I ask Farnsworth what’s going to happen when a government-approved artificial pancreas as good as Loop—or better—is finally available. I ask if it will bother her to lose this close community she’s helped create. “Honestly,” she says, “I would love to be put out of my volunteer job.”
I’m not sure how I will feel when that day comes. After all, Loop has changed my relationship with my health and with myself—life is more than just a report card, diabetes more than a mere flaw.
© 2020, Jonathan Garfinkel. From ‘‘Hacking Diabetes,’’ The Walrus (January 7, 2020), thewalrus.ca.