Jump to main content

Dealing with Diabetes: The Road to Developing an Artificial Pancreas


Do you hate shots? Do you complain about paper cuts? Imagine if you had to give yourself shots a couple of times a day, as well as prick your finger, on purpose, even more frequently. Of course, if you have diabetes you do not have to imagine this; it is your reality. People who have diabetes usually need to keep close track of how much sugar is in their blood (called their blood glucose levels) by testing a drop of blood from a finger prick. If there is too much sugar in their blood, some diabetics take insulin shots to decrease it. However, it can also be dangerous to have too little sugar in a person's blood. Because of this, one area of intense research right now is on making an artificial pancreas, or basically a device that automatically adjusts a person's blood sugar levels. In this science project, you will build a circuit that has to face some of the same issues that an artificial pancreas does. How hard will it be to get the sugar levels in the blood just right? Get ready to build your own artificial pancreas to find out!


Areas of Science
Time Required
Average (6-10 days)
Some familiarity with electronic circuits and using breadboards would be helpful, though it is not required for this project. Completion of a basic chemistry class is also recommended before trying this project.
Material Availability
A pump and other electronics parts must be specially ordered to do this project. See the Materials list for details. Estimated project time includes shipping of specialty components.
Average ($40 - $80)
Some parts of the circuit can get warm during normal operation. Do not leave the circuit operating when unattended. Be very careful with your wiring to prevent short circuits from happening; short circuits can get very hot and cause plastic parts of the circuit to melt.
Teisha Rowland, PhD, Science Buddies
Svenja Lohner, PhD, Science Buddies
Ben Finio, PhD, Science Buddies
Andrew Bonham, PhD, Metropolitan State University of Denver


Build a model of an artificial pancreas to investigate the challenges of getting such a device to work.


Scientists and engineers are often motivated to do their work in order to help people out. One area in which that motivation is readily apparent is in the field of biomedical engineering, where an intense focus of research right now is on creating better insulin pumps and an artificial pancreas. What is the purpose of these devices? Such devices would help eliminate the procedures that a person living with diabetes has to do, as well as remove the nearly constant health decisions they have to make. Specifically, the devices would help people with diabetes control how much sugar is in their blood. It is a daunting goal; the pancreas has a very complex biological role that has to be mimicked by a combination of electronics, chemistry, and biology. This project will allow you to explore some of the complexities engineers and scientists face as they strive to create an artificial pancreas.

First, let us step back for a moment and have a quick crash course (or a refresher if you are already familiar) on diabetes. The body uses a simple sugar, called glucose, as its primary fuel. We get glucose from the food we eat. Both table sugar (sucrose) and other types of carbohydrates, such as starch (found in large quantities in pasta and other grain-rich foods), are broken down by our bodies to make glucose.

Because food can be broken down to make glucose, the level of glucose in a person's blood—which is commonly referred to as the blood glucose level—usually goes up after he or she eats. See Figure 1 for typical blood glucose level fluctuations for a person over the course of a day. Note that blood glucose is typically measured in milligrams per deciliter (mg/dL).

Example graph of typical blood glucose levels over the course of a day

Glucose level graph shows spikes in blood glucose during breakfast, lunch and dinner, and a steady decrease in blood glucose after 8 p.m. Sucrose rich foods are highly available during lunch but availability decreases dramatically before dinner.

Figure 1. This graph shows how a person's blood glucose levels may change over the course of a day, and how eating a meal with lots of sugar (sucrose) can affect blood glucose levels. The y-axis shows blood glucose levels (in mg/dL). (Image credits: adapted from a figure by Jakob Suckale, Michele Solimena, Wikimedia Commons, 2011)

Like most of the chemicals in your blood, glucose must be tightly controlled. The level of glucose in your blood is regulated by insulin, a hormone made by the pancreas. When blood glucose levels rise after eating a meal, the pancreas releases insulin, which causes cells in the body (such as liver, muscle, and fat cells) to take up glucose, removing it from the blood and storing it (as glycogen) to use for energy later. When the blood glucose levels start falling, the pancreas stops releasing insulin, and the stored glucose is used for energy. If blood glucose levels get too low, the pancreas may produce glucagon, a hormone that increases the levels. This process is how the pancreas and the hormones it produces are in charge of regulating blood glucose levels. Watch this video to see how blood glucose levels can change over time for different people.

Blood Sugar Levels
This video shows how blood glucose levels change over time for people with and without diabetes (Khan Academy, 2011).

However, in people with type 1 diabetes (which is caused by an autoimmune response, and was formerly known as juvenile diabetes), the pancreas no longer makes insulin. If left untreated, the blood glucose levels of a person with type 1 diabetes could be dangerously high, which is a condition called hyperglycemia. In type 2 diabetes—which is thought to be primarily caused by obesity, and makes up the vast majority of diabetes cases—a person has insulin resistance, which means their body does not respond to insulin, or their pancreas does not make enough insulin. Currently, a person with type 1 diabetes (and some with type 2 diabetes) must take insulin supplements to treat the condition.

While the solution for many diabetics is to take insulin, it is not that simple; many things have an effect on insulin levels in a person's body, including exercise, stress, what and how much they eat, just to name a few. And having blood glucose levels that are too high (hyperglycemia), or too low (hypoglycemia), can cause serious health problems. This leaves many type 1 diabetes patients constantly checking their blood glucose levels, calculating how their actions will change their levels, and adjusting their insulin doses to avoid a critical high or low. To get a sense of the effort involved, watch this video.

Video of type 1 Diabetes
This video shows how Molly lives with Type 1 Diabetes.

