Homemade wireless autonomous control of an insulin pump

"I'm a cyborg now!" β€” Australian Liam Zibidi, a young programmer, blockchain/Fullstack engineer and writer, proudly declares how 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. Rather, it is about a self-regulating insulin pump, and our cyborg in some aspects of his creation was not looking for easy ways. Read more about the concept of the device and the open source technologies it relied on later in the article.

Homemade wireless autonomous control of an insulin pumpillustrations with the exception of the device diagram are 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 tacitly taken root for DM. Back in the Middle Ages, the majority of patients with diabetes noted the presence of sugar in the urine. Quite a long time passed before the discovery of the hormone insulin (which was also to become the first fully sequenced protein in history) and its role in the pathogenesis of DM.
Insulin is the most important hormone that regulates the metabolism of many substances, but the main effect it has 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 cells there are special insulin receptor molecules. "Sit 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 producing insulin can be likened to the work of human volunteers who came to fight the flood. The level of insulin depends on the amount of glucose: the more it is, the more the total insulin level 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 the arriving water, but build dams of a certain height. And it is necessary to maintain this certain level of insulin on the surface of the cells, as well as the height of temporary dams in flooded areas.
It is clear that if insulin begins to be lacking, then glucose metabolism is disturbed, it does not pass into the cells, accumulating in biological fluids. This is the pathogenesis of SD. Previously, there was a confusing terminology "insulin-dependent / independent DM", but it is more correct to classify it as follows: type 1 DM is a physical lack of insulin (the reason for this is most often the death of pancreatic cells); 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 are few volunteers and they do not have time to build dams; 2nd type - dams of normal height, but either full of holes, or built across.

Manual adjustment problem

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 entire body. We have to live, counting international ΠΈ grain units in a syringe and a plate, respectively. But you can’t manually regulate all the time what the body itself did. A person needs to sleep, and during sleep, the level of insulin continues to fall; a person may, due to domestic circumstances, not eat on time - and then his sugar will fall under the influence of an artificially maintained level of insulin. In fact, life finds itself in a tunnel of glucose levels, 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 deliver insulin automatically. But a convenient supply alone does not guarantee correct insulin replacement therapy without data on the current glucose level. This is another headache for doctors and biotechnologists: rapid tests and correct prediction of the dynamics of insulin and glucose levels. Technically, this began to be implemented in the form of continuous glucose monitoring systems - CGM. These are various 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 one. fingerprick, but the latter is more accurate and recommended for use if the sugar level nevertheless turned out to be very β€œdropped” or somehow changes rapidly over time.
The intermediate link in this system is a person - usually the patient himself. It adjusts insulin supply depending on the glucometer readings and the expected trend - whether he ate sweets or is preparing to skip lunch. But after all, against the background of precise electronics, a person becomes a weak link - what if during sleep he allows severe hypoglycemia and loses consciousness? Or will he behave inappropriately in any other way, forget / skip / misconfigure the device, especially if he is still a child? For such cases, many people have thought about creating systems with feedback - so that the insulin input device is guided by the output from glucose sensors.

Feedback and open source

However, a problem immediately arises - there are a lot of both pumps and glucometers on the market. In addition, these are all executive devices, and they need a common processor and software that controls them.
Articles have already been published on HabrΓ© [1, 2] on the topic of combining two devices into one system. In addition to adding a third case, I will talk a little about global projects that bring together the efforts of enthusiasts who want to assemble such systems on their own.

The OpenAPS project (Open Artificial Pancreas System, 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 Website, which details how to combine your CGM meter and pump yourself, in various variations from different manufacturers, with the necessary intermediate devices, software options on Github, with a lot of documentation from a growing user community. The most important aspect that OpenAPS emphasizes is β€œwe will help you with detailed instructions, but you must do everything yourself.” The fact is that such activities are a step away from serious sanctions from the FDA (the American Food and Drug Administration, whose jurisdiction includes all medicines and medical products). And if she cannot forbid you to break certified devices and combine them into home-made systems to apply them to yourself, then any attempt to help you make or sell it will be severely punished. The second, but no less important idea of ​​OpenAPS is the security of a self-made system. Documentation in the formcouple hundred articles and clear, detailed algorithms are aimed precisely at ensuring that the patient helps, and does not harm himself.

Homemade wireless autonomous control of an insulin pump Nightscout account window
Another project night scout, allows users to upload data from their CGM devices to the cloud storage in real time through 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 glucometers with smartphones with a particular OS and the necessary software and intermediate transmitters.
Visualization of data is important for determining daily fluctuations in glucose 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 levels in the near future, and in addition, this data can be read and processed by OpenAPS software. This is exactly what Liam uses in his project. On the KDPV articles - his personal data from the cloud service, where the purple "fork" on the right is the predicted glucose levels predicted by OpenAPS.

Liam's project

You can read about the project in detail in the corresponding blog post, I will just try to retell it more schematically and visually.
Hard includes the following devices: the Medtronic insulin pump that Liam originally had; CGM (glucometer) FreeStyle Libre with NFC sensor; to it is the MiaoMiao transmitter, which transmits data from the NFC skin sensor to a smartphone via Bluetooth; microcomputer Intel Edison, as a processor to control the entire system using Open APS; Explorer HAT is a radio transmitter for connecting the latter with a smartphone and with a pump.
The circle is closed.

Homemade wireless autonomous control of an insulin pump

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

Software: firstly, the Jubilinux Linux distribution for Edison and then installing OpenAPS on it, with which the author of the device, according to him, suffered. Next - setting up data transfer from CGM to a smartphone and to the cloud, for which he had to license a personal assembly of the xDrip application (150 euros) and set up Nightscout - he had to be β€œmarried” with 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 overcomplicated the project. The long-discontinued Intel Edison was chosen by Liam as "more power efficient than the Raspberry Pi". Apple OS has also added the hassle of a software license and costs comparable to an Android smartphone. However, his experience is useful and will go into 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 strengths and skills.
Liam talks about how Type 1 SD made him captive, and the device he created is a way to regain the psychological comfort of controlling his own body. And in addition to returning to a normal lifestyle, creating a closed-loop insulin pump system was a powerful experience for him to express himself. β€œIt’s better to keep your metabolism under the control of JS code than to end up in a hospital,” he writes.

Source: habr.com

Add a comment