A project log for Raspberry Pi Glucometer

A programmable glucometer powered by a Raspberry Pi Zero

Jonathan BuchananJonathan Buchanan 08/02/2016 at 21:500 Comments

So now that I've built the breadboard prototype, it's time to test the thing. I considered getting some meter test solution to aid in the testing, but since I am diabetic and accustomed to punching holes in myself, I figured I'd just record one or two data points a day using real blood by testing on my new meter and my reliable commercial one and comparing.

Here is the code I used to record test data (based on the Adafruit ADC example code

import time
import Adafruit_ADS1x15

# Create an ADS1115 ADC (16-bit) instance.
adc = Adafruit_ADS1x15.ADS1115()

GAIN = 4

print('#Press Ctrl-C to quit...')
print('#channel 0 minus channel 1')

count = 0

while True:
    value = adc.read_adc_difference(0, gain=GAIN)

    print(str(count) + ' {0}'.format(value))
    count = count + 0.1
    # Pause for half a second.
So I plugged in a strip and fired up the program, piping the output to a log file. Here are some of my first results:

The X axis is time in seconds and the Y axis is the voltage at the point in the circuit labeled "ADC 0" minus the voltage at the point "ADC 1" in arbitrary units determined by the gain of the amps and the ADC.

I, in my infinite knowledge of electronics, decided it was ridiculous to connect the ground to the negative input on the opamp (Since it is sometimes used with negative voltage). After re-consulting the schematic and making the appropriate modifications to my setup, I tried again.

These graphs look too perfect to not be the right thing, so I looked into calibrating. Based on different papers I've read, and observing commercial meters, the reaction is more proportional a few seconds after the initial spike rather than the actual maximum of the graph.

To clarify, the measurement used to calculate the concentration of glucose should be taken a few seconds after the first reading. I may experiment with different times to see what is the best, but for now I just used 5 seconds.

After collecting a few data points, I put the into a file and graphed them versus actual recorded glucose concentration (Bottom left graph).

Spike in bottom right graph is the result of recording the insertion of a strip.

Not a tremendous number of data points, but I found that shifting the apparatus, even delicately could actually affect the readings. As a result it was hard to collect enough points to get a good graph before the resistance in a tiny connection changed and altered the calibration of the meter.

Regardless though, the actual data (red line) is quite close to the ideal (green line), indicating there is a strong correlation between my meter's output and actual glucose concentration. When I calculated the concentration using the green line shown, my meter differed from the commercial one by between 1 and 5 mg/dL.

The results of the tests are very good. I believe the problems caused by moving the meter will be nullified when the meter is put in PCB form (as nothing will be able to move). I will post another log about the design of the PCB soon.