As previously discussed, to take away the difficulties of managing type 1 diabetes, scientists and engineers have set out to create improved insulin pumps and an artificial pancreas. Diabetics who take insulin supplements take them in the form of insulin injections (using a needle) or infusions using an insulin pump, like the one shown in Figure 2. However it is a done, currently a person who takes insulin must closely monitor his or her blood glucose levels to determine when, and how much, insulin to take. Insulin pumps are typically small, about the size of a cell phone, and the system usually includes a continuous glucose sensor that detects the amount of glucose in the person's blood and an electronic interface that is told how much insulin to give to the person. To see what it is like to use an insulin pump and continuous glucose sensor to manage type 1 diabetes, you can check out the video in the article by D. Grau in the Bibliography.

A person holds an insulin pump that is inserted into their waist area
Figure 2. This picture shows an insulin pump attached to a person's body to infuse specific amounts of insulin.

Currently, auto-correcting (i.e., automatic) insulin pumps—which are also called artificial pancreases—automatically administer the right amount of insulin; however, they are unavailable to diabetics. But the idea of such a device is very promising and is an area of much active research. The video will give you a basic understanding of the goals of an artificial pancreas and the path to making one, but because this is a rapidly progressing field, you should do your own internet search to see what the current status of the research is.

Video for artificial pancreas research
This video shows what research is being done to create an artificial pancreas.

Now that you have a better understanding of type 1 diabetes and what an artificial pancreas is, you may be wondering how you can work on something like that for a science fair project. In this project, you will get to find out by building a simplified model of an artificial pancreas system and investigating the challenges of getting such a device to work. Clearly, blood, insulin, and glucose are not readily available for a science project, but you can use other components to mimic some of the interactions and start designing and fine-tuning a model of an artificial pancreas. To do this, you will use some chemistry and create an electrical circuit. Specifically, you will use acid/base chemistry, where a basic solution represents high blood glucose levels, and a more neutral solution represents normal blood glucose levels in your model. A conductivity sensor will represent the glucose sensor, and control whether a pump in the electrical circuit turns on or not. When the solution is very basic, the conductivity sensor will make the electrical circuit run a pump. The pump will move an acidic solution, which represents insulin, into the basic solution to neutralize it. When the basic solution becomes more neutralized, the conductivity sensor will make the circuit stop powering the pump. This represents high blood glucose levels being lowered by the addition of insulin, until the glucose levels are normal and no more insulin needs to be added to the bloodstream. Figure 3 helps summarize the important information, and shows how the artificial pancreas model you will make in this project is similar to, and different from, a real artificial pancreas.

Two flowcharts describe the working process of an artificial pancreas in a human body and in a simplified experiment

Two flowcharts show the working process of an artificial pancreas in a human body. The left flowchart (from top-to-bottom) describes the working steps of an artificial pancreas in a person as: a person has high blood glucose levels, the glucose sensor detects the high levels, the pump runs, insulin is pumped into the bloodstream, the person has normal glucose levels and then the pump stops. The right flowchart (from top-to-bottom) describes the working steps of an artificial pancreas built for an experiment as: a bowl contains a basic solution (baking soda), the conductivity sensor detects the basicity, the pump runs, an acidic solution (vinegar) is pumped into the basic solution, the basic solution becomes neutralized, and then the pump stops.

Figure 3. This flowchart shows how an artificial pancreas would work (on the left) and how those steps are similar to what is done in the model used in this project (on the right).

How acidic or basic a solution is, is measured by a scale called pH. For example, an acidic pH is below 7, such as lemon juice or vinegar. A basic pH is above 7, such as baking soda or bleach. A neutral pH is about 7, which is what water typically has. For a refresher on these topics, see the Science Buddies page on Acids, Bases, & the pH Scale.

In your artificial pancreas model, the acid/base chemical reaction that will be taking place is shown in Equation 1. A solution of baking soda (sodium bicarbonate, or NaHCO3), which is a base, will represent high blood glucose levels, and a solution of vinegar (acetic acid, or CH3COOH), which is an acid, will represent insulin. When acids and bases (like vinegar and baking soda, respectively) are mixed, a chemical reaction occurs (shown in Equation 1) that produces water (H2O) and bubbles of carbon dioxide gas (CO2). When equal amounts of base and acid are mixed together, the solution is neutralized. Keep in mind that this is not the reaction that occurs when insulin is added to change the blood glucose levels in a person! You are using these chemicals as substitutes in your model since baking soda and vinegar are easy-to-obtain household materials.

Equation 1:

So how does the acidity or basicity of a solution control whether an electrical circuit runs a pump? It has to do with the fact that acidic and basic solutions are fairly conductive, which means that they can conduct electricity, or allow electrical current to flow through them. (Conductive materials also have lower electrical resistance.) Neutral solutions, on the other hand, are much less conductive (i.e., they have a higher resistance), so it is much harder for electrical current to flow through them. Because of this conductive difference, an electrical sensor can be made that can detect if a solution is acidic, basic or neutral. Specifically, in the artificial pancreas model you build in this project, a conductivity sensor is made from two metal wires (or electrodes) that are a certain distance apart in the solution. The more conductive the solution is, the more electrical current can flow through it from one electrode to the other. If the solution is not conductive at all, no current will flow.

When enough electrical current travels through the conductivity sensor, it causes a transistor in the circuit to activate a pump. A transistor is an electrical component that acts like a switch; if the transistor receives a high enough voltage, it can allow electrical current to travel through a different path of the circuit. In the circuit you will build for this project, the transistor will be connected to a pump so that when enough current flows through the conductivity sensor, it outputs a high voltage to the transistor, which allows current to flow through the pump and make it run. If there is not enough current going through the sensor, the pump will not run. Figure 4 gives an overview of how this works.

