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 shortening the research and development cycle. This system consists of two parts: a data acquisition device with C8051F320 single-chip microcomputer as the core and an analysis and processing system with PC as the platform. The design fully considers the requirements of small size, low power consumption and fast operation of the data acquisition device, so all SMT packaged components are used. The PC monitoring terminal receives data through the USB interface with a high transmission rate; the graphical programming language LabVIEW is used to write functional programs such as display, storage, analysis and processing. The system can monitor and provide parameters such as cardiac cycle and heart rate in real time, and can also store and replay data, providing a basis for the diagnosis of cardiovascular diseases. The system's software development and the integrated test of hardware and host computer software show that the system runs stably and reliably and has achieved the expected results.
2 System Hardware Design
The system consists of two parts: C8051F320 data acquisition module and PC, as shown in Figure 1.
The data acquisition module is mainly composed of an ECG acquisition circuit and a DAQ interface card based on a C8051F320 microcontroller, as shown in Figure 2.
The module collects pre-processed ECG signals through the A/D converter on the C8051F320 chip, and then transmits them to the PC via the USB bus for display. The PC part is mainly software design, including writing a data acquisition graphical user interface through the USB host API function on the C8051F320 microcontroller chip and LabVIEW software; and implementing programs to receive, display and process the collected data sent by the data acquisition module through the USB interface. Both the LabVIEW application and the C8051F320 application use the API and driver of the USB Xpress development kit of Silicon Laboratories to implement read and write operations on the underlying USB device.
ECG signals are weak signals, and the amplitude range of surface ECG signals is 1~10 mV. There are strong interferences when measuring ECG signals, including the DC polarization voltage generated by the chemical half-battery formed between the measuring electrode and the human body, the 50 Hz power frequency interference in the form of common mode voltage, the baseline drift caused by human movement and breathing, and the myoelectric interference caused by muscle contraction. The use of telemetry HOLTER three-lead wire and disposable ECG electrodes in contact with the human body can effectively reduce the myoelectric interference caused by movement and breathing. The front-end amplifier uses the instrument AD620 amplifier with a very high common mode rejection ratio (CMRR) and an amplification factor of about 50 times; and uses a 0.05~100 Hz bandpass filter and a 50 Hz notch circuit to suppress the baseline drift, high-frequency noise and power frequency interference of the signal. 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 conversion circuit before conversion. Considering that the DC component will be added to the signal, a level adjustment circuit needs to be added before the A/D conversion circuit. The difference in individual ECG amplitudes requires the design of a programmable amplifier circuit in the circuit. In order to facilitate the calibration of ECG signals and take into account the deviation between the actual device amplification factor and the theoretical value, a manually adjustable amplifier circuit (1 to 10 times) is set in front of the programmable amplifier circuit.
Based on the above analysis, the ECG acquisition and program-controlled amplification part should include: AD620 front-end amplification, 0.05~100 Hz bandpass filtering, 50 Hz notch, manual amplification, program-controlled amplification and level boosting circuits. The program-controlled amplification function is realized by digital gating of CD4051 electronic switch, which has an adjustment range of 1 to 50 times.
In order to reduce the power consumption of the system, low-power and highly integrated devices should be used. The system uses the C8051F320 microcontroller as the core component of the data acquisition card. This device is a fully integrated mixed-signal system-level device with a high-speed CIP-51 core compatible with 8051 and fully compatible with the MCS-51 instruction set. It integrates analog and digital peripherals commonly used in data acquisition and control systems, as well as other functional components such as USB interfaces. The external circuit is simple and easy to implement, as shown in Figure 3.
The ECG electrodes send the obtained signals to the C8051F320 microcontroller after filtering and amplification by a variable gain amplifier. The microcontroller converts the obtained analog ECG signals into digital signals in real time. The collected data is transmitted to the PC through the USB interface for further analysis and processing of the signal data.
3 System Software Design
3.1 C8051F320 MCU Programming
The C8051F320 microcontroller program includes: (1) A/D conversion program and programmable amplification control program; (2) USB device-based communication program, which receives user commands sent from the USB host and sends the collected data to the USB host.
3.1.1 A/D conversion procedure
There are two main indicators to measure the performance of A/D conversion: sampling resolution (number of bits of A/D converter) and A/D conversion speed. The sampling rate of A/D converter is set to 2 000 Hz, and the overflow interrupt of timer TIME2 is used to trigger the conversion. After each conversion, 10 bits of result data word are latched into the data register of A/D converter for USB communication subroutine data call. Figure 4 shows the A/D conversion process. The A/D conversion program is relatively simple. The sampling period of A/D converter can be determined by setting the on-chip timer of C8051F320. The overflow of timer periodically starts A/D converter to sample the measured data. USB is set to block transmission mode for data communication with PC. Every 64 data are packed into a data packet. In order to make full use of hardware resources and improve data transmission efficiency.
3.1.2 Communication program based on USB device
The entire program flow is based on USB communication, as shown in Figure 5. The USB_Clock_Start(), USB_Int() and other functions involved in the figure are USB-side API functions developed by SiliconLab specifically for the USB functions of the C8051F320 microcontroller. By directly calling these functions in the C8051F320 upper-level application, you can quickly and easily access the USB underlying hardware.
3.2 PC LabVIEW Programming
The PC LabVIEW program design mainly completes two major functions: the user graphical interface and the USB host communication program, thereby realizing human-computer interaction, and transmitting the user-input commands and the data collected by the acquisition module between the PC and C8051F320 through the USB bus.
3.2.1 LabVIEW program panel design
The tool used to develop USB device drivers is USB Xpress Development Kit, which mainly includes: SI_Open() function; SI_Close() function; SI_Read function; SI_Write() function; SI_GetNumDevices() function; SI_CheckRX Queue() function. When users read data from the device, they will call an application program interface API. SI_GetNumDevices(), SI_GetProductString() and other functions are USB host API functions developed by Silicon Lab for the USB function of C8051F320 microcontroller. LabVIEW provides the Call Library Function. This design uses Silicon Lab's SiUSBXp.dll dynamic link library to access the USB underlying hardware.
The communication initialization of the device is completed by calling SLGetNumDevices(), and the generated function returns the device number of the driver; this device number is used to generate the device description string when calling SI GetProductString() function. To read a device, you must first call SI_Open() function by calling the index (device number) generated by SI_GetNumDevices() function. SI_Open() function will return the handle of the device, which will be used in all subsequent processes. Data input and output can be realized by using SI_Write() and SI_Read() functions. When the data input and output operations are completed, the device can be closed by calling SI_Close(). Figure 6 is the block diagram of the I/O interface driver.
3.2.2 LabVIEW Programming User Graphical Interface (Front Panel) Design
The application program of the dynamic ECG monitoring system can realize the functions of receiving, real-time display, storage and playback of ECG signals; and can provide parameters such as cardiac cycle and heart rate, providing a basis for heart rate variability analysis and diagnosis of cardiovascular diseases. The display interface of the ECG monitoring system is shown in Figure 7.
4 Conclusion
This design can not only realize all the functions of traditional measuring instruments, but also save experimental data for repeated observation and analysis. The ECG monitoring system based on virtual instruments is flexible and convenient to use, has rich test functions and low cost. Users can change its functions and upgrade it by modifying the software according to actual needs to achieve multiple uses of one machine. The experimental results show that the system has a strong ability to suppress baseline drift, low power consumption and simple operation. The USB interface is used to transmit ECG data in real time, and the ECG data acquisition module is designed as a computer peripheral, which is fast and fast. Since all SMT packages are used, the size of the data acquisition module is only 60 mmx60 mm, which is convenient and practical. Therefore, this design is a practical, low-cost, dynamic ECG monitoring system.
Previous article:Design and virtual simulation of single chip temperature acquisition circuit
Next article:Realization of short-distance wireless communication based on AT89C52 single-chip microcomputer
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
- Problems with RS485 communication self-transceiver circuit
- The mobile station adds a new board, the STM32F723 Discovery Kit
- [Teardown of the car wireless charger] - Disassembling the Deli wireless car charger
- TTP250-S001 dimming solution and capacitive touch switch chip
- [Fudan Micro FM33LG0 Series Development Board Review] A Preliminary Study on the Rubik's Cube Development Environment
- BOOST Circuit Simulation
- Bluetooth (cc2540) protocol stack learning 1
- XMC4800 Review (Part 4) - Data Sharing
- 【DIY Creative LED】WS2812 Effect Display File
- One watt of GaN is less than one yuan, and it is free shipping by SF Express? Lenovo has launched a price war on GaN.