Design Principle of Pulse Wave Measurement System Based on J2ME

Publisher:RadiantBreezeLatest update time:2014-12-10 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In traditional Chinese medicine, pulse diagnosis plays an important role in TCM diagnosis. Pulse diagnosis is to perceive the pathological information of the human body from the pulse signal. With the development of modern science and technology, especially the development of information technology such as signal detection and processing technology and computer technology, people have conducted a lot of meaningful research on the detection and analysis of pulse signals. The pulse wave can be regarded as mainly formed by the interaction of the contraction and relaxation of the heart and the various resistances encountered by blood in the process of flowing along the blood vessels. It contains rich physiological and pathological information of various organs in the human body, and has the characteristics of strong interference, low frequency, and difficult acquisition. Accurate detection of pulse signals has important scientific and social significance for preventing the occurrence of cardiovascular diseases, giving scientific and reasonable guidance to the diagnosis and treatment process, improving people's physical and mental health, and improving people's quality of life.

Traditional detection of blood oxygen pulse signals generally uses large medical equipment. Such equipment generally uses sensors to invasively collect signals, and wired transmission is displayed on the instrument panel. The subject feels painful and the instrument is expensive and inconvenient to carry, so it is impossible to monitor anytime and anywhere. The system uses non-invasive photoplethysmography in conjunction with J2ME to develop a detection program. It is not only low-cost and easy to carry, but also has a database storage function. The blood oxygen pulse signal is wirelessly transmitted through Bluetooth technology. The mobile phone receives and records the pulse data of each test, which is convenient for users to compare and judge their health status over a period of time. At the same time, the data is displayed in real time on the mobile phone. Its versatility, practicality and portability have been greatly improved.

1 Basic Principles of the System

Photoplethysmography (PPG) is a non-invasive detection method that uses photoelectric means to detect changes in blood volume in living tissues. When a light beam of a certain wavelength is irradiated onto the surface of the fingertip skin, the light beam will be transmitted to the photoelectric receiver by transmission or reflection. In this process, the light intensity detected by the detector will be weakened due to the absorption and attenuation of the fingertip skin muscles and blood. The absorption of light by skin muscle tissue remains constant throughout the blood circulation. The blood volume in the skin changes pulsatingly under the action of the heart. When the heart contracts, the peripheral blood volume is the largest, the light absorption is also the largest, and the detected light intensity is small. When the heart relaxes, the opposite is true, the detected light intensity is large, and the light intensity received by the light receiver changes pulsatingly. Under the irradiation of a constant wavelength light source, the pulse signal of the human body can be indirectly measured by detecting the light intensity passing through the finger.

2 System Hardware Design

The system consists of a fingertip collector and a mobile phone with Bluetooth data transmission function. The fingertip collector uses C8051F330 from Silcon Labs as the main control chip, the collection end uses a 940 nm infrared transmitter and a photoresistor, the transmission module uses the HC-05 Bluetooth serial communication module produced by Guangzhou Huicheng Information Technology Co., Ltd., and the display and storage device is a mobile phone with a Bluetooth module.

The overall design structure diagram is shown in Figure 1.



Figure 1 Overall design structure

2.1 Collection and amplification circuit design

The absorption coefficients of oxygenated hemoglobin (HbO2) and unoxygenated reduced hemoglobin (Hb) in human blood are different for different wavelengths of light. In the red light range of 600~700nm, the absorption coefficient of Hb is larger than that of HbO2, while in the infrared light range of 800~1000nm, the absorption coefficient of Hb is smaller than that of HbO2. At 805nm, the two are the same, and the absorption coefficients at red light 660nm and infrared light 940nm are quite different. At present, red light and infrared light near this wavelength are used for dual-spectrum quantitative analysis and detection, and the absorption coefficient change curves of Hb and HbO2 are relatively flat near red light 660nm and infrared light 940nm, and are less affected by the error of diode light emission wavelength, so the system uses a 940nm light source for pulse wave detection. The collection and amplification circuit is shown in Figure 2.



Figure 2 Collection and amplification circuit

The pulse signal picked up by the photoelectric sensor is very weak, only in the millivolt level, so the preamplifier circuit is required to meet the following requirements: 1) High input impedance. The photoelectric signal is a weak signal with unstable internal resistance changes. In order to reduce the influence of the internal resistance of the signal source, the input impedance of the amplifier must be increased, so the amplifier is required to have a high input impedance; 2) Low noise and low drift. It can reduce the influence of the signal source, enhance the signal pickup ability, and make the output stable. R6 is a photoresistor, which is used to receive the pulse signal emitted by the infrared tube. The normal human pulse signal frequency is about 0.3~3.33Hz. In the circuit, C4 and R8, C3 and R9 respectively form RC high-pass filters with a high-pass cutoff frequency of about 0.33Hz, and C2 and R2 form a low-pass filter with a cutoff frequency of about 3.4Hz, which filters out the power frequency interference and other high-frequency interference outside the effective frequency range. The amplifier uses LM358, which includes two independent, high-gain, internal frequency-compensated dual operational amplifiers. It is suitable for single power supply with a wide power supply voltage range, and is also suitable for dual power supply working mode. Under the recommended working conditions, the power supply current is independent of the power supply voltage. Its scope of use includes sensor amplifiers, DC gain modules and all other occasions where operational amplifiers can be used with a single power supply. The first-stage operational amplifier inputs a weak pulse signal from the 5th pin of LM358 and obtains the amplified signal at its 7th pin. According to the operational amplifier formula, it can be calculated that the first stage amplifies 8.5 times, and then passes through a 0.3 Hz high-pass filter to eliminate the noise generated by the first stage amplification. Entering the second stage amplification, it can be calculated that the second stage amplification is 100 times, so the amplification capacity of 850 times is obtained, and the pulse wave signal within 3 V is obtained, and it is in an amplified rather than cut-off state.


2.2 Main control circuit and Bluetooth module circuit design

The main control chip uses the C8051F330 microcontroller in PDIP-20 package, which is easy to solder. It uses Silicon Labs' patented CIP-51 microcontroller core. CIP-51 is fully compatible with the MCS-51TM instruction set, and can use the standard 803x/805x assembler and compiler for software development. The CIP-51 core has all the peripheral components of the standard 8052, including 4 16-bit counters/timers, a full-duplex UART with enhanced baud rate configuration, an enhanced SPI port, 768 bytes of internal RAM, and 128 bytes of special function register (SFR) address space. The system can be built using only simple external circuits.

The HC-05 module uses the CSR BC417143B Bluetooth chip and has a built-in 8M Flash. It has two working modes: command response working mode and automatic connection working mode. In the automatic connection working mode, the module can be divided into three working roles: master, slave and loopback. When the module is in the automatic connection working mode, it will automatically connect the data transmission according to the pre-set method; when the module is in the command response working mode, it can execute AT commands. By controlling the input level of the module's external pin (PIO11), the dynamic conversion of the module's working state can be achieved.

Here, its P0.4 and P0.5 ports are used as UART transmission ports to communicate with the UART port of the Bluetooth module.

Sout is the pulse signal output by the acquisition and amplification circuit, which is input to P1.7 of C8051F330 for A/D conversion. C8051F330 is connected to the UART port of HC05 to transmit the sampled and filtered signal to the Bluetooth module. Switch S1 is used to reset the Bluetooth module, and diode D2 is used to display the status of the Bluetooth module. When there is no data transmission, D2 turns off, and when there is data transmission, D2 flashes. The circuit is shown in Figure 3.



Figure 3 Control and communication circuit

3 System software design

The overall system software design includes two parts: the input signal sampling and filtering on the MCU side and the Bluetooth program and the J2ME Bluetooth client program design on the mobile phone side.

3.1 Filter design on the MCU side

Since human breathing and electrode movement will cause baseline drift interference in the pulse signal, the frequency is low, generally below 0.7 Hz, which is a low-frequency interference. In order to obtain better results, its influence must be eliminated as much as possible. The human pulse wave signal is a quasi-periodic time series. At the same phase of different cycles, the amplitude of its pulse wave is approximately unchanged. If the local pulse wave suddenly changes at a certain moment, its amplitude at this moment must not be equal to the amplitude of the same phase of its adjacent pulse wave. According to this idea, the median filtering method has a better processing effect. The median filtering method can effectively overcome the fluctuation interference caused by accidental factors, and has a good filtering effect on the measured parameters with slow changes in temperature and liquid level. Therefore, the median filtering method is first used to eliminate sudden disturbances as much as possible. The basic method is to continuously sample N times (N is an odd number), arrange the N sampling values ​​in order and then take the middle value as the effective value of this time.

Moving average filtering has a strong ability to resist the interference of fast periodic motion. It is a low-pass filter that supplements analog filtering and is used for real-time detection. As long as the sampling rate is high enough, a relatively ideal measurement result can be obtained. Therefore, the system adds a moving average filter after the median filter to perform secondary filtering on the data.

The specific algorithm is:

y (i) = c1y (k) + c2y (k-1) + ... + ciy (k-m + 1) (1)

In the formula, y (k) represents the filter output at the kth sampling moment, each y (i) represents the signal input at the i-th sampling moment, the number i in the bracket represents the i-th sampling moment, and c1, c2, ..., cm are weighting coefficients.

The meaning of the above formula is to perform weighted averaging on the input data of this time together with the previous m-time data. If the ci values ​​are the same and equal to 1/m, it becomes an m-term arithmetic average operation.

3.2 Bluetooth Design The

Bluetooth protocol stack provides a set of high-level protocols and APIs to complete service discovery and simulate serial I/O, as well as a low-level protocol for packet segmentation and reassembly, as well as a multi-channel technology protocol and quality service. The Bluetooth protocol stack is shown in Figure 4.



Figure 4 Bluetooth protocol stack

Application layer (Application): This layer runs the J2ME communication program for Bluetooth communication. By calling the API of the Bluetooth wireless layer, you can directly write the program of the corresponding communication function.

Bluetooth wireless layer (JSR-082): All developed APIs are called at this layer to interact with the lower layer.

Service Discovery Protocol Layer (SDP): Used to find services on remote Bluetooth devices. The server maintains a list of service records. Each service record contains information about a service on the server, and each service corresponds to a service record. When the client accesses the server, it must first obtain the server's access record and then establish a connection through the service record.

Logical Link Controller Adaptation Layer Protocol (1.2CAP): Provides connection-oriented and connectionless data services for the upper layer protocol, and provides multi-protocol functions and segmentation and reassembly operations. It can transmit and receive L2CAP data packets with a maximum length of 64 KB.

Virtual Serial Port Protocol (RFCOMM): A virtual serial port protocol based on the L2CAP protocol. Because it allows Bluetooth devices to simulate the functions of a serial port, it is used for data transmission.

Object Exchange (OBEX): It can be used to transfer files or exchange object data. The OBEX protocol is implemented based on RFCOMM.

Host Controller Interface (HCI) Layer: This layer is the interface between the host and the controller. All other layers must pass through HCI.


3.2.1 MCU Bluetooth Design

The MCU uses the UART interface to communicate with the Bluetooth module. HC-05 is a Bluetooth transparent transmission module, which is designed to provide fast Bluetooth point-to-point communication for users with asynchronous serial ports. Users do not need any protocol, just like a wired cable connection, they only need to write data to the serial port to transmit the data to the remote user device. After power-on, the Bluetooth host module resets, reads the Bluetooth module address, sets the status parameters and initializes the module. After successfully connecting to the remote mobile phone, it can communicate with the slave through the UART asynchronous serial port. Here, HC-05 is set to host mode, provides Bluetooth services after initialization, and waits for the mobile phone Bluetooth client to connect.

3. 2.2 Mobile J2ME Design

J2ME (Java2 Platform, Micro Edition) is a new Java version provided by Sun specifically for the development of applications for small resource-constrained consumer electronic devices. It is widely used in many small resource-constrained devices such as mobile phones, PDAs (personal digital assistants, and TV set-top boxes). For J2ME, due to its unique cross-platform nature and good portability, it is more like a duck in water in the mobile phone and PDA market with a variety of devices and extremely chaotic platforms.

The J2ME platform is composed of configurations and profiles. Configurations are the minimum class library set provided for a large range of devices, and the configuration also includes the Java virtual machine (JVM). Profiles are a set of development packages provided for a series of devices. There is also an important concept in J2ME: Optional Package, which is a class library provided for specific devices. For example, some devices support Bluetooth. For this function, JSR82 (Bluetooth API) is formulated in J2ME to provide support for Bluetooth. The program flow chart is shown in Figure 5. [page] Figure 5 The design process of



the program flow chart

is as follows:

1) Build the Mobile main class based on MIDLet, implement button monitoring, and respond to the commands of the left control key of the mobile phone to exit (Cmd_Exit) and the right control key to display the pulse wave (Cmd_Show) in its monitoring message. Part of the code is as follows:


2) Establish a Show class derived from GameCanvas to implement button monitoring. The function name of drawing the pulse is DrawPulse, which is used to dynamically display the received pulse data on the screen. Part of the code is as follows:


3) Establish a Record class, and use the methods of RecordStore addRecord, deleteRecord, and getRecord to store, delete and display the received pulse data. At this point, the entire J2ME interface is built. Part of the code is as follows:


4) Create a new class to implement Punnable (multithreading). Since it is necessary to send connection requests and receive data, the sending and receiving processes must be implemented using multithreading. Import the input and output data stream package to receive data in a loop. Part of the code is as follows:



4 Data display and result analysis

Considering the influence of natural light on the measurement, the entire circuit is placed in a small, light-proof cylindrical sealed container (about 5 cm in diameter and 5 cm in height). A 1.5 cm diameter hole is punched in the middle to fix the finger posture of the subject, and a 0.5 cm hole is punched on the top to place the photoresistor in reverse. The acquisition circuit board and the Bluetooth transmission circuit board are stacked and fixed with foam. During the test, the fingertips are pressed on the surface of the photoresistor, and the subject can maintain a stable posture for a long time. Sometimes some burrs and baseline drift occur during the test, but they do not affect the overall measurement effect. The measurement results are: the pulse waveform is smooth, the noise suppression is good, and the user's health status evaluation parameters can be provided after long-term observation and stability, as shown in Figure 6.



Figure 6 Data display

5 Conclusion

The system uses C8051F330 single-chip microcomputer and J2ME Bluetooth to develop a portable pulse wave measuring instrument. Compared with traditional detection equipment, it adopts the photoelectric volumetric pulse wave method. The result error is controlled within 10%, the cost is reduced by more than 50%, and the volume is reduced by more than 50%. With J2ME, it can be easily developed for secondary development. At the same time, the system still needs to be improved in some details, such as using more effective filtering methods to filter out noise such as baseline drift in the pulse wave, building a more user-friendly mobile phone interface, etc. Based on the system, using J2ME to develop a mail system or CPRS, build a remote community medical care system, and send human physiological signals to doctors for remote diagnosis using mobile phones, which will bring great convenience to users and show good prospects for use.
Reference address:Design Principle of Pulse Wave Measurement System Based on J2ME

Previous article:Research on Liquid Viscosity Measurement Method Based on Electromagnetic Induction
Next article:The development and application of 3D laser measurement technology

Latest Test Measurement Articles
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号