AVR32 portable wireless medical drip monitoring system

Publisher:平和思绪Latest update time:2013-11-12 Source: eefocusKeywords:Atmel  AVR32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction  

Intelligence and portability are the development trends of modern electronic products. The intelligence of medical electronics makes the operation of medical staff more convenient. Medical staff can carry a handheld monitor to monitor the drip in each ward in real time and keep abreast of relevant situations. In case of emergencies such as the drip falling below the set warning value, the terminal monitoring device can generate an interrupt signal, and the main control end can give priority to corresponding processing. This design implements a portable remote wireless drip monitoring system with AT32UC3A0512[1] microcontroller as the main controller, which can keep track of the drip status in time and improve the safety of medical drip equipment.

1 System Principle Introduction  

This system mainly consists of two parts: a handheld control terminal and a terminal monitoring device. The handheld control terminal mainly realizes the operation of information input and query interface. By inputting the ward number and drip speed value to be queried, it is sent to the corresponding ward monitoring terminal in the form of a data packet, and the drip status data information transmitted by the terminal is displayed in real time. The terminal monitoring device is mainly responsible for the data collection and processing of the drip status (drip flow rate and drip level, etc.), and sends the processed data to the main control terminal through wireless communication; for emergency events such as the drip level is lower than the set value and the patient calls, it is processed according to the interrupt mode, an alarm prompt is issued, and the event type is sent to the main control terminal in the form of a data packet. The structural block diagram of the system is shown in Figure 1.

Figure 1 System structure diagram

2 System Hardware Design

2.1 Hardware design of the control end  

The handheld control terminal uses Atmel's 32-bit RISC processor AT32UC3A0512 as the main controller [1]. It has low power consumption and high throughput. It has 512K Flash and 64K SRAM internally, and the CPU operating frequency can reach up to 66 MHz. At 3.3 V, the operating current is about 40 mA, and the standby current is only 30 μA. The highly integrated internal hardware resources can simplify the design of peripheral circuits. For example, the internal Flash, USB, ADC, EBI and Ethernet peripheral interfaces are available for designers to use.

2.1.1 Touch button module  

The capacitive touch key module IC QT1801 from Quantum Research Group [2] is adopted, which has the characteristics of low power consumption, simple peripheral circuit, and can support 8 touch key inputs at the same time. After internal filtering and shaping, the logic level is output at the corresponding key port. According to the different peripheral resistance values, the various modes of IC QT1801 can be set. The working mode is set as follows: In the full option mode, a 1 MΩ resistor needs to be connected to the pin SNSx (x=0, 1, ..., 7); in the simplified mode, a 1 MΩ resistor needs to be connected in series between the pins SNS6K and SNS7. There are two types of key output value modes: Oneperkey and Binary Code. When a key is touched, a touch interrupt signal is generated at pin 24 (DETECT), and the high level is valid. Among them, CS1~CS5 are touch key inputs, and its interface circuit is shown in Figure 2.

Figure 2 Touch button module circuit diagram

2.1.2 LCD Display Module  

The display part uses the LCD display module ET024006DHU from EDT. The LCD module integrates the graphic control driver HX8347A. The MCU can read/write its internal registers through two interface modes to control the LCD display, namely parallel interface mode and SPI interface mode. In the parallel interface mode, 8/16-bit data and 16/18-bit RGB data can be selected. In the serial SPI interface mode, 8/16-bit data and 16/18-bit RGB data can be directly written into the internal register. [page]

2.1.3 Wireless communication module nRF24L01[3]  

The wireless communication part uses a single-chip RF transceiver chip, and its operating frequency band is the world's universal ISM band (2.4-2.5 GHz). It is a true GFSK single transceiver chip. It has a built-in link layer, with automatic response and automatic retransmission functions, and supports address and CRC verification functions. It has extremely low current consumption, and the current consumption is even lower in power-off and standby modes; the data transmission rate can reach up to 2 Mbps, and the built-in standard SPI interface can transmit data with the MCU at a rate of up to 8 Mbps; it can work in 125 optional channels. In the receiving mode, it can simultaneously receive data from 6 data channels working on the same channel, and the data channels of the transceivers that communicate with each other are set to the same address.  

By reading/writing the internal registers of nRF24L01, the conversion of its working state and the reception and transmission of data are controlled. When the transceiver data reception/transmission is completed or an abnormality occurs, the IRQ pin generates an interrupt signal, which is valid at a low level. The corresponding bit of the STATUS register is written as "1" to clear the interrupt flag. The hardware connection of the wireless communication module is shown in Figure 3.

2.2 Terminal monitoring device hardware design  

The terminal monitoring device uses an ATmega128 single-chip microcomputer, which mainly receives command data sent by the control terminal, processes the collected data and sends it to the control terminal, completing functions such as patient calling, liquid level monitoring, detection and control of drip speed, and sound alarm.

2.2.1 Infusion speed control module  