Lastly, the conductivity sensor is combined with other electrical components called potentiometers, which are a type of adjustable resistor. You will adjust the potentiometers in your model to control when the pump turns on. The conductivity sensor and the potentiometers together make up what is called a voltage divider, and this is technically what lets the conductivity sensor send the high voltage to the transistor to make the pump turn on. For a detailed explanation of how the circuit works, including a circuit diagram, see the FAQ section. You can also read more about basic electricity concepts in the Science Buddies Electricity, Magnetism, & Electromagnetism Tutorial.

Two flowcharts describe the relationship between a sensor, transistor and pump in an artificial pancreas circuit

The two flowcharts show how a sensor, transistor and pump interact in an artificial pancreas circuit. If the sensor measures a non-conductive solution, a low voltage signal is sent to the transistor, no current flows from the transistor to the pump and no liquid is dispensed. If the sensor detects a conductive solution then a high voltage signal is sent to the transistor, current flows through the transistor to the pump, and liquid from the pump flows through.

Figure 4. This diagram shows how the circuit works. When the solution has a neutral pH, the sensor outputs a low voltage, so the transistor does not let any current flow through the pump. When the solution has a high pH, the sensor outputs a high voltage, which activates the transistor, causing current to flow through the pump, which then pumps liquid.

For more information on electronics and related terms (such as voltage, current, and resistance), see the Science Buddies Electronics Primer: Introduction.

Do you think it will be difficult to get the artificial pancreas to stop when it is supposed to, when the right amount of vinegar solution has been added to the baking soda solution? How accurate can the model be made to be? How are the challenges encountered when making this model similar to the challenges that engineers who are trying to make a real artificial pancreas system would face? Try this project to find out!

Terms and Concepts



Here are some useful resources on diabetes, blood glucose levels, insulin pumps, and artificial pancreases:

These resources will give you some background information on acids, bases, pH, and conductivity:

You can check out these resources if you are just starting out with electronics:

Materials and Equipment

Note: The electrical specifications of certain components—especially the MOSFET (a type of transistor)—are important for the circuit to work properly. We recommend purchasing the exact parts from Jameco, listed below, unless you are confident that you can find appropriate parts with equivalent specifications.

These items may be special ordered from Amazon or other suppliers:

These items may be found around your home or purchased locally:

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

Experimental Procedure

Note: This engineering project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process in the Science Buddies Engineering Design Process Guide.

Assembling the Circuit on the Breadboard

In this section, you will assemble a circuit on a breadboard. If you have never used a breadboard before, you should refer to the Science Buddies reference How to Use a Breadboard for Electronics and Circuits before you proceed. You can follow a step-by-step slideshow that will show you how to put components in the breadboard one at a time. Alternatively, Table 1 lists each component and its location on the breadboard. Important: read these notes before you proceed.

  • The colors of your jumper wires and alligator clips may vary. This is OK, they do not need to match the colors in the diagrams.
  • Resistors are marked with colored bands. These colors do matter. Make sure you pick the right resistors for each step according to the markings.
  • It matters which direction some of the components are facing. Make sure you read the slideshow captions for any special notes about inserting each part.
  • Your potentiometers have different resistance values, but they all look the same. They should come in individually labeled bags. Before you take them all out, use a permanent marker to label them 1 MΩ, 100 kΩ, and 10 kΩ, so you do not lose track of which is which.
  • This section only shows you how to assemble the circuit. For a detailed explanation of how the circuit works, see the Help section.

Click through the slideshow for step-by-step breadboard diagrams of the circuit.

Part name PictureBreadboard Symbol Location
330 kΩ resistor
A 330000 ohm resistor
Breadboard diagram symbol for a 330000 ohm resistor
B1 to (+) bus
100 kΩ resistor
A 100000 ohm resistor
Breadboard diagram symbol for a 100000 ohm resistor
C1 to (-) bus
Jumper wire A purple jumper wire Breadboard diagram symbol for a purple jumper wire A5 to (-) bus
A7 to A13
A14 to A17
A18 to A21
A22 to (-) bus
MOSFET A metal-oxide semiconductor field-effect transistor
Breadboard diagram symbol for a MOSFET
B5, B6, B7. Large metal tab must face to the left, writing should face to the right.
1 MΩ potentiometer A potentiometer Breadboard diagram symbol for a potentiometer B12, B13, B14
100 kΩ potentiometer A potentiometer Breadboard diagram symbol for a potentiometer B16, B17 B18
10 kΩ potentiometer A potentiometer Breadboard diagram symbol for a potentiometer B20, B21, B22
Pump A peristaltic pump Breadboard diagram symbol for a peristaltic pump Use alligator clips and jumper wires to connect terminals to E6 and (+) bus
Conductivity sensor A conductivity sensor made from two strands of copper wire wrapped around opposite ends of a plastic straw Breadboard diagram symbol for a conductivity sensor Use alligator clips and jumper wires to connect to E1 and C7. See next section for directions to build the sensor.
8xAA battery pack A battery pack that holds eight AA batteries Breadboard diagram symbol for a battery pack Red wire to (+) bus, black wire to (-) bus
Table 1. Components for the artificial pancreas circuit.

Making the Conductivity Sensor

In this part of the procedure, you will make a conductivity sensor and connect it to your breadboard circuit. The sensor will be made using bare copper wire, a straw, scissors, and a small piece of flat Styrofoam.

  1. Cut out a small segment of plastic straw, about 6 centimeters (cm) long.
    1. If possible, one end of the segment should have the ridged, bendable part of the straw on it; this will help keep the wire on the sensor.
  2. Take a spool of bare copper wire and cut two pieces that are about 15–16 cm long each. Note: Cutting the wire with scissors may dent the scissors, so use a pair of scissors that may be alright to dent, or use a pair of wire cutters.
  3. Wrap the end of each copper wire tightly around the straw, looping it about four times with each wire, as shown in Figure 5. Wrap the wires about 4 cm apart from each other on the straw, and leave the wires with tails that are about 6 cm long (or longer) each.
    1. The wire should be wound tightly around the straw so that the wire does not easily slide around on the straw. If the wires move much, they could change the amount of conductivity detected by the sensor.
    2. However, even if the wires do move some, this should be fixed when you add the Styrofoam piece next.
