Design of multifunctional blood glucose meter based on MSP430 series microcontroller

Publisher:csZhouLatest update time:2011-12-20 Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

There are many types of blood glucose meters on the market, with various shapes and structures, but the prices and accuracy are very different; and it is difficult to have both price and accuracy. The reason is that there is no suitable microprocessor. In addition, due to the limitation of screen size, the interface generally uses English characters to display, which brings some confusion to Chinese patients.

With the development of electronic technology, the functions of microprocessors are becoming increasingly powerful and the prices are becoming increasingly lower. It is necessary to select a powerful and inexpensive microprocessor to redesign the blood glucose meter. The MSP430 series microprocessor selected in this system makes the above idea possible.

Principle

The blood glucose meter is designed based on the principle of electro-biochemistry - the current generated by applying a certain voltage to the blood after the enzyme reaction will increase as the blood glucose concentration in the blood increases. By accurately measuring these weak currents and calculating the corresponding concentration based on the relationship between the current value and the blood glucose concentration. Therefore, determining this relationship is the core of the problem. However, the relationship is complex and is affected by many factors. The voltage intensity, the test strips used, and the amount of blood tested will all have an impact on it. In theory, a large number of experiments are required at all concentration points to determine the final relationship. In actual operation, it is only necessary to select a number of important concentration points for a large number of experiments and determine the relationship between them and the current value. The adjacent concentration points are replaced by simple linear relationships. Figure 1 is the relationship curve summarized by this design under a certain amount of voltage.

System Hardware Design

According to the actual needs of the blood glucose meter and the characteristics of the MSP430 series microcontrollers, the MSP430F435 microcontroller is used as the control core. Other modules include current detection, key input and power supply, display, speaker and serial communication, etc. As shown in Figure 1.


Figure 1 System composition

MSP430F435 microcontroller

The microcontroller MSP430F435 used in this system has 16Kb Flash memory, 512B RAM, up to 160-segment LCD driver, 8-channel/12-bit ADC and a large number of I/O ports, which fully meets the functional requirements of this blood glucose meter.


Figure 2 Microprocessor port settings
[page]

The main port settings are shown in Figure 2. Among them, COM0~COM3, S16~S39, R03~R33 are used to realize LCD display; Port74 and Port75 are used for serial communication; Port79~Port81 are the input terminals of the buttons; Port76 and Port77 provide power supply voltage for the operational amplifier and RS-232 chip respectively. Port78 connects to the buzzer; Port2 and Port3 are ADC inputs; Port7 reference voltage output; XOUT and XIN connect to the 32KHz crystal oscillator, which is the clock source of the system.

LCD display

MSP430F435 has a liquid crystal drive function, which can support up to 160 segments of LCD and has the characteristics of low power consumption. This system uses an LCD display with a Chinese interface, which is also a major feature of this blood glucose meter. This LCD has 96 code segments, rich content and powerful functions. It greatly facilitates the use of domestic patients.

Blood glucose detection

It is already known from the principle that a certain voltage needs to be applied to the corresponding electrode when measuring blood glucose, and the stability of the voltage will directly affect the measurement result. Therefore, it is considered to be obtained from a relatively stable reference voltage instead of directly from the power supply.

The A/D of the MSP430 microcontroller samples the voltage value, while the detected value is a small amount of current; therefore, the current value needs to be amplified and converted into a corresponding voltage value. This requirement can be achieved by using the circuit shown in Figure 3. Among them, the resistor R is used for amplification. In addition, too little blood will also cause deviation in the results; therefore, it is necessary to design a simple circuit for detecting whether the blood is sufficient. This circuit can be completely replaced by the same circuit as Figure 3. Therefore, blood glucose measurement can be achieved by using two such circuits.


Figure 3 Amplification circuit

Other modules

The power supply voltage of this system is 3V, and two batteries are used. One is the main power supply; the other is a backup so that the device can still work normally when the battery is replaced. There are

