The artificial pancreas is the latest version of a device that researchers have been refining for several years. The system consists of an iPhone 4S with an attached glucose monitoring device, two pumps, and reservoirs for insulin and glucagon.

A sensor implanted under the skin on one side of the patient’s abdomen measures the glucose in the fluid between the cells, which corresponds closely to blood glucose levels. The sensor delivers the reading to the smartphone, and the phone’s software calculates a dose of insulin and glucagon every five minutes.

The medicine is then pumped through thin tubes to two tiny infusion points embedded just under the skin on the other side of the patient’s abdomen.

The phone also has an app with which a patient can enter information immediately before eating, indicating whether the meal is breakfast, lunch or dinner, and whether the carbohydrate content will be small, large or typical. The device then calculates and dispenses the proper dosages.

The device still requires a finger stick twice a day to get an accurate blood reading, which the patient enters into the phone.

The developers tested the device over five days in two groups of patients, 20 adults and 32 adolescents, comparing the results with readings obtained with conventional insulin pumps that the participants were using.

The adults in the trial each had the constant attention of a nurse, and they lived in a hotel for the five-day study. Most of the time they were free to travel around and pursue normal activities.