Two copper wires wrapped around the ends of a cut straw
Figure 5. Wrap the ends of two copper wires around a segment of straw, making about four loops with each wire.
  1. Next, cut out a piece of flat Styrofoam that is about 4 cm × 7 cm.
  2. Carefully poke the copper wire tails from the straw through the Styrofoam piece, keeping the wires the same distance apart that they are on the straw piece, as shown in Figure 6. Place the Styrofoam about 1–2 cm above the straw.
Two copper wires pushed through a styrofoam sheet are wrapped around the ends of a cut straw
Figure 6. Push the copper pieces through a small rectangle of Styrofoam.
  1. On the top side of the Styrofoam (opposite the side where the straw is), make a sharp bend in each wire, right above the Styrofoam, as shown in Figure 7. Make sure the bend is sharp enough to keep the wires from sliding down through the Styrofoam.
    1. The sensor will be going into a bowl of liquid, and the amount of copper wire submerged in the liquid can change how much conductivity the sensor detects. Because of this, it is important that the amount of wire submerged in the liquid is always the same. Since Styrofoam floats, the Styrofoam piece will help keep the wires submerged at the same depth in the liquid for your tests.
Two copper wires poke through a styrofoam sheet
Figure 7. Make sharp bends in each wire, just above the Styrofoam on the side without the straw.
  1. Lastly, attach the unconnected alligator clip leads from your circuit to the copper wires on the sensor, as shown in Figure 8. It does not matter which clip is connected to which wire.
Two alligator clips connect to two copper wires pushed through a styrofoam sheet and wrapped around the ends of a cut straw
Figure 8. After attaching the alligator clips to the copper wires, the conductivity sensor should look like the one here.
  1. Your artificial pancreas model circuit is now complete and ready for testing! It should look similar to the one shown in Figure 9.
Breadboard diagram of a completed artificial pancreas circuit

A completed insulin pump circuit with a breadboard, conductivity sensor, battery pack and peristaltic pump
Figure 9. Top: a breadboard diagram for the final circuit with the sensor attached. Bottom: a picture of the completed circuit.

Testing the Artificial Pancreas Model

In this part of the procedure, you will test your artificial pancreas model. You will do this by first normalizing it to a neutralized solution to make sure the pump will turn off once your solution is neutralized. You will then put the conductivity sensor in a basic solution (i.e., solution of baking soda), which will make the pump move an acidic solution (i.e., pure vinegar) into the bowl of basic solution until the solution is neutralized and turns off the pump.

  1. Take three mixing bowls and label them "Neutralized," "Vinegar," and "Baking Soda."
    1. For labeling, you can use masking tape and a permanent marker or small sticky notes and a pen or pencil.
  2. On a scale, place a measuring cup or other small container to weigh baking soda on the scale. Zero out the scale and then weigh out 14.3 grams (g) of baking soda.
  3. Put the 14.3 g of baking soda into the mixing bowl labeled "Baking Soda."
  4. Use the graduated cylinder, or a metric measuring cup, to measure out 200 milliliters (mL) of distilled water. Add the 200 mL of distilled water to the baking soda in the mixing bowl.
  5. Mix the water and baking soda until the baking soda is completely dissolved.
  6. Measure out 100 mL of the baking soda solution and add this to the mixing bowl labeled "Neutralized."
    1. Tip: You may want to use a small cup with a spout to transfer the baking soda solution.
  7. Measure out 100 mL of distilled white vinegar and very slowly add it to the "Neutralized" bowl. Once the vinegar-baking soda solution stops reacting, the solution should be neutralized.
    1. Caution: Mixing an acidic solution with a basic solution can cause a powerful chemical reaction. You must pour the vinegar into the bowl very slowly to give the two solutions time to slowly react, otherwise you may end up with a big mess and will need to make up fresh solutions!
    2. What happens as you pour the vinegar into the baking soda solution? Can you explain why this is?
    3. Once the reaction has slowed, slowly mix the solution to make sure the vinegar and baking soda have completely reacted.
    4. Note: The amounts of vinegar and baking soda you are using are the same. Because of this, the acid and base should react and neutralize the solution. If you want to see the math behind this, check out the FAQ section in the Help tab.
  8. Measure out 200 mL of distilled white vinegar and carefully pour it into the "Vinegar" bowl. Take the tubing from the pump and place both ends in the "Vinegar" bowl.
  9. To find out what the pH of the baking soda solution, the vinegar and the neutralized solution is, add about 1 teaspoon of bromothymol blue indicator solution to each bowl. Each solution will change color according to the color scale shown in Figure 10. The vinegar should turn yellow, the baking soda solution blue and the neutral solution green.
Three plastic containers filled with yellow, green and blue liquid next to a drawn Bromothymol Blue pH color scale

Three containers of yellow, green and blue liquid show the pH levels of vinegar, a neutralized solution, and baking soda respectively. Bromothymol blue is an indicator solution that changes color based on the pH level, a drawn scale shows that any pH between 0 and 5.5 will turn yellow, between 5.5 and 8.5 will turn green, and between 8.5 and 14 will turn blue.

Figure 10. Final colors of the vinegar, baking soda solution and neutralized solution according to the bromothymol blue indicator color scale.
  1. Carefully place your conductivity sensor in the "Neutralized" bowl, letting the straw part be submerged and the Styrofoam piece float on the surface, as shown in Figure 11. Your overall setup should now look similar to the one in Figure 12.
    1. If the Styrofoam piece is not floating evenly, you can try taping the test leads onto the rim of the mixing bowl to keep things in place.