three buttons, namely the left button, the right button and the OK button; the OK button is mainly used for power on, power off and confirmation, the left button is used for number reduction or option left shift, and the right button is the opposite of the left button.

Since there are a large number of measurement results stored in the blood glucose meter, it is necessary to add a serial communication function to upload these results to the PC for further processing. The microcontroller itself has a serial communication interface, and it only needs to convert the TTL level into the RS-232 level; the SP3232 chip is used here to achieve this function. The SP3232 chip requires a low power supply voltage and is suitable for portable device applications. The connection of its peripheral circuit is simple, and only a few 0.1µF capacitors are required.

System software design

The system software is written in C language. Its main program framework is shown in Figure 4.



Figure 4 Main program flowchart

[page]

For portable devices, battery life is critical; power consumption should be minimized during design so that the system can stay in a low-power state for as long as possible. Therefore, consider automatically shutting down the device at the appropriate time. A timer is used here. When the timer is greater than 0, the system is in the power-on state; when the timer counts down to 0, the system automatically shuts down. This timer is implemented by the Basic Timer in the microcontroller. The Basic Timer control register is set by software, the signal source is set to the auxiliary clock, the size is 32KHz, and it is divided by 256, and then the interrupt timing interval control bit is set so that the interrupt is performed once per second, and each time it comes, the timer is decremented by 1, thus realizing the function of decrementing the timer by 1 per second. The specific operation is as follows: when the machine is turned on, the timer is initialized to a value greater than 0, such as 30, and the system reinitializes this value every time a valid key is pressed. Therefore, when no valid key is pressed, it will automatically shut down after 30 seconds, thereby achieving the purpose of power saving.

The system also has a real-time clock function, and its implementation method is similar to the above-mentioned timer. Just change "minus 1 per second" to "plus 1 per second"; specific operation: add 1 to the second variable every interruption, when the value of the second variable becomes 60, add 1 to the minute variable, and the second variable starts counting from 0 again; similarly, when the minute variable accumulates to 60, add 1 to the hour variable, and it starts counting from 0 again. By analogy, the real-time clock and date functions can be realized.

In order to meet personalized needs, clock and unit settings, average value and temperature display functions are also added. I will not go into details here. The following mainly introduces the measurement module. First, initialize each port and ADC register; then wait for blood to drip. When sufficient blood is detected, turn off the power and wait for several seconds to allow it to fully react with the enzyme on the test strip. Then power on and read quickly after one second. Figure 5 is a curve of the current change generated by the test strip used in conjunction with this blood glucose meter after several seconds of reaction between blood glucose and enzyme at different concentrations and then power on. It is not difficult to see from the figure that the curve is relatively stable one second after power on, which is why this design uses "power on for one second" to read.

Calculation formula

This part is undoubtedly the key to this design. Table 1 is part of the data measured using the prototype of this design. It is not difficult to see from the data in the table that the measurement repeatability of the blood glucose meter and blood glucose test strips is good - CV <3%, which is far higher than the national standard requirement of <7.5%.

Table 1 Some experimental data

Concentration (mg/dl)
Current (µA) 50 100 200 300 400
1 3.003 6.752 13.101 16.861 19.836
2 3.028 6.678 12.368 17.130 19.621
3 2.918 6.800 13.272 16.764 20.366
4 2.893 6.910 13.028 17.179 20.622
5 3.064 7.081 13.614 17.574 20.341
6 2.881 7.106 13.211 17.264 20.268
7 3.075 6.703 12.905 17.628 19.645
8 2.905 6.849 13.150 17.029 20.158
9 2.991 7.130 13.233 17.081 20.024
10 2.901 7.240 12.964 16.838 20.952
Mean 2.9659 6.9249 13.0846 17.1348 20.1833 MSD
0.0746 0.2001 0.3200 0.2924 0.4218
CV (%) 2.5153 2.8896 2.4456 1.7065 2.0898By