The drip speed control circuit uses a dedicated stepper motor control chip L297 and a dual full-bridge stepper motor driver chip L298. The PWM chopper circuit inside the L297 can generate PWM waves in the switching mode to control the current in the motor winding, thereby controlling the precise rotation of the motor; the 4-phase control signal it generates can be used to control two-phase bipolar and four-phase unipolar stepper motors. L298 contains an HBridge high-voltage, high-current dual full-bridge driver. The 4-way drive circuit can drive a two-phase or four-phase stepper motor below 46 V and 2 A, and can realize the forward and reverse rotation of the stepper motor. The sliding of the flow rate clamp roller of the drip device is controlled by accurately controlling the forward and reverse rotation of the motor to achieve the purpose of controlling the drip drip speed. The hardware connection diagram is shown in Figure 4.

Figure 3 Wireless module hardware diagram

Figure 4 Drip speed control circuit diagram

2.2.2 Drip speed and liquid level detection module  

The dripping speed is measured by the infrared pair tube emission method. The dripping detection circuit includes three parts: infrared emission, reception, and pulse shaping. The hardware schematic diagram is shown in Figure 5. ST1150 is a single light speed direct infrared photoelectric sensor with a slit width of 1.5 mm and an optical axis center of 2.5 mm. The infrared detection area is small. When no droplets pass through, the receiving tube (the triode inside ST1150) is turned on and Vin is at a low level; when a droplet passes through, the receiving tube is turned off and a high level pulse is generated at Vin. After being shaped by the Schmitt trigger, a series of regular square wave pulses are generated at Vout and sent to ATmega128 for processing.

Figure 5 drip speed detection circuit  

Liquid level detection uses a reflective infrared sensor, and the circuit detection principle circuit is similar to the dripping speed detection circuit. ST198 is a reflective photoelectric sensor composed of a high-transmitting power infrared photodiode and a high-sensitivity phototransistor. It uses a non-contact detection method and can be used when the detection distance is 2 to 10 mm. When the liquid level is lower than the set value, the receiving tube receives a level signal, which is sent to the microcontroller after being inverted by the inverter to trigger an interrupt. When the infrared emitting tube is ST1150, it is used for dripping speed detection, and when it is ST198, it is used for liquid level detection.

3 System Software Structure

(1) Data frame structure  

Define a communication data frame structure to manage the communication between the control end and the device. By parsing the data frame, the master/slave device can complete data processing efficiently. According to the order of communication transmission, the format of the data frame is: command (1 byte) + device ID (1 byte) + event type (1 byte) + data field length (1 byte) + data field (n bytes) + checksum (2 bytes).

(2) Porting of μC/OSII  

μC/OSII is an open source, structured, scalable, and removable real-time kernel RTOS. Most of its code is in C language, which is highly portable and has been ported to various CPU series. AVR Studio 5 integrates the Software Framework software package, which includes Atmel MCU interface driver functions. In the AVR Studio 5 environment, porting μC/OSII to AT32UC3A0512 MCU requires the following modifications in the Micrium official porting example:

① Modify the contents of the exception.S file as follows:

_handle_Supervisor_Call:

lddpcpc,__OSCtxSw

__OSCtxSw:.

longOSCtxSw

② Modify the content of cpu.h as follows:

#define CPU_CRITICAL_ENTER()   

{cpu_sr = CPU_SR_Save();}

#define  CPU_CRITICAL_EXIT()

{CPU_SR_Restore(cpu_sr);}

#define CPU_SR_Save()cpu_irq_save()

#define CPU_SR_Restore(cpu_sr)

cpu_irq_restore(cpu_sr)[page]

#define CPU_IntDis()Enable_global_interrupt()

#define CPU_IntEn()Disable_global_interrupt()

#define CPU_ExceptDis()Disable_global_exception()

#define CPU_ExceptEn()Enable_global_exception()

#define CPU_Reset()Reset_CPU()

Figure 6: Software structure of the main control terminal

(3) Controller software design  

The software structure under the μC/OSII system is shown in Figure 6.  

The main control terminal mainly completes the user's operation through the LCD interface. The 5 touch keys are interface operation keys, and the numeric keyboard is implemented by software. Enter the ward number to be queried through the numeric keyboard, and after confirmation, you can query the speed, remaining amount and other status of the drip in the ward.  

The switching relationship of the interface menu is realized by defining a structure, which is defined as:

typedef struct MenuItem{  

U8 MenuNum; //Number of menu items on this layer  

U8 *DispStr; //Display string  

struct MenuItem *ChildrenMenus; //Submenu node  

struct MenuItem *ParentMenus; //parent menu node

} Menu;

(4) Terminal monitoring software design  

The terminal receives the command data packet sent by the control end, parses the command, performs corresponding processing, and packages the processed data and sends it to the control end. The software flow of the terminal control part is shown in Figure 7.

Figure 7 Terminal main program

Conclusion  

The embedded system based on AVR32MCU and μC/OSII uses wireless communication to realize remote online monitoring. The establishment of a wireless network enhances the mobility of the system. This paper proposes a design of a portable drip monitoring system based on AVR32, which miniaturizes the medical drip monitoring device and makes the system stable within a short range. Due to limited resources, the establishment of a network for remote control is still under further exploration.

Keywords:Atmel  AVR32 Reference address:AVR32 portable wireless medical drip monitoring system

Previous article:Research on Mobile Robot Positioning System Based on ATmega16 and PC
Next article:Design of campus electronic patrol system

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号