Final Week and Presentation!

Week 7


At this point my quest to create a fully autonomous insulin pump from scratch was coming to a conclusion (at least for what I wanted to do in the short 8 weeks that I had to work, I will continue to improve designs and make the pump better in the future). I was making iteration after iteration of prototypes with small tweaks to each one to see which one I could get to work the way that I wanted. This week I called the “grind week” because there wasn’t much learning compared to previous weeks, but it was time to buckle down and get a working piece of technology.

 

The Final Design


The design you see above is the case that I created in tinkerCad to work with the rack and pinion gear system that I have mentioned in previous blog posts. Most of the additions to this design address the rigidity of it. I know that the filament I was using (PLA) isn’t the most appropriate for making strong object, so a lot of the strength in the pump had to come from the design of the case itself. I also add a collar to the reservoir holder (the part in the center of the photo that looks like a hollowed out cylinder) because it allowed me to get very consistent flow from the pump, and makes reloading the pump with insulin much easier. I also add a few cutouts for ventilation to keep the hardware from over heating, and that is the extent of the design that I went with. Each iteration I calculated to cost less than ten cents. At this point both the software and hardware were integrated together and I had a working, consistent insulin pump that worked in a true feedback loop. I was happy with the way that the pump was working and was able to get it to pull data continuously for hours and use it to pump insulin (the only reason I stopped was because I had to go to bed and didn’t want the pump to run over night without me watching it). I am confident that this feedback loop could work continuously for the life of the set and CGM.

Presentation Week


With my project being at a satisfactory spot for the presentation that was fast approaching, it was time to shift gears from building things, to being able to communicate some of the things that I was able to accomplish over the past 8 weeks. I believe that my biggest accomplishment in this project was the fact that I was able to create a truly closed-loop system that was more than $9,200 cheaper than the hybrid systems that companies have put out recently. I believe that there is a long way to go in the race to create a mechanical pancreas, but there’s no time to stop. I will keep up to date on any further improvements that I make!

I would like to thank Dr. Remy along with the entire educational technology team for the opportunity to build something that I have dreamed about for years. Thank you to everyone else who has supported me in the quest to build this. It was truly an amazing experience and one that I will never forget. The fight against diabetes isn’t over, but the future is promising and I look forward to any improvements that I may be able to make in the future.

You can watch my presentation here

 

Week 6 Update

Overview


With the presentation date fast approaching, I knew that at this point it was important for me to start wrapping up the project and creating some working prototypes of my insulin pump.

Day 1


Now that I have completed my Python program that will run my insulin pump, it is now time to test a couple different pumping mechanisms that I have found under the thingiverse.com keyword ‘motorized syringe push’. Much of the day was spent making tweaks to the designs and trying to find which design would work best for my insulin pump.

Day 2


On the second day potential disaster struck, but before I get to that I do have good news. After my testing of designs on day one, I have come to the conclusion that this design would work best:This design works off of an rack and pinion set up (explained here) to push the insulin out of a reservoir tube (the container that holds the insulin). This is the only design that produced repeatable results, and in biotechnology consistency is key, so that is why I chose this design.

On to the bad news. Apparently Gettysburg College has been making some changes to its firewall, and my mechanism of pulling data from my database in the cloud has tripped the updated firewall, preventing me from getting any data from the cloud. Unfortunately this issue is impossible for myself to fix, however, I am working with Eric Yurick to help sort out the issue.

Day 3 and 4


While my program was down, I figured that it was important to try and calibrate the pump to actually pump close to the desired amount of insulin. This insulin pump will never actually be connected to someone (because of the dangers it presents), and each person responds to insulin therapy in different ways, so there is no true way to have it perfectly calibrated to someone (and I guess it really doesn’t need to be). With that in mind, I have decided that I will calibrate it to mimic the current insulin settings that I use. To do this I am tinkering with the stepper motor steps and measuring the amount of insulin (I am using water for testing purposes) that is output.