fitting the data in cubic curve, we can get the relationship curve between blood glucose value and current value. Figure 6 is a comparison of the original data segmented curve and the fitted curve. It is easy to see that the two curves are very consistent; therefore, in actual operation, a formula can be used to replace the segmented function. The curve formula here is:

Where X is the current value, unit is µA, and Y is the corresponding blood glucose value, unit is mg/dl. In the actual verification process, the above formula has good accuracy.



Figure 5 Comparison of data segmentation curve and fitting curve

Conclusion

This blood glucose meter uses MSP430F435 as its core control unit, which has 12-bit A/D conversion; the sampling accuracy reaches 1/4096. In addition to the basic functions, the system also adds alarm reminders and serial communication functions, so that users can not only measure at regular intervals, but also save the measurement results to the PC through the serial port, and then further process the data through the corresponding software. The formula summarized in this article has been clinically proven to have good accuracy. In addition, the Chinese character interface also greatly facilitates user use.

Keywords:MSP430 Reference address:Design of multifunctional blood glucose meter based on MSP430 series microcontroller

Previous article:Development of Digital Sine Machine Based on MCS-96 Series Single Chip Microcomputer
Next article:Design of Fiber Bragg Grating Demodulator Based on Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 17:49

Notes on C language programming for MSP430
================================================== ================================================== ========================== Microprocessors are generally used in specific environments and for specific purposes. Considering cost, power consumption and size, it is generally required to save resources as much as pos
[Microcontroller]
MSP430 serial port transceiver program
/************************************************ ***** Program function: Receive hexadecimal data from PC and transmit it back to PC Data format: Hexadecimal Frame header: FD Frame end: FE *************************************************** *****/ #include msp430x14x.h unsigned char RecBuf ; //Receive dat
[Microcontroller]
Design of weighing liquid level meter based on MSP430 single chip microcomputer
1 Introduction The liquid level measurement and control instrument is a type of intelligent instrument (referring to instruments that use microprocessors), and its development began in the 1970s . It is an intelligent product that integrates measurement and control, and is suitable for the liquid level meas
[Industrial Control]
Design of weighing liquid level meter based on MSP430 single chip microcomputer
MSP430 Learning Notes (4) ADC12
A few terms:   a) Resolution (LSB): It indicates the change in input analog voltage required for the output digital quantity to change by one adjacent digital number. It is defined as the full-scale voltage of the converter and 2 to the power of n, where n is the number of bits of the ADC. b) Quantization er
[Microcontroller]
MSP430 Learning Notes (4) ADC12
msp430f2272 control 1602LCD
#include "io430.h" #define uchar unsigned char; #define uint unsigned int; int ch1 ={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00,0x81,0x42,0x24,0x18 ,            0x00,0x18,0x24,0x42,0x81,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,            0x00,0x30,0x00,0x03,0x00,0x70,0x00,0x07,0x00,0xf0,0x00 ,0x0f ,0x00,       
[Microcontroller]
Design of programmable filter based on MSP430 and MAX262
In electronic systems, filters are an indispensable and important link in data acquisition and signal processing, such as noise filtering before signal acquisition, "ladder-shaped" filtering of D/A conversion output, etc. The general active filter is composed of operational amplifiers and RC components, but the paramet
[Microcontroller]
Design of programmable filter based on MSP430 and MAX262
Design of serial communication between MSP430 microcontroller and PC based on VB6.0
  Serial communication has become the most widely used communication method for data exchange between computers and other devices. This paper mainly introduces how to use the serial communication module of MSP430 microcontroller and the serial communication control MSComm provided by VB6.0 to realize serial communicat
[Microcontroller]
Design of serial communication between MSP430 microcontroller and PC based on VB6.0
MSP430 serial port receiving and sending interrupt program
MSP430 serial port receiving and sending interrupt program F149 #include msp430x14x.h unsigned char RecBuf ; //Receive data bufferunsigned char *SDat;        //Point to the data to be sentunsigned char Rindex;          //Receive data countunsigned char Tindex;          //Send data countunsigned
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号