Home-made wireless autonomous insulin pump control

“I'm a cyborg now!” Proudly states Australian Liam Zibidi, a young programmer, blockchain / Fullstack engineer and writer, as he presents himself on the pages of his blog . In early August, he completed his DIY project to create a wearable device, which he dubbed “artificial pancreas” without false modesty. It is more about a self-regulating insulin pump, and our cyborg in some aspects of its creation did not look for easy ways. Read more about the device’s concept and open source technologies on which it relied - later in the article.



image illustrations except for device diagram taken from Liam's blog



Diabetes for dummies



Liam has type 1 diabetes.

If correct, then the word "diabetes" means a group of diseases with increased diuresis - urine output, but the proportion of patients with diabetes mellitus (DM) is greater, and the short name has taken root behind the scenes. Back in the Middle Ages, the majority of patients with diabetes noted the presence of sugar in their urine. It took quite a while before the discovery of the hormone insulin (which was also to become the first completely sequenced protein in history) and its role in the pathogenesis of diabetes.

Insulin is the most important hormone that regulates the metabolism of many substances, but it has the main effect on the metabolism of carbohydrates, including the “main” sugar - glucose. For glucose metabolism in cells, insulin is, roughly speaking, a signaling molecule. On the surface of the cells there are special insulin receptor molecules. "Sitting down" on them, insulin gives a signal to start a cascade of biochemical reactions: the cell begins to actively transport glucose inward through its membrane and process it inside.

The process of insulin production can be likened to the work of volunteer people who came to deal with the flood. The level of insulin depends on the amount of glucose: the more it is, the more the total level of insulin rises in response. I repeat: it is the level in the tissues that is important, and not the number of molecules that is directly proportional to glucose, because insulin itself does not bind to glucose and is not spent on its metabolism, just like volunteers do not drink arriving water, but build dams of a certain height. And it is necessary to maintain this specific level of insulin on the surface of the cells, as well as the height of the temporary dams in the flooded areas.

It is clear that if insulin begins to be missed, then glucose metabolism is disrupted, it does not pass into the cells, accumulating in biological fluids. This is the pathogenesis of diabetes. There used to be a confusing terminology “insulin-dependent / independent diabetes,” but it’s more correct to classify it as follows: type 1 diabetes is a physical lack of insulin (the reason for this is most often pancreatic cell death); Type 2 diabetes is a decrease in the body's response to the level of its own insulin (all causes are not fully understood and varied). 1st type - there were few volunteers and they did not have time to build dams; Type 2 - dams of normal height, but either full of holes, or built across.



The problem of manual adjustment



Both types, as it becomes clear, lead to an increased level of glucose outside the cells - in the blood, urine, which has a negative effect on the whole body. We have to live, counting international and bread units in a syringe and plate, respectively. But you can’t always manually adjust what the body did. A person must sleep, and in a dream, insulin levels continue to fall; a person may, due to domestic circumstances, not eat on time - and then sugar will drop already under the influence of artificially kept insulin levels. In fact, life is in the tunnel of glucose limits, above and below which is a coma.

Part of the solution to this problem was modern devices that replaced syringes - insulin pumps. This is a device that uses a continuously inserted hypodermic needle to automatically dispense insulin. But the convenient serving alone does not guarantee the correct replacement of insulin therapy without data on the current glucose level. This is another headache for doctors and biotechnologists: rapid tests and the correct prediction of the dynamics of insulin and glucose levels. Technically, this has come to be implemented as continuous glucose monitoring - CGM systems. These are a variety of devices that continuously read data from a sensor constantly inserted under the skin. This method is less traumatic and more attractive to users than the classic fingerprick , but the latter is more accurate and is recommended for use if the sugar level still turned out to be “dropped” or somehow quickly changed over time.

The intermediate link in this system is the person - usually the patient himself. He adjusts insulin delivery depending on the readings of the glucometer and the expected trend - whether he has eaten sweets or is preparing to skip lunch. But after all, against the background of accurate electronics, a person becomes a weak link - what if during sleep he will tolerate severe hypoglycemia and lose consciousness? Or will he somehow behave inappropriately, forget / miss / incorrectly adjust the device, especially if he is still a child? In such cases, many people thought about creating systems with feedback - so that the insulin input device is oriented to the output from glucose sensors.