On day three we also had practice presentations with what we have completed so far. Without effectively communicating what you have produced, the technology that you make little impact, so presentation is very important to me. I am now getting more comfortable talking about my project and dialing in the presentation.

Day 5


On day five the network issue has yet to be resolved, however I am meeting again with Eric Yurick on Monday to try and figure it out (thanks Eric!). Until I am able to see how the pump responds to different blood sugar values, I cannot calibrate the pump anymore, so it is back to creating prototypes and testing using the 3D printer. I will update all on the network issues and final designs in next weeks post!

Week 5 Update

Day 1 and 2


Day one and two of this week were arguably some of the most productive of my time here so far. At this point I feel like I have a good understanding of how to produce quality production parts from my 3D printer. I was able to print some possible prototypes for the mechanism that pushes the insulin out of the reservoir. They all work on the same principle, so here is an example of one I am testing:

All of the extruders that I am testing are open source and on thingiverse.com .

Day 3


On day 3 I realized that I had completed all of the pieces necessary to have a crude pump except for the code that controlled the extruder. I used the python code mentioned in my last blog post, along with code to control the stepper motor, and merged the two to work together. Once I had successfully merged the two pieces of code into one python program, I used the blood sugar value that is updated every 5 minutes to control a specific amount of steps (at this point it is not calibrated, but it does work!). I then placed the entirety of the code into one big while loop that allows me to pump a desired amount based off of blood sugar values every 5 minutes for a desired amount of time. This was a huge success in my program having the code finished to the point where I can start making physical prototypes, and the project is really coming together now.

Day 4 and 5


Both of these days were fairly slow considering most of the day was spent waiting for pieces to print out. On the bright side I was able to successfully print out a screw and (basically) a threaded nut that works. For anyone who knows 3D printing knows how difficult this task really is on an FDM printer (the type of printer that I am using). This gives me hope for creating an insulin pump that is completely 3D printed aside from the Raspberry Pi and motor. One of the main issues that I have with current diabetes technology are the astronomical prices for the technology, and one of my main points in my project was making an insulin pump that is very cheap to produce, and 3D printing allows for costs to be far lower.

While I was waiting for my prints to emerge out of the build plates I kept busy with Dr. Remy setting up 3D printers that the IT department had ordered. We wanted to see just how fast we could get a printer from the box to a functioning state. We were able to achieve this task in ~51 minutes, which is pretty impressive considering how many moving pieces make up a 3D printer. Also, setting up 3D printers helps gain a further understanding of how the printers work. This is why I suggest new users to order 3D printer kits rather than fully assembled printers. For one, they are much cheaper when they are in the kit form, and you get a better understanding of how they function.

Hopefully by next week I will be able to have my first fully functioning prototype of an insulin pump which is very exciting. More to come in next weeks blog post!

Week 4 Update

Overview


After last weeks successes with getting the readings from my CGM (continuous glucose monitor) into my cloud database, it was now time for me to figure out how I could get those values out of the cloud so that I could use them to run my insulin pump.

Day 1 and 2


At this point I had realized that getting the readings from the database to be usable would be quite the task taking my lack of knowledge in python into consideration. I knew that I would need to use some type of driver to get the data out of the mongo database, however, I had never coded a task like this before so it was quite the learning curve. A driver basically allows the user to get the data from their collections in the database, and to be able to use that data in their programs. Luckily mongoLabs, the company that I am using to host my database has a driver through python called pymongo that allows me to access my data in python. This would be an efficient way for me to use the data that I was collecting from my CGM.

Early on Monday morning I was also surprised with the arrival of my own 3D printer that I had ordered. After seeing how much was possible with the 3D printers, I knew that I needed to have my own, so much of Monday was spent setting up and tinkering with my new printer.

Day 3 and 4


With help from Dr. Remy, the fourth day of this week I was able to have a working program that would fetch the data that I wanted from my collection and output my blood sugar value, the date and time, as well as the direction in which my blood sugar was trending. With this I am able to start programming my final program that will control my insulin pump. 

Here you can see that I ran my python program, and actively collected my blood sugar values every five minutes for over an hour.

Day 5


Now that I had a working program to collect my blood sugar information it was time for me to experiment with python programs that control stepper motors to pump out the insulin. Essentially a stepper motor allows you to program a motor that will turn a specified amount by the program. I do not yet have a working program that controls the stepper motor based off of my blood sugar values, however it should not be too difficult to program, so look out for that in the next blog post.

On day five we also talked about our project timelines and how our projects were coming along. With four weeks down already, the presentation date is fast approaching. I found that I had achieved many of the goals that I had set out to achieve and more. There are endless possibilities in my project and I am working to implement as many features as I can, and I have decided that I will be trying to achieve my stretch goal of creating a truly closed-loop insulin injection system. In the coming weeks I will be perfecting my program that controls the stepper motors, and 3D printing prototypes for the final insulin pump. The project is beginning to take shape and it is a truly rewarding process. At this point it is promising that I will be able to achieve my stretch goal, and maybe even beyond that.

Week 3 Update

Day 1, 2 and 3


For the first three days of week 3 my focus was on configuring the NightScout website that I am using to continually track the values from my CGM (continuous glucose monitor) and store them in the cloud. The deployment that I used can be found here, and it is the configuration for the CGM that I am using. To use NightScout, you must first set up a website using the instructions on Github, and you can find that through the link that I provided above. At first it seemed as though I was going to be using an Azure deployment, which is just Microsoft’s method of deploying apps to the internet, however I found that Azure was quite complicated to use and set up. I found that it was much easier to use the Heroku deployment method. All of the information about deployment of the app can be found on the NightScout website. Your NightScout app also has to be connected to a database in the cloud, and using the Heroku deployment method automatically sets one up for you, so I found that to be much easier. Heroku automatically deploys the app and gives you a website URL that you can use to see your app. Here is a screenshot of what mine looks like:

The next obstacle that I had to overcome was how exactly I was going to upload the data from my CGM to my app.

Day 4 and 5


For this project to work, I have to be able to access the data from my CGM via the cloud. To get the data into the cloud was a daunting task in itself. The NightScout app requires that you upload using an Android device. You can download the NightScout Android app from their website, just make sure that it is the app that is configured for the CGM that you are using (yes, I downloaded the wrong one and it would not work for nearly a whole day). Once the app is downloaded I had to go into the settings and connect it to my cloud database that I had set up. The nice thing about their Android app is that you have the option to auto-configure using a QR scanner. All I had to do was enter my URL and API Secret that I had set up during the Heroku deployment, and then scan it using the Android phone that I have. Once that was set up, the data from my app was being sent to the database in the cloud. The next step for my project will be figuring out how I can access that data in the cloud and use it to run a program that I will create on the Raspberry Pi.

Week 2 Update

While week 1 was focused primarily on learning the basics behind all of the technology that I would be using, it is now time to determine how all of this technology will interface with the insulin pump that I am trying to create. I realize now that some of the concepts that I talked about in my previous week’s post can be confusing and hard to understand. I will include links to explain 3D printing here, and microcontrollers here, and go into detail on how these technologies work.

3D Printing


3D printing technology has been around for nearly 30 years. There are two main types of 3D printing, stereolithography and fused deposition modeling, and I will be using both in my project. Stereolithography was the first of the two to be created. Stereolithography works through photopolymerization of a resin that is held in a small tank. Basically what this means is that light is projected into the resin, causing the resin to link together on a molecular scale layer-by-layer. The other type of 3D printing that has gained a lot of attention lately is fused deposition modeling. This form of 3D printing works by heating up a filament (in most consumer products the printers use some form of plastic), and pushing it through a nozzle that is controlled via motors in the desired area. This technology also works layer-by-layer and builds the end product from the “ground up”.

 Micro Controllers


