时间:2020-01-07 21:30:40
Introduction
Although there are many instruments for detecting heart rate at present, there are few portable full-digital heart rate measuring devices that can achieve accurate measurement, upload data to PC, and have multiple functions such as sound and light alarm. The digital human heart rate detector introduced in this article can accurately measure the number of heartbeats in the hands, wrists, arms and other parts of the human body. It also has multiple functions such as power-off storage, measurement data upload to PC and sound and light alarm.
1 System composition and working principle
The system composition is shown in Figure 1. This design uses a single-chip microcomputer as the main control signal and a small amount of external hardware circuits to complete data processing, memory, display, communication and other functions.
Jiagong Machinery Power Network
First, when the system is turned on, the system working mode is set through the keyboard. Then, the human heartbeat signal detected by the piezoelectric ceramic is input to the single-chip microcomputer after amplification, filtering and shaping. The single-chip microcomputer processes the measured data and sends it to the display circuit for display. At the same time, the measured data is uploaded to the PC through the communication circuit. The memory circuit is mainly used to store the measured data and realize the power-off storage function. The sound and light alarm circuit will alarm when the measured data exceeds the normal range (such as greater than 180 times/min or less than 45 times/min) to remind the doctor to pay attention.
2 System hardware circuit design
2.1 Sensor and signal processing circuit
The sensor and signal processing circuit are shown in Figure 2.
Jiagong Machinery Network
The sensor for detecting heart rate pulse signals uses piezoelectric ceramics (a sea surface pad is installed on the piezoelectric ceramic sheet to transmit the pulse signal); the collected heart rate signal is amplified by a three-stage amplifier circuit composed of three non-gates of CD4069, and then filtered by a two-stage ladder filter circuit composed of R4, R5, C5 and R7, R8, C6 to obtain a signal in the human heart rate range (approximately between 0.66Hz-3.33Hz); and then processed by a detection circuit composed of diodes D1, D2 and R6 and a shaping circuit composed of three non-gates U1F, U1D, and U1E, the standard 0-5V pulse signal required by the microcontroller can be obtained.
2.2 Keyboard Circuit
The keyboard circuit is shown in Figure 3.
Jiagong Machinery Power Network
Because the I/O is sufficient, the four buttons are connected to P1.2, P1.3, P1.4, and P1.5 of the microcontroller respectively, and the query mode is adopted for operation. K1, K2, K3, and K4 respectively complete the operation of starting measurement, querying, storing measurement structure, and clearing memory data.
2.3 Display Circuit
The display circuit is shown in Figure 4. It adopts dynamic display mode. The data input ends of the two 74LS373s in the figure are connected to the P0 port of the 89C51 microcontroller. The microcontroller provides chip select signals to the two 74LS373s through P1.0 and P1.3, thereby realizing the time-sharing selection of the two 74LS373s to work, and transmitting segment codes and bit codes respectively. There are 6 digital tubes in the figure, the first 3 are used to display the serial number of the person being measured, and the last 3 are used to display the number of heartbeats per minute; ULN2803 is an 8-phase inverting driver, which is used as a bit enhancement driver.
Jiagong Machinery Power Network
2.4 Memory Storage Circuit
The memory storage circuit is shown in Figure 5. The memory chip uses AT24C02. SDA is the serial data input/output pin, SCL is the serial synchronous clock input terminal; A0, A1 and A2 are the chip select signal input terminals, and the TEST pin is write protected. When grounded, it means no protection. After measuring the heart rate data, if you want to save it, press the storage button K3, and the microcontroller will provide the AT24C02 with a suitable clock through P2.1, and then store the data in the specified address. Of course, the control word, address and data are input three times, and AT24C02 is required to provide a response signal to the microcontroller between each segment. In addition, start and stop bits must be added before and after reading and writing data.
Jiagong Machinery Power Network
2.5 Communication Circuit
The function of the communication circuit is to upload the heart rate data measured by the microcontroller to the PC. This circuit uses a MAX232 chip to convert the TTL level into a level that can be recognized by the PC, and then connects to the PC through a standard 9-pin interface. The peripheral circuit is rich and simple, and only 5 0.1μF capacitors are required. The specific circuit is shown in Figure 6.
Jiagong Machinery Power Network
2.6 Sound and light alarm circuit
The sound and light alarm circuit is shown in Figure 7. The two-level gated oscillator is composed of the NAND gate 74F00. Among them, U6A and U6B form a low-frequency oscillator with an oscillation frequency of about 1Hz, and R5 is a pull-down resistor, which makes Uc=0V under normal conditions. Only when the measured data is within the alarm range, the P1.6 of the microcontroller provides a high-level circuit to start oscillation. The high and low levels alternately output by the B0 terminal are passed through Q1, making the light-emitting diode flash. U6C and U6D form an audio oscillator with an oscillation frequency of about 1KHz. Only when B0=1, the second-level oscillator starts oscillation, and the Darlington tube Q2 and the output transformer T drive the speaker BL to emit intermittent "beep, beep..." alarm sounds.
Jiagong Mechanical and Electrical Network
3 Software Design
The main program flow chart of the system is shown in Figure 8.
Jiagong Mechanical and Electrical Network
Mainly includes display driver, key processing program, INT0 interrupt service program, AT24C02 driver storage program, serial communication program, etc.
4 Conclusion
Through actual design and production, and compared with the existing heart rate monitors on the market, the results show that this design has the advantages of small size, light weight, low cost, easy to use, accurate measurement, etc., and has good application prospects.