Two photos show alligator clips connected to a submerged conductivity sensor made from styrofoam, wire and a straw
Figure 11. Place the conductivity sensor in the neutralized solution so that the Styrofoam piece floats and the straw part with wrapped wire is submerged.

A completed artificial pancreas circuit setup for calibration

A completed artificial pancreas setup for calibration has two ends of a pump in a vinegar solution and a conductivity sensor in a neutral solution.

Figure 12. When you are equilibrating the artificial pancreas circuit in a neutralized solution, your setup should look like this one.
  1. The pump may start running as soon as you put the conductivity sensor in the neutralized solution, but do not worry if the pump is not running yet. (When the pump runs, vinegar should simply be pumped out of, and then back into, the "vinegar" bowl). In this step, you will normalize your artificial pancreas model so that the pump does not run in a neutralized solution, but still runs in a solution that is slightly more acidic (which will be more conductive). You will do this by adjusting the three potentiometers (the blue components with the white knob that you put in holes B12–14, B16–18, and B20–22).
    1. Remember that a potentiometer is a variable resistor; you can change its resistance by turning the white knob. Your circuit has three potentiometers with different values: 1 MΩ (1,000,000 ohms), 100 kΩ (100,000 ohms), and 10 kΩ (10,000 ohms). The potentiometers are connected "in series" so their resistance values add. This lets you make coarse, medium, and fine adjustments respectively to the total resistance value. When you change the total resistance of the potentiometers, this affects how much voltage is sent to the transistor, which controls whether the pump is turned on or not. If you want to find out more about how this works (it involves forming a voltage divider with the conductivity sensor), try re-reading the Introduction in the Background tab and check out the FAQ section in the Help tab.
    2. If the pump is not running, slowly and gently turn the white knob on the 1 MΩ potentiometer until the pump turns on. Try turning it all the way clockwise and all the way counter-clockwise find out which way turns the pump on (which way you need to turn it will depend on which way you put the potentiometer into the breadboard).
    3. Once the pump is running, very slowly turn the potentiometer's knob in the opposite direction to turn the pump off. Stop turning the knob when it reaches the point that makes the pump very slow and almost turn off. Then move on to the 100 kΩ potentiometer and turn the knob until the pump just switches off. You can also use the 1 kΩ potentiometer for fine-tuning to find the right setting that just turns the pump off. Play around with adjusting the knobs of all three potentiometers until you are satisfied that the pump does not run in the neutralized solution (but will still run if turned slightly).
      1. While you are adjusting the potentiometers, identify which pump tube has liquid flowing out of it. When the pump is not running, dry the end of this tube and mark it with a small dot using a permanent marker. This will help you in the next step when you need to pump a liquid into a different bowl.
    4. Safety note: Do not leave the pump running unattended, and do not let the circuit run for more than about 15 minutes at one time. Note that the transistor may become warm while the pump is running, but it should not become dangerously hot. If it is very hot, or if you notice any smoke or a burning smell, this probably means that you have a short circuit. Immediately disconnect the battery pack from the breadboard, and make sure that everything else is connected correctly by referring to the diagrams above. Just one misplaced wire can prevent the circuit from working, or create a short circuit! Remember to make sure that the exposed metal parts of different components, like the resistors and alligator clips, are not bumping into each other, as this will also create a short circuit.
    5. Note: If the pump does not turn on, no matter how you turn the potentiometer's knob, check the following:
      1. Make sure all of the jumper wires and components are pushed firmly into the breadboard's holes. A single loose wire can prevent the circuit from not working.
      2. Make sure no exposed metal parts (like the leads of the resistors) are touching each other, as this will create a short circuit.
      3. Be especially careful to avoid creating a short circuit by having wires from the red and blue bus strips touch each other. This can make the circuit get dangerously hot and can even melt some of the plastic components.
  2. Once you have normalized your artificial pancreas model so that the pump does not run when the conductivity sensor is in a neutralized solution, carefully remove the conductivity sensor from the neutralized solution (leaving the pump's tubes in the "Vinegar" bowl), and rinse the sensor briefly with some baking soda solution (over a sink or a different bowl). This will help remove the neutralized solution from the sensor.
  3. Now leave the unmarked pump tube (inlet tube) in the "Vinegar" bowl. Take the pump tube that you marked in step 10.c.i. (the outlet tube), wipe the outside down with a paper towel or clean rag, and then place it in the "Baking Soda" bowl.
  4. Next, place the conductivity sensor in the "Baking soda" bowl. Your setup should look like the one in Figure 13. The pump should start running, pumping vinegar (a drop or a few drops at a time) into the bowl with baking soda solution, and you should see bubbles being made as the acid-base reaction takes place.
    1. Note: Make sure the sensor is floating the same way that it was in the neutralized solution. If needed, tape the alligator clip test leads to the side of the bowl to hold them in place so that the Styrofoam piece is floating evenly. It is very important to make sure that the sensor is submerged in the liquid to the same depth that it was in the neutralized solution or your results may be inaccurate.
A completed artificial pancreas circuit setup for testing

A completed artificial pancreas setup for test has one end of a pump in a vinegar solution, another end of the pump in a basic solution, and a conductivity sensor in the basic solution.

Figure 13. When you are neutralizing the baking soda solution with vinegar, this is what the setup should look like.
  1. While the pump is running, carefully and continually move the end of the pump tube in the "Baking Soda" bowl so that the vinegar mixes well with the baking soda solution throughout the bowl (including under and around the sensor). It is critically important to stir the solution, or the experiment will not work properly. All of the vinegar and baking soda must mix well to neutralize the baking soda solution. You will see that at the spot where vinegar drips into the baking soda solution, the color of the indicator will change from blue to yellow. The color change of the solution gives you an indication of what the pH of the solution in the "Baking Soda" bowl is during neutralization.
  2. Eventually, the pump should slow down and then stop running. It might turn on and off as you mix the last bits of vinegar that is pumped in; if it does this, wait until it stops running for at least 10 seconds before moving on to the next step. How does the color of the indicator (the pH) now compare to the pH of the neutralized solution you made in step 7?
  3. When the pump stops, measure how much vinegar solution is left in the "Vinegar" bowl by carefully pouring it into a metric measuring cup or a graduated cylinder using a funnel. In your lab notebook, record how much vinegar is remaining.
    1. Note: There may be more liquid in the bowl than can fit in the measuring cup or graduated cylinder, so you may need to fill it up (and empty it out) multiple times to measure the total amount of baking soda.
  4. Analyze your results and determine how accurate this artificial pancreas model is.
    1. Since the baking soda solution you prepared is at the same concentration as the vinegar, they should make a neutralized solution when the same amount of each have been mixed together. This means that 100 mL of baking soda solution should be neutralized with 100 mL of vinegar. (If you want to see the math behind this, check out the FAQ section in the Help tab.)
    2. Because the "Baking Soda" bowl had 100 mL of baking soda (since you prepared 200 mL in step 4, but removed 100 mL in step 6) and the "Vinegar" bowl had 200 mL of vinegar (from step 8), the pump should have ideally stopped when 100 mL of vinegar was remaining in its bowl. How close were the results (from step 16) to 100 mL vinegar? Was there too much or too little vinegar remaining?
    3. There are many reasons why it may not have taken exactly 100 mL of vinegar solution to neutralize the 100 mL baking soda solution. Here are some possible sources of error, but you may think of additional ones:
      1. The circuit may not have been accurately normalized (in step 10).
      2. The potentiometers might have been bumped during testing.
      3. Liquid from either bowl may have been spilled during testing.
      4. The baking soda bowl was not stirred enough while vinegar was being added. If this happens, the conductivity sensor may still detect a basic solution, even though parts of the solution in the bowl have been completely neutralized (or may even be acidic).
      5. Mistakes in preparing the baking soda solution should not actually be a source of error. Do you know why this is?
      6. Note: Because pH reactions occur on a logarithmic scale, the error measurements can be on a logarithmic scale, too. This means that a margin of error that may seem large (such as having 150 mL vinegar leftover instead of 100 mL) is actually not that big. See the Help tab for details.
      7. Think about how each possible source of error may have affected your results.
  5. Plan how you could change your model and/or your testing procedure to make the model more accurate. Whatever you decide to change, be sure to record your plans in your lab notebook. Specifically, think about:
    1. What could you physically change about your circuit, conductivity sensor, or experimental setup? For example, could you improve the stability of your sensor if it was moving around, or build a new sensor with some changes to the design?
    2. What could you change about the procedure you used when doing the experiment? For example, if you find that mixing is a problem in your procedure, try different ways to increase the mixing of both solutions, starting by stirring them with a spoon, swirling them or even using the conductivity sensor to stir the solution.
    3. How would switching the pumping direction affect the results? Does it matter if you pump vinegar into the baking soda solution or the other way round?
    4. What if you changed the concentration of the baking soda solution? Will the results be more accurate? Note that changing the concentration of the baking soda solution will also change the amount of vinegar that you need to neutralize this solution.
    5. Tip: You may want to refer to Engineering Design Process guide for help with this.
  6. Clean and dry the mixing bowls and repeat steps 1–18 to test your model again, with the changes you decided on in step 19, and analyze its results. How accurate was it this time?
    1. Note that this model may not necessarily be more accurate than the original model. This is part of the challenge of the engineering design process.
  7. If you want, you can change your model and/or testing procedure even more by repeating steps 19–20 one or more times. Can you make the model be even more accurate?
  8. You can make a bar graph of your results, with a bar for each time you tested the model (labeled on the x-axis) that shows how much vinegar remained when testing each time (labeled on the y-axis in mL). You can draw a horizontal line across the graph at the "100 mL" point to show the ideal amount of vinegar left.
  9. Following the indicator color change of your solutions, you can analyze the pH results as well.
    1. How did the pH, or the indicator color, of the baking soda solution change by the addition of the vinegar?
    2. Was the indicator color (pH) of the original neutralized solution the same as the indicator color (pH) of the solution when the pump stopped running?
    3. See the FAQ in the Help tab for more information on pH and this project.
  10. Overall, how well did the artificial pancreas model work? Were you able to improve on the original one you tested? How are the challenges you faced in designing this model similar, and different, to the challenges faced in designing a real, accurate artificial pancreas?
    1. Tip: You may want to refer to the Introduction in the Background tab to help you answer this last question.


For troubleshooting tips, please read our FAQ: Dealing with Diabetes: The Road to Developing an Artificial Pancreas.

icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.


  • In the testing you did for this project, you should have found that the artificial pancreas model could be automated for the part you tested. In other words, when the solution is very basic (representing high blood glucose levels), the pump turns on and adds an acidic solution (representing insulin) to neutralize the solution (representing normal blood glucose levels). However, you did not test how the model works for other parts of an artificial pancreas, such as continuing to add insulin when the blood glucose levels are consistently high over time. Try adding more baking soda solution to the "Baking Soda" bowl after it is neutralized; does it turn the pump back on again? Does pumping in more vinegar turn the pump back off? If you repeatedly add baking soda, does it have the same effect? You could measure the amounts of baking soda and vinegar that are added over time and graph your results. How responsive is the model to turning the pump on and off?
  • Some people may want an artificial pancreas to turn on and pump insulin when they have a specific, different blood glucose level compared to other people. You could try modeling this by making solutions with different amounts of baking soda solution and vinegar mixed together (instead of equal amounts, as you use in this project) and then normalize the artificial pancreas model to the different solutions, one at a time (each one representing a different person). How does this affect how much vinegar is used to neutralize the baking soda solution? How does this relate to the challenges of making a real artificial pancreas?
  • How could you use the artificial pancreas model you made in this project to model the delivery of other types of medicines? Do some research on this topic and then try it out.
  • How could you make the artificial pancreas model used in this project more similar to what a real artificial pancreas would be like? Do some research and then try to redesign your model.
  • In what other ways could you use the conductivity sensor that is used in this project? Would it make the pump run if it was put in other solutions, such as a sports drink? For some ideas, check out the Science Buddies science project idea Electrolyte Challenge: Orange Juice Vs. Sports Drink.
  • For an advanced chemistry challenge, instead of the chemical reaction used in the artificial pancreas model in this project, you could try using a different chemical reaction. Here are some ideas:
    • You could look into doing a titration (which is typically a color-changing reaction that depends on the exact chemicals involved). A Science Buddies project idea that uses the titration method is Which Orange Juice Has the Most Vitamin C?
    • Alternatively, instead of bromothymol blue as an indicator you could use cabbage juice, which also changes color based on the pH of the solution. For information on how to make this pH indicator solution, check out the Science Buddies project idea Cabbage Chemistry.
  • For science projects on measuring sugars in foods and relating this to diabetes, see How Sweet It Is! Measuring Glucose in Your Food, Sucrose & Glucose & Fructose, Oh My! Uncovering Hidden Sugar in Your Food, and Lactose, Sucrose, and Glucose: How Many Sugars are in Your Smoothie?

Frequently Asked Questions (FAQ)

If you are having trouble with this project, please read the FAQ below. You may find the answer to your question.
Q: The pump will not run. What should I do?
A: If your pump is not running at all, there are several troubleshooting steps you can try:
  • Double-check your circuit to make sure that it matches the breadboard pictures and descriptions from the Procedure exactly (in the "Assembling the Circuit on the Breadboard" section).
  • Make sure all of your jumper wires and other components are pressed firmly into the holes of the breadboard.
  • Make sure your batteries are properly inserted into the battery pack.
  • One at a time, turn the potentiometer all the way clockwise and then all the way counterclockwise.
  • If none of the above steps work, try putting fresh batteries into the battery pack.
Q: How does the circuit work?
A: The circuit relies on two key components: a voltage divider and a MOSFET. We will talk about the voltage divider first. The voltage divider is made from two resistors (R1 and R2) connected in series. Figure 14 shows the circuit diagram for a voltage divider. It takes an input voltage (Vin) and outputs a different voltage (Vout). This is done according to Equation 1 (which can be derived based on Ohm's law).
Circuit diagram for a voltage divider
Figure 14. Circuit diagram for a voltage divider.

Equation 1:

  • Vin is the input voltage in volts (V).
  • Vout is the output voltage in volts (V).
  • R1 is the first resistance in ohms (Ω).
  • R2 is the second resistance in ohms (Ω).

In your circuit, the conductivity sensor (two wires wrapped around a straw) is the first resistor (R1), and the potentiometers (which are connected in series, so add up to form one equivalent resistor) form the second resistor (R2). As you can see from Equation 1, both resistance values have an effect on the output voltage. To help you understand Equation 1, try plugging in a few examples:

  • What happens when R2 is much bigger than R1? In other words, R1 is very small, meaning the solution is highly conductive? (Answer: Vout will be approximately equal to Vin)
  • What happens when R1 is much bigger than R2? In other words, R1 is very large, meaning the solution is not very conductive? (Answer: Vout is close to zero)

If you want to learn more about voltage dividers, check out this reference.

Now let us talk about the second important component of the circuit, a special type of transistor called a MOSFET. (MOSFET stands for metal-oxide-semiconductor field-effect-transistor.) A MOSFET has three pins: the gate, the source, and the drain, as shown in Figure 15. The MOSFET is controlled by a voltage applied to the gate pin. When the voltage between the gate and source pins (VGS) is below the MOSFET's threshold voltage (Vth), no current flows through the MOSFET. When VGS is above the threshold voltage, current can flow from the drain to the source pin. When it is connected to an external load, like a motor or a pump, this means a MOSFET can be used to electronically turn the load on and off, without flipping a mechanical switch.

A simplified diagram shows electricity moving into a MOSFET through the drain lead and out of the source lead
Figure 15. Left: A picture of a MOSFET with the pins labeled. Center: If the gate voltage (VGS) is below the threshold voltage (Vth), no current flows. Right: If the gate voltage is above the threshold voltage, current flows from the drain to the source.

You can read more about MOSFETs at this page. You can also learn more about the specific MOSFET used in this project from its datasheet.

How are these components combined to form the circuit in this project? Figure 16 shows the complete circuit diagram (refer to this How to Read a Schematic resource if you are not familiar with circuit diagrams). The circuit operates like this:

  • The battery pack provides 12 V to power the circuit. This is necessary because the pump is rated for 12 V.
  • The 330 kΩ and 100 kΩ resistors form a fixed voltage divider. This is a crude way of stepping down the 12 V from the battery pack to a lower voltage—in this case, approximately 3 V (the proper way to do this is with something called a voltage regulator). This approximately 3 V is used to power the next part of the circuit (see the next bullet point).
    • Another alternative to using these resistors would be to simply hook up a separate 2xAA battery pack to the circuit to provide 3 V, but the approach used in this project lets the whole circuit run off of one battery pack.
    • Note: This lower voltage is required because the threshold voltage of the MOSFET is rather low, around 1–2 V. Powering the entire circuit from 12 V would therefore make it very difficult to turn the pump off.
  • The conductivity sensor and potentiometers form another voltage divider. The input to this voltage divider (Vin from Equation 1, above) is roughly 3 V, as described in the previous point. The output (Vout from Equation 1, above) is based on the resistance values of the conductivity sensor (which depends on the pH of the liquid) and the potentiometers (which depends on the positions of the knobs). This is what allows you to tune the circuit's sensitivity to pH levels using the potentiometers.
  • The output of the second voltage divider is connected directly to the gate of the MOSFET. The source pin of the MOSFET is connected to ground. This means that the output from the voltage divider is equal to the gate voltage of the MOSFET (Vout = VGS). Therefore, the output of the voltage divider controls whether or not the MOSFET conducts current between its drain and source pins.
  • The pump is connected to the positive voltage supply and the MOSFET's drain pin. As a result, when the MOSFET turns on (because its gate voltage is above the threshold voltage), current flows through the pump and causes it to pump liquid. When the MOSFET is off (because its gate voltage is below the threshold voltage), no current can flow through the pump, so the pump shuts off.
  • Ultimately, this configuration means that the pH of the liquid controls whether the pump turns on or off.
Circuit diagram for an insulin pump
Figure 16. A complete circuit diagram for the artificial pancreas model.
Q: Why does 100 mL of baking soda solution become neutralized when mixed with 100 mL of vinegar used in this project?
A: In this project, you made a baking soda solution with the same concentration, or molarity, as the vinegar so that when equal amounts of vinegar and the baking soda solution are mixed, it makes a neutralized solution. Vinegar generally has a molarity of 0.85 moles/liter (mol/L, or M). To make 200 mL of a solution with a molarity of 0.85 M, there should be 0.17 mol in the solution, since 0.85 mol/L = (0.17 mol)/(0.2 L). Baking soda has a formula mass of 84 grams/mole (g/mol). To get 0.17 mol of baking soda, 14.28 g of it is needed, since 84 g/mol X 0.17 mol = 14.28 g.
Q: Why is my neutral pH not pH 7?
A: In this project, you are mixing a weak acid (vinegar) and a weak base (baking soda) to create a neutralized solution. However, both vinegar and baking soda influence the pH value they will reach when present in equal concentrations and when they are neutralized, called the equivalence point. In distilled water (which itself is slightly acidic), this equivalence point should be between pH 5 and pH 6.
Q: Since pH reactions occur on a logarithmic scale, how does this affect the error in my results?
A: Because pH is the negative logarithm of the concentration of hydrogen ions ([H+]) in a solution (as shown in Equation 2, below), this means that pH reactions change logarithmically. This means that pH error measurements can also be on a logarithmic scale, which can create a margin of error that may seem large (such as having 150 mL of baking soda leftover instead of 100 mL) but that is actually not that large a margin.

Equation 2:

Additions of acids or bases cause a change in the concentration of hydrogen ions in the solution, which causes an equivalent change in pH. You can calculate the relative change in pH by using Equation 2, but instead of [H+] you can use the moles of vinegar you added. For example, in this project you used vinegar with a molarity of 0.85 mol per liter (1000 mL), so in 100 mL of vinegar there is 0.085 mol (since 0.85 mol ÷ 10 = 0.085 mol) and in 150 mL of vinegar solution there is 0.128 mol. The negative logarithm of 0.085 mol equals 1.071 pH units, while the negative logarithm of 0.128 mol equals 0.893 pH units. This gives a difference of 0.178 pH units (since 1.071 - 0.893 = 0.178), which is a more accurate representation of your error, and is much smaller than a difference of 50 mL (which is from 150 mL - 100 mL).

For more information on logarithms and pH, see the University of Minnesota's webpage on What is a logarithm?, Elmhurst College's webpage on pH Scale, and Science Buddies' resource on Acids, Bases, & the pH Scale.


If you like this project, you might enjoy exploring these related careers:

Career Profile
Shakespeare described humans as a "piece of work," and others have called the body "the most beautiful machine," but like any machine, sometimes body parts need repairs or servicing when the body cannot take care of the problems itself. That's where biomedical engineers come in. They use engineering to solve problems in medicine, such as creating replacement body parts, drug-delivery systems, medical instruments, and test equipment. Their work helps restore health and function, and improves the… Read more
Career Profile
Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Career Profile
Everything in the environment, whether naturally occurring or of human design, is composed of chemicals. Chemists search for and use new knowledge about chemicals to develop new processes or products. Read more
Career Profile
Hormones may be small, but they affect our bodies in huge ways. (For example, growth hormone can affect how tall someone grows, and how strong their bones are.) Endocrinologists know this well. Endocrinologists are medical doctors who specialize in diagnosing and treating conditions related to the endocrine system, which secretes small chemicals called hormones. Endocrinologists also investigate ways to improve diagnoses of and treatments for these conditions. Read more
Career Profile
Microwave ovens, cell phones, video game consoles…all the electronics around you are possible due to technology invented by someone. Inventions can take months, even years of hard work and expense. So how does an inventor make sure that no one else steals their inventions? In this case, patent lawyers are the answer. They work within the legal system to help protect an inventor's original works and stop others from illegally profiting from them. Patent lawyers need to be both… Read more

News Feed on This Topic

, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Rowland, Teisha, Svenja Lohner, Ben Finio, and Andrew Bonham. "Dealing with Diabetes: The Road to Developing an Artificial Pancreas." Science Buddies, 18 Mar. 2022, https://www.sciencebuddies.org/science-fair-projects/project-ideas/HumBio_p040/human-biology-health/developing-an-artificial-pancreas. Accessed 8 Aug. 2022.

APA Style

Rowland, T., Lohner, S., Finio, B., & Bonham, A. (2022, March 18). Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/HumBio_p040/human-biology-health/developing-an-artificial-pancreas

Last edit date: 2022-03-18
Free science fair projects.