Feedback and open source



However, a problem immediately arises - there are a lot of pump and meter in the market. In addition, these are all executive devices, and they need a common processor and software that controls them.

Articles [ 1 , 2 ] on the topic of combining two devices into one system have already been published on Habré. In addition to adding a third case, I will talk a little about global projects that combine the efforts of enthusiasts who want to build such systems on their own.



The OpenAPS project (Open Artificial Pancreas System, a free artificial pancreas), founded by Dana Lewis from Seattle. At the end of 2014, she, also a type 1 diabetic, decided on a similar experiment. After trying and then describing her device in detail, she eventually opened the project website , which describes in detail how to combine her CGM meter and pump, in various variations from different manufacturers, with the necessary intermediate devices, software options on Github, with great the amount of documentation from a growing user community. The most important aspect that OpenAPS focuses on is "we will help you with detailed instructions, but you must do everything yourself." The fact is that such activity is a step away from serious sanctions from the FDA (American Food and Drug Administration, whose jurisdiction includes all medicines and medical devices). And if she cannot forbid you to break certified devices and integrate them into home-made systems to apply them on yourself, then any attempt to help you make or sell it will be strictly punished. The second, but no less important idea of ​​OpenAPS is the security of a home-made system. Documentation in the form of a couple of hundred articles and clear, detailed algorithms are aimed specifically at helping the patient help rather than harm themselves.



image Nightscout account window

Another project, Nightscout , allows users to upload data from their CGM devices to cloud storage in real time via a smartphone, smart watch and other devices, as well as view and process the received data. The project is aimed at the most informative and convenient use of data, and also contains detailed guides, for example, ready-made configurations of glucometers with smartphones with a particular OS and the necessary software and intermediate transmitters.

Data visualization is important for determining daily glucose fluctuations in your lifestyle and possible correction of behavior and meals, for transmitting data in a convenient graphical form to a smartphone or smart watch, for predicting glucose trends in the near future, and in addition, these data can be read and processed by OpenAPS software. This is exactly what Liam uses in his project. On KDPV articles - his personal data from the cloud service, where the purple "plug" on the right - this is the predicted glucose levels predicted by OpenAPS.



Liam Project



You can read about the project in detail in the corresponding entry of his blog, I’ll just try to retell it more schematically and clearly.

Hard includes the following devices: Medtronic insulin pump, which Liam originally had; CGM (meter) FreeStyle Libre with NFC-sensor; to it - a MiaoMiao transmitter, transmitting data from a skin NFC-sensor to a smartphone via Bluetooth; Intel Edison microcomputer as a processor for controlling the entire system using Open APS; Explorer HAT - a radio transmitter for connecting the latter with a smartphone and with a pump.

The circle is closed.



image



The entire hardware part cost Liam 515 euros, with the exception of the pump that he had previously. He ordered all things on Amazon, including discontinued Edison. Also, subcutaneous sensors for CGM Libre are an expensive consumable - 70 euros apiece, which lasts for 14 days.



Software: firstly, the Linux distribution Jubilinux for Edison and then installing OpenAPS on it, with which the author of the device, he said, suffered. Next, configure the transfer of data from CGM to the smartphone and the cloud, for which he had to license the personal assembly of the xDrip application (150 euros) and configure Nightscout - he had to get married through OpenAPS through special plugins. There were also problems with the operation of the entire device, but the Nightscout community successfully helped Liam in finding bugs.



Of course, it may seem that the author has overdone the project. The long-discontinued Intel Edison was chosen by Liam as "more energy efficient than the Raspberry Pi." The Apple OS also added difficulties with a software license and costs comparable to an Android smartphone. However, his experience is useful and will go to the treasury of many similar projects of home-made devices, which are designed for relatively little money to significantly improve the quality of life of many people. People who are increasingly accustomed to rely on their strength and skills.

Liam argues that type 1 diabetes made him unfree, and the device he created was a way to regain the psychological comfort of controlling his own body. And in addition to returning to his normal lifestyle, the creation of a feedback system of an insulin pump became a powerful experience for him in self-expression. “It’s better to keep your metabolism under the control of the JS code than to go to the hospital,” he writes.



All Articles