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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
- Popular Resources
- Popular amplifiers
- Build the Internet of Things with Arduino
- Practice of Serial Communication between Single Chip Microcomputer and Computer (Zhang Xiuguan)
- Electronic competition thesis documents based on MSP430 microcontroller design + source code and some hardware PCB files
- Amplifier Design Practice 125 Questions Answered
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Essential PCB wiring rules for electronic hardware engineers: basic theories of right-angle routing, differential routing, and serpentine routing
- 【EETALK】What is the difference between traditional Bluetooth and low-power Bluetooth? Will traditional Bluetooth be replaced by low-power Bluetooth in the future?
- How to select PCB isolated power supply
- Technical Articles | Frontline engineers explain to you: Tips for testing the dark current of passive device PD
- BSL source code for DM642EVM
- Teachers, what kind of amplifier should be used to amplify the mv level of this sensor?
- A record of the development experience of a new embedded CPU chip CC2540
- if(Data==1)start=1; Why is there no space after if and before start in this sentence? This will not cause errors during compilation.
- Xiaomi Robot Vacuum Cleaner Features and Chip Parameters
- Live: Embedded to Cloud Journey with PIC and AVR MCUs from the Microchip Ecosystem Part 2