Micro controllers allow the user endless opportunities in the world of computing. A micro controller basically works as a mini computer to do whatever job the user programs it to do. Today there are two main micro processors, the Arduino and the Raspberry Pi. Last week I discussed how I was getting the Arduino to do a few basic commands, however, I have found that for my project, the Raspberry Pi will work better than the Arduino. My knowledge on micro controllers is still limited, so for now I will leave it to the links above to explain in better detail.

Week 2 – Day 1


On the first day of week 2 I decided that I wanted to be able to hook an LCD display up to the Arduino and get it to show a message that the user inputs. Using a few online tutorials I was able to get the LCD to display two lines of a message that the user types, and I was even able to get the message to scroll across the screen. This experiment was primarily to work on how I wanted the display of the pump to read.

Day 2 and 3


Over these two days I was mainly doing research into how I can get a glucometer (the device that measures one’s blood sugar) to interface with a micro controller since I would be using the micro controller as the brains of the pump. I came across a webpage that explained a cloud based program that allows the user to store their glucose numbers in the cloud. The project is called night scout and it may be the answer to the problem. The night scout allows the user to send the information from their glucose sensors to a variety of devices and then store the numbers in the cloud. The important part however, is that people have been able to then take the numbers from the cloud and display them using raspberry pi. If I am able to set up the night scout with the raspberry pi, I could make insulin calculations based upon the numbers from that and also have the pump interface with other technology (like phones, smart watches, etc.). The night scout platform is a promising way to solve a major issue in the project.

Day 3 and 4


Thursday and Friday of this week were spent experimenting with the raspberry pi and trying to determine its capabilities. My main goal for these two days was to program the raspberry pi to cycle a stepper motor at a specific speed. Using python I was able to program the raspberry pi to control a stepper motor’s speed based off of an integer input. The stepper motor did cycle, however, I believe that there are some bugs that I need to sort out in order to have the motor function with more precision.

Week 1 Update

Hi all!

With the beginning stages of my project underway, I have found that 3D printing as well as utilizing micro controllers like Arduino’s is much easier than it seems at first glance.

Day 1


On the first day of work I found myself tasked with installing all of the programs needed to run the 3D printers. With the help of Dr. Remy, I chose three programs that I would use to get the printers running. The first program that I downloaded was Repetier-Host. Repetier-Host allows you to manage your .stl files (one way of storing 3D image files) and position the images in the desired way on the printing bed.

Once I had Repetier-host downloaded, I then had to download a program in order to slice the .stl files. Because 3D printers print from the bottom up, layer by layer, you must slice the images up into layers. The program that I decided to use for slicing is called Slic3r, and it interfaces very well with Repetier-host. The output of the slicing is what is called gCode, and the gCode is what the 3D printer uses to print the desired output.

Day 2


By the second day of work, I had a fairly solid understanding of the basic process of 3D printing. At this point I wanted to be able to print a design that I had created. There are countless CAD programs on the internet, but a basic, easy to use CAD program that I found was tinkerCAD. TinkerCad allows the users to create whatever 3D image they want and export it directly to Repetier in order to be printed.

Days 3 and 4


On the third day of work I knew that I would have to try to tackle some problems that I had been putting on the back burner due to its perceived difficulty. My goal for the day was to program an Arduino micro controller to control a stepper motor. A stepper motor basically allows the user to input the number of “steps” that they want the motor to turn in either direction. Arduino does a great job of providing sample code to the user. The code that I used to test the motor was found under File>Examples>Steppers. I was able to program the Arduino to turn the motor one full rotation at a specific speed, delay, and then return to the starting position by rotation in the opposite direction. I used the Arduino in conjunction with a ULN2003 stepper motor driver to make the motor function in the desired way.

Day 5


By the fifth day, I had come to realize that some of the 3D printing that would be necessary for my project would need to come from a CAD program that is more professional. While tinkerCAD is an easy to use software that provides good results, I felt as if it were time to experiment with a more professional form of CAD. The program that I decided to download was Fusion 360. The Fusion 360 software was much more difficult to learn and not as straight forward, however, the tools that it provides allows you to have much more freedom with your design. There is also a free 3 year trial for students to download the otherwise expensive software.