Design of Wireless ECG Monitoring System Based on C8051 Single Chip Microcomputer

Publisher:科技创造者Latest update time:2009-10-21 Source: 国外电子元器件Keywords:C8051F320 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the rapid development of economy and the continuous improvement of people's living standards, health has become the focus of people's attention. Heart disease is a major killer that endangers human health. Its accidental and sudden characteristics make ECG monitoring system have important clinical application value. Since traditional ECG monitors cannot perform real-time monitoring at a distance, portable wireless ECG monitoring system becomes more important. Wireless medical monitoring system mainly consists of physiological information and data acquisition, wireless data communication, control and display units. At present, there are wireless ECG monitoring products for clinical use in China, but most of them adopt "collector + transmitter (PDA or mobile phone)", which is expensive in terms of cost; from the perspective of wireless transmission, most of them transmit ECG data as analog signals, which will inevitably lead to signal distortion during transmission. In addition, due to the difference in human body resistance, ECG signals vary between 1 and 10 mV, and fixed amplification systems lack adaptability.

Based on this, a wireless monitoring system based on C8051F320 single chip microcomputer is proposed here. The system consists of two parts: data acquisition box and PC monitoring terminal. The design of the data acquisition box fully considers its small size, low power consumption and fast operation requirements, so all SMT packaged components are used; the PC monitoring terminal receives data through USB. VC++ is used to write functional programs such as display, storage, analysis and processing, and alarm. The experimental results show that the system can meet the patient's activities within a range of 100 m, and can select the appropriate magnification according to different patients; because the ECG signal is sent after being processed by the MD converter in the data acquisition box, the signal has a stronger anti-interference ability.

2 System Hardware Design

2.1 Overall system composition

The system consists of two parts: a data acquisition box and a PC monitoring terminal, as shown in Figure 1. The data acquisition box uses the C8051F320 microcontroller as the core to collect ECG data and control the programmable amplifier, and uses the NRF24L01 module to send and receive data to communicate with the PC monitoring terminal. The C8051F320 microcontroller in the PC monitoring terminal receives ECG data through the NRF24L01 module and sends the data to the PC through its own USB interface.

The system consists of two parts: data acquisition box and PC monitoring terminal

2.2 ECG acquisition and programmable amplifier circuit

ECG signals are weak signals. Due to individual differences, the measurement amplitude range of surface ECG signals is 1 to 10 mV. There is strong interference when measuring ECG signals, including the DC polarization voltage generated by the chemical half-battery formed between the measuring electrode and the human body; 50Hz power frequency interference in the form of common-mode voltage; baseline drift caused by human movement and breathing; myoelectric interference caused by muscle contraction, etc. In view of polarization voltage and myoelectric interference, HOLTER telemetry three-lead connection and disposable ECG electrodes are used to contact the human body. The disposable ECG electrodes are made of silver chloride and medical pressure-sensitive adhesive, which can effectively reduce myoelectric interference. The existence of common-mode interference requires the preamplifier to have an extremely high common-mode rejection ratio (CMRR), not less than 80 dB. According to the above requirements, the front-end amplifier uses an instrument AD620 amplifier with an amplification factor of about 50 times; at the same time, in order to suppress the influence of baseline drift and high-frequency noise, the back-end circuit uses a 0.05-100 Hz bandpass filter to further process the signal, and then the signal is processed again through a 50 Hz notch circuit.

In order to make full use of the accuracy of A/D conversion, the signal is amplified to about 70% of the reference voltage of the A/D converter circuit before conversion. Considering the additional DC component in the signal, a level adjustment circuit needs to be added before the A/D conversion circuit. The difference in individual ECG amplitude requires the design of a programmable amplifier circuit in the circuit. In order to facilitate the calibration of ECG signals and consider the deviation between the actual device amplification factor and the theoretical value, a manually adjustable amplifier circuit (1 to 10 times) is set before the programmable amplification. Based on the above analysis, the ECG acquisition and programmable amplification part should include: AD620 front-end amplification, 0.05 to 100 Hz bandpass filtering, 50Hz notch, manual amplification, programmable amplification and level boosting circuits, as shown in Figure 2. The realization of the programmable amplification function mainly utilizes the digital gating function of the CD4051 electronic switch, which can achieve an adjustment range of 1 to 50 times.

ECG acquisition and programmable amplification part

2.3 NRF24L01 wireless transmitter circuit

NRF24L01 is a single-chip RF transceiver device that operates in the 2.4-2.5 GHz ISM band, with an operating voltage of 1.9-3.6 V and up to 125 channels to choose from. Through SPI writing data, the rate can reach up to 10 Mb/s, the data transmission rate can reach up to 2 Mb/s, and it has automatic response and automatic retransmission functions. Compared with the previous generation NRF2401, NRF24L01 has a faster data transmission rate, a higher data writing speed, and more complete embedded functions. The device has built-in frequency synthesizer, power amplifier, crystal oscillator, modulator and other functional modules, and integrates enhanced ShockBurst technology, in which the output power and communication channel can be configured through the program. The device has very low energy consumption, with a power transmission current of only 9 mA at -6 dBmW, and a working current of only 12.3 mA when receiving. Multiple low-power working modes (power-down mode and idle mode) make energy-saving design more convenient. Combined with the internal resources of C8051F320. The built-in SPI interface is used to control the reading and writing of NRF24L01, which saves hardware resources and facilitates software writing. Figure 3 shows the wireless transmission control circuit.

Wireless transmission control circuit

2.4 PC monitoring terminal design

C8051F320 integrates full-speed/low-speed USB function controllers for external devices that implement USB interfaces (cannot be used as USB host devices). The USB function controller (USB0) consists of a serial interface engine (SIE), a USB transceiver (including matching resistors and configurable pull-up resistors), a 1 KB FIFO memory, and a clock recovery circuit (crystals are not required), without the need for external components. The USB function controller and transceiver comply with the Universal Serial Bus Specification Version 2.0. The single-chip microcomputer in the monitoring terminal also uses C8051F320, and the wireless receiving part is the same as Figure 3. C8051F320 communicates data with the PC through its own USB interface (see Figure 1).

1 Introduction

With the rapid development of economy and the continuous improvement of people's living standards, health has become the focus of people's attention. Heart disease is a major killer that endangers human health. Its accidental and sudden characteristics make ECG monitoring system have important clinical application value. Since traditional ECG monitors cannot perform real-time monitoring at a distance, portable wireless ECG monitoring system becomes more important. Wireless medical monitoring system mainly consists of physiological information and data acquisition, wireless data communication, control and display units. At present, there are wireless ECG monitoring products for clinical use in China, but most of them adopt "collector + transmitter (PDA or mobile phone)", which is expensive in terms of cost; from the perspective of wireless transmission, most of them transmit ECG data as analog signals, which will inevitably lead to signal distortion during transmission. In addition, due to the difference in human body resistance, ECG signals vary between 1 and 10 mV, and fixed amplification systems lack adaptability.

Based on this, a wireless monitoring system based on C8051F320 single chip microcomputer is proposed here. The system consists of two parts: data acquisition box and PC monitoring terminal. The design of the data acquisition box fully considers its small size, low power consumption and fast operation requirements, so all SMT packaged components are used; the PC monitoring terminal receives data through USB. VC++ is used to write functional programs such as display, storage, analysis and processing, and alarm. The experimental results show that the system can meet the patient's activities within a range of 100 m, and can select the appropriate magnification according to different patients; because the ECG signal is sent after being processed by the MD converter in the data acquisition box, the signal has a stronger anti-interference ability.

2 System Hardware Design

2.1 Overall system composition

The system consists of two parts: a data acquisition box and a PC monitoring terminal, as shown in Figure 1. The data acquisition box uses the C8051F320 microcontroller as the core to collect ECG data and control the programmable amplifier, and uses the NRF24L01 module to send and receive data to communicate with the PC monitoring terminal. The C8051F320 microcontroller in the PC monitoring terminal receives ECG data through the NRF24L01 module and sends the data to the PC through its own USB interface.

The system consists of two parts: data acquisition box and PC monitoring terminal

2.2 ECG acquisition and programmable amplifier circuit

ECG signals are weak signals. Due to individual differences, the measurement amplitude range of surface ECG signals is 1 to 10 mV. There is strong interference when measuring ECG signals, including the DC polarization voltage generated by the chemical half-battery formed between the measuring electrode and the human body; 50Hz power frequency interference in the form of common-mode voltage; baseline drift caused by human movement and breathing; myoelectric interference caused by muscle contraction, etc. In view of polarization voltage and myoelectric interference, HOLTER telemetry three-lead connection and disposable ECG electrodes are used to contact the human body. The disposable ECG electrodes are made of silver chloride and medical pressure-sensitive adhesive, which can effectively reduce myoelectric interference. The existence of common-mode interference requires the preamplifier to have an extremely high common-mode rejection ratio (CMRR), not less than 80 dB. According to the above requirements, the front-end amplifier uses an instrument AD620 amplifier with an amplification factor of about 50 times; at the same time, in order to suppress the influence of baseline drift and high-frequency noise, the back-end circuit uses a 0.05-100 Hz bandpass filter to further process the signal, and then the signal is processed again through a 50 Hz notch circuit.

In order to make full use of the accuracy of A/D conversion, the signal is amplified to about 70% of the reference voltage of the A/D converter circuit before conversion. Considering the additional DC component in the signal, a level adjustment circuit needs to be added before the A/D conversion circuit. The difference in individual ECG amplitude requires the design of a programmable amplifier circuit in the circuit. In order to facilitate the calibration of ECG signals and consider the deviation between the actual device amplification factor and the theoretical value, a manually adjustable amplifier circuit (1 to 10 times) is set before the programmable amplification. Based on the above analysis, the ECG acquisition and programmable amplification part should include: AD620 front-end amplification, 0.05 to 100 Hz bandpass filtering, 50Hz notch, manual amplification, programmable amplification and level boosting circuits, as shown in Figure 2. The realization of the programmable amplification function mainly utilizes the digital gating function of the CD4051 electronic switch, which can achieve an adjustment range of 1 to 50 times.

ECG acquisition and programmable amplification part

2.3 NRF24L01 wireless transmitter circuit

NRF24L01 is a single-chip RF transceiver device that operates in the 2.4-2.5 GHz ISM band, with an operating voltage of 1.9-3.6 V and up to 125 channels to choose from. Through SPI writing data, the rate can reach up to 10 Mb/s, the data transmission rate can reach up to 2 Mb/s, and it has automatic response and automatic retransmission functions. Compared with the previous generation NRF2401, NRF24L01 has a faster data transmission rate, a higher data writing speed, and more complete embedded functions. The device has built-in frequency synthesizer, power amplifier, crystal oscillator, modulator and other functional modules, and integrates enhanced ShockBurst technology, in which the output power and communication channel can be configured through the program. The device has very low energy consumption, with a power transmission current of only 9 mA at -6 dBmW, and a working current of only 12.3 mA when receiving. Multiple low-power working modes (power-down mode and idle mode) make energy-saving design more convenient. Combined with the internal resources of C8051F320. The built-in SPI interface is used to control the reading and writing of NRF24L01, which saves hardware resources and facilitates software writing. Figure 3 shows the wireless transmission control circuit.

Wireless transmission control circuit

2.4 PC monitoring terminal design

C8051F320 integrates full-speed/low-speed USB function controllers for external devices that implement USB interfaces (cannot be used as USB host devices). The USB function controller (USB0) consists of a serial interface engine (SIE), a USB transceiver (including matching resistors and configurable pull-up resistors), a 1 KB FIFO memory, and a clock recovery circuit (crystals are not required), without the need for external components. The USB function controller and transceiver comply with the Universal Serial Bus Specification Version 2.0. The single-chip microcomputer in the monitoring terminal also uses C8051F320, and the wireless receiving part is the same as Figure 3. C8051F320 communicates data with the PC through its own USB interface (see Figure 1).

3 System Software Design

3.1 Data acquisition box program design

The data acquisition box is based on the C8051F320 microcontroller, which is a fully integrated mixed-signal system-on-chip MCU with the following features: (1) a high-speed, pipelined 8051-compatible microcontroller core (up to 25 MI/s); (2) a full-speed, non-intrusive in-system debug interface (on-chip); (3) a universal serial bus (USB) function controller with 8 flexible endpoint pipelines, integrated transceivers, and 1 KB FIFO RAM; (4) a true 10-bit 200 ks/s 17-channel single-ended/differential A/D converter with analog multiplexer; and (5) hardware-implemented SMBus/I2C, enhanced UART, and enhanced SPI serial interfaces.

Analysis and determination of acquisition parameters: (1) ECG energy is mainly distributed between 0.05 and 100 Hz. According to the sampling theorem, the sampling frequency of the A/D converter should be greater than 200 Hz. Considering the high sampling speed and low power consumption of the A/D converter, its sampling rate is set to 2000 Hz; (2) Since the sampling time of the A/D converter is not equal each time, the TIME2 timer is used to trigger each sampling cycle; (3) In order to improve the transmission speed and data transmission efficiency and meet the requirements of low power consumption, the NRF24L01 is set to data block transmission mode, and wireless data transmission is initiated every 32 sampling points; (4) The SPI port in C8051 F320 is set to 4-wire master mode, and the SPI of NRF24L01 is slave mode. This not only meets the real-time sampling requirements, but also makes full use of hardware resources and energy. Figure 4 shows the software flow of the data acquisition box.

Data acquisition box software process

3.2 PC monitoring terminal software design

3.2.1 C8051F320 firmware program

The MCU and NRF24L01 exchange data through the SPI interface, and the USB is set to block transmission mode for data communication with the PC. In order to be compatible with the data acquisition box, every 32 data are still packaged into a data packet, which can also make full use of hardware resources and improve data transmission efficiency. Its flow chart is similar to that of the data acquisition box.

3.2.2 PC software design

The PC software is written in VC++6.0. VC++6.0 integrates the MFC development environment, which provides rich interface functions and a high degree of transparency. The interface writing is flexible and convenient. At the same time, most hardware developers provide standard C++ interface functions for customers to use. DLL is also the convenience of VC++. It is a device based on Windows programming. The control part of the USB communication interface is realized by calling the SIXUSB.DLL dynamic link library; the display part calls: library functions provided by MFC such as Lineto(), Moveto(), etc., and data storage is stored in the form of data stream; calling SetTimer(1, 0, NULL) generates a clock interrupt message every 1 ms to facilitate timely update of data display. Since the USB mode is set to block data transmission mode, the PC reading speed must be greater than the data acquisition box acquisition speed to ensure that the data packet is not lost. Therefore, 128 bytes are pre-read each time, and then the actual amount of data read is determined and placed in the data storage address for display. The specific process is shown in Figure 5.

Specific process

4 Online debugging and data recording

4.1 Debugging of data acquisition box

Add a 10 mV, 70 Hz sine wave signal to the ECG signal input, set the gain of the program-controlled amplifier to 1, observe the waveform at the input of the A/D converter, adjust the adjustable resistor on the manual amplifier to make the gain of the entire circuit 200 times, so that the signal amplitude at the A/D converter should be 1 V; set the oscilloscope to DC mode, and adjust the level-raising circuit until the center line of the signal is around 1.5 V. In this way, the entire data acquisition box is debugged, open the PC software, set the program-controlled amplifier gain to 1, and the sine wave signal should be visible on the display.

4.2 Data Recording

Disposable ECG electrodes are placed in the same position: one is attached under the left and right ribs near the arms, and one is attached on the right side of the abdomen. Connect the HOLTER lead wire to the electrode and plug the other end into the data acquisition box. After turning on the power, the tester can do some basic activities. At this time, open the HeartECG software on the PC, manually select the program-controlled magnification to make the ECG signal in the center of the screen, or select the automatic mode, so that the software will automatically adjust the magnification according to the algorithm to facilitate the observation of the ECG signal. The measured data is shown in Figure 6, where the left figure is a 500-fold magnification waveform, and the right figure is a 1,000-fold magnification waveform.

Measured data

5 Conclusion

The experimental results show that the system has strong ability to suppress baseline drift, low power consumption, simple operation and supports simultaneous monitoring of multiple patients. In an open environment, the tester can move within a range of 50 m and can pass through a cement wall indoors. Because all SMT packages are used, the data acquisition box is only 5 cm×6 cm in size and easy to wear. It is a cheap and practical wireless ECG monitoring system.

Keywords:C8051F320 Reference address:Design of Wireless ECG Monitoring System Based on C8051 Single Chip Microcomputer

Previous article:Design of USB interface for data acquisition system based on C8051F320
Next article:Circuit Design and Implementation of College English Autonomous Learning Monitoring System

Recommended ReadingLatest update time:2024-11-16 19:45

Design of low-cost ECG monitoring system based on C8051F320 microcontroller
  1 Introduction   Virtual medical instruments make full use of the rich software and hardware resources of computers. Only a small number of special software and hardware modules are added to realize all the functions of traditional instruments and some functions that traditional instruments cannot realize, while s
[Test Measurement]
Design of low-cost ECG monitoring system based on C8051F320 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号