"I am now a cyborg!" proudly declares Australian Liam Zabidi, a young programmer, blockchain/Fullstack engineer, and writer, as he presents himself on the pages of his . At the beginning of August, he completed his DIY project for creating a wearable device that he boldly dubbed the "artificial pancreas." It is more of a self-regulating insulin pump, and our cyborg did not take the easy route in some aspects of his creation. More about the device's concept and the open-source technologies he relied on — below in the article.
Illustrations except for the device scheme are taken from
Diabetes for Dummies
Liam has type 1 diabetes.
If accurately defined, the word "diabetes" refers to a group of diseases characterized by increased urination; however, the proportion of those suffering from diabetes mellitus (DM) is larger, and the shorthand name has informally caught on for DM. Even in the Middle Ages, most patients with DM were noted to have sugar in their urine. It took quite some time for the discovery of the hormone insulin (which would also become the first fully sequenced protein in history) and its role in the pathogenesis of DM.
Insulin is a vital hormone that regulates the metabolism of many substances, but its primary impact is on carbohydrate metabolism, including the "main" sugar — glucose. For glucose metabolism in cells, insulin acts, roughly speaking, as a signaling molecule. On the surface of cells, there are special insulin receptor molecules. By "binding" to them, insulin sends signals to initiate a cascade of biochemical reactions: the cell starts actively transporting glucose inside through its membrane and processing it internally.
The process of insulin production can be likened to the work of volunteer workers who come to fight against flooding. The level of insulin depends on the amount of glucose: the more there is, the higher the overall insulin level rises in response. To reiterate, what matters is the level in the tissues, not the number of molecules, which is directly proportional to glucose, since insulin does not bind to glucose itself nor is it used for its metabolism, just as volunteers do not drink the incoming water but build dams of a certain height. It is necessary to maintain this specific level of insulin on the cell surfaces, just as the height of temporary dams on flooded areas must be maintained.
It is clear that if insulin begins to be insufficient, glucose metabolism is disrupted; it does not enter the cells, accumulating in biological fluids. This is the pathogenesis of diabetes. Previously, a confusing terminology of ‘insulin-dependent/independent diabetes’ existed, but it is more accurate to classify it this way: type 1 diabetes is a physical lack of insulin (the most common cause being the death of pancreatic cells); type 2 diabetes is a reduced response of the body to its own insulin level (the reasons for this are not fully understood and are varied). Type 1 is when there are few volunteers and they cannot build the dams quickly enough; type 2 is when the dams are of normal height but either leaky or built improperly.
The problem of manual regulation
Both types, as becomes clear, lead to elevated glucose levels outside the cells—in the blood, urine, which has a negative impact on the entire body. One must live, counting and in the syringe and on the plate, respectively. But one cannot manually regulate everything that the body itself would do. A person needs to sleep, and during sleep, the insulin level continues to drop; a person may not eat on time due to everyday circumstances—and then their sugar will drop under the influence of the artificially maintained insulin level. Essentially, life turns out to be in a tunnel defined by glucose levels, above and below which lies a coma.
Partly, the solution to this problem lies in modern devices that have replaced syringes—insulin pumps. This device uses a continuously inserted subcutaneous needle for automatic, dosed delivery of insulin. However, convenient delivery alone does not guarantee effective insulin replacement therapy without current blood glucose level data. This poses another headache for medical professionals and biotechnologists: rapid tests and accurate forecasting of insulin and glucose level dynamics. Technically, this has been realized in the form of continuous glucose monitoring (CGM) systems. These are various devices that continuously read data from a sensor implanted under the skin. This method is less traumatic and more appealing to users than the classical fingerprick, , but the latter is more accurate and is recommended for use if blood sugar levels drop significantly or fluctuate rapidly over time.
The intermediate link in this system is the person—usually the patient themselves. They regulate insulin delivery based on the glucometer readings and expected trends—whether they have eaten something sweet or are about to skip a meal. Yet, in the face of precise electronics, the person becomes the weak link—what if they experience severe hypoglycemia during sleep and lose consciousness? Or behave inadequately in another way, forget/neglect improperly set up the device, especially if they are still a child? In such cases, many people have considered creating feedback systems so that the insulin delivery device can be guided by the glucose sensor readings.
Feedback and open source
However, a problem immediately arises—there are many pumps and glucometers available in the market. Moreover, these are all execution devices, and they need a common processor and software to manage them.
Articles on [, ] the topic of integrating two devices into one system have already been published on Habr. In addition to adding a third case, I will share a bit about global projects that unite the efforts of enthusiasts who wish to build such systems independently.
The OpenAPS Project (Open Artificial Pancreas System), founded by Dana Lewis from Seattle, was established in late 2014. As a type 1 diabetic herself, she embarked on this experiment. After trying it and subsequently detailing her device, she ultimately opened , where it is described in detail how to combine your CGM glucose meter and pump, in various configurations from different manufacturers, with the necessary intermediate devices, software options on GitHub, and a wealth of documentation from a growing user community. The most important aspect emphasized by OpenAPS is, "we provide you with detailed instructions, but you must do everything yourself." The fact is, such activities are one step away from serious sanctions from the FDA (the U.S. Food and Drug Administration, which regulates all medications and medical devices). And while it cannot prohibit you from modifying certified devices and combining them into homemade systems for personal use, any attempt to assist you in doing so or to sell them will be strictly punished. Another equally important idea behind OpenAPS is the safety of the homemade system. The documentation, in the form of and clear, detailed algorithms is aimed precisely at helping the patient, not harming themselves.
the Nightscout account window
Another project, , allows users to upload data from their CGM devices to cloud storage in real-time via smartphones, smartwatches, and other devices, as well as view and process the obtained data. The project aims for the most informative and user-friendly data usage and also contains detailed guides, for example, of glucose meters with smartphones of various operating systems and the required software and intermediate transmitters.
Data visualization is crucial for determining daily fluctuations in glucose according to your lifestyle and for potential adjustments in behavior and diet. It also allows for data transmission in a user-friendly graphical format on a smartphone or smartwatch, and for predicting glucose trends in the near future. Furthermore, this data can be read and processed by OpenAPS software. This is exactly what Liam uses in his project. The KDPV article contains his personal data from the cloud service, where the purple 'fork' on the right represents the projected glucose levels predicted by OpenAPS.
Liam's Project
You can read about the project in detail in his blog post; I will just try to summarize it more schematically and visually.
The hardware includes the following devices: a Medtronic insulin pump, which Liam initially had; a FreeStyle Libre CGM (glucose meter) with an NFC sensor; a MiaoMiao transmitter that sends data from the skin NFC sensor to the smartphone via Bluetooth; an Intel Edison microcomputer, serving as the processor to manage the entire system using OpenAPS; and an Explorer HAT, a radio transmitter to connect the latter to the smartphone and pump.
The cycle is complete.

The entire hardware setup cost Liam 515 euros, excluding the pump, which he already had. He ordered everything from Amazon, including the discontinued Edison. Additionally, the subcutaneous sensors for the CGM Libre are not cheap consumables — 70 euros each, lasting for 14 days.
Software: first of all, the Linux distribution Jubilinux for Edison, followed by the installation of OpenAPS, which the device's author reportedly struggled with. Then, there was the setup for data transmission from the CGM to the smartphone and cloud, for which he had to license a personal build of the xDrip application (150 euros) and configure Nightscout — it needed to be 'married' to OpenAPS through special plugins. There were also issues with the device's operation, but the Nightscout community successfully assisted Liam in finding bugs.
Of course, it may seem that the author complicated the project. The long-discontinued Intel Edison was chosen by Liam as "more energy-efficient than the Raspberry Pi." Apple's OS also added challenges with software licensing and costs comparable to those of an Android smartphone. However, his experience is valuable and will contribute to many similar DIY device projects that are designed to significantly improve the quality of life for many people at a relatively low cost. People who increasingly rely on their own abilities and skills.
Liam reflects on how type 1 diabetes made him feel constrained, and the device he created is a way to regain psychological comfort and control over his own body. In addition to restoring a normal lifestyle, creating a feedback insulin pump system became a powerful expression of himself. "It's better to keep my metabolism under control with JavaScript code than to end up in the hospital," he writes.
Source: habr.com
