How A DIY Open Source Closed Loop “Artificial Pancreas” Works


A DIY loop is no different. It gathers data from:

  • your pump
  • your CGM
  • any other place you log data in, like Nightscout


How does your closed loop gather data?


The rig needs to:


The rig runs a series of commands to collect this data, and then run it through the algorithm and do the decision-making math based on the settings (ISF, carb ratio, DIA, target, etc.) in your pump.



  • physically put your rig together
  • load the open source software on it

The open source software is designed to make it easy for the computer to do the work you used to do to calculate what needs to be done. It runs a series of “reports” to collect data from all the devices and places. Then it prepares the data and runs the calculations. Then it attempts to communicate and send any necessary adjustments to your pump. Then it reads the data back, and does it over and over again.

In order to simplify the process for the human, we’ve designed a series of “aliases”, which is a group of reports. That way, when you need to do a particular thing (gather fresh data), you can run one command instead of several or dozens. Similarly, when you want the system to run automatically, there is a scheduling program called “cron” that you will use to run multiple aliases automatically to do all of these tasks.

Because this project is DIY, there is a chance that at some point one of the steps might fail/not work. To fix this, you will beging to “drill down” to a particular alias and find the report that is failing. Usually, these things self-resolve or running a command manually will fix it. If you’re just starting with OpenAPS, you don’t need to worry about that yet - just know there is a logical framework in the project for gathering data and getting it to where it needs to be for the computer to use it. The documentation will have a troubleshooting section later on that will help if and when you need to drill down.