{'fraction_non_alphanumeric': 0.026371308016877638, 'fraction_numerical': 0.009041591320072333, 'mean_word_length': 4.73638720829732, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design and Implementation of Heart-Rate Monitoring Circuit

Combined with different stages and levels of circuit principles, analog circuit, signals and systems, microcontroller principles, application and practice of FPGA courses in the electrical major, the work presented the process and fun of electronic systems' design through tests of the signal conditioning, waveform transformation, heart rate data processing, display and alarm in the heart-rate monitoring circuit by the flexibility of the personal multi-functional experimental platform.


Introduction
With the improvement of living standards, people pay more attention to the health of themselves and their families. Heart rate is a significant index of body health, which is analyzed to obtain valuable information. The work designed and implemented a heart-rate monitoring circuit based on MCU. The photoelectric pulse sensor detected the pulse signal of the finger, and the signal was amplified, filtered, and shaped into a heartbeat pulse. After the MCU circuit processed the heartbeat pulse, it was displayed digitally as the pulse rate. If the pulse rate reached an alarm range, the buzzer alarmed. This heart-rate monitoring circuit could quickly measure the heart rate of the human body, with the feature of low cost, small size, and easy operation. Fig. 1 shows the overall structure of the heart-rate monitoring circuit, which mainly includes several circuits of pulse sensor, signal conditioning, waveform transformation, heart rate data processing, display, and alarm. The photoelectric pulse sensor detects the finger pulse signal, which is amplified and filtered by the signal conditioning circuit, and shaped into a heartbeat pulse by the waveform transformation circuit. The heartbeat pulse is processed by the heart-rate data-processing circuit so that it can be displayed as a figure. The buzzer alarms when the heart rate is out of normal range.

Photoelectric pulse sensor
As the blood is a highly opaque liquid, the penetration of light in other tissues is dozens of times larger than that in blood, and photoelectric sensors can detect the pulse wave. The pulse wave is the periodic contraction and relaxation of the human ventricle transmitted to systemic blood vessels through the arteries. According to the Beer-Lambert Law, the absorbance of matter at a specific wavelength is directly proportional to its concentration. When the light of a constant wavelength irradiates human tissues, the light intensity measured after the absorption, reflection, and attenuation reflects the change with vasoconstrictions and relaxations of the blood concentration to a certain extent. The peak of this photoelectric signal represents the pulse wave. Fig. 2 shows the photoelectric pulse sensor. There are three pins-the one marked with "+" is connected to GND; the one marked with "+" is connected with 5V; the one marked with "s" is the output of pulse wave signals.

Signal conditioning circuits
The AC output peak voltage of the photoelectric pulse sensor is related to the skin thickness and pressures of the user's fingertips. In order to detect the heartbeat pulse stably, a one-stage amplifier is used to balance the small signals. When it is a significant signal, the amplifier output has a clipping, not affecting the comparator generating pulses. Fig. 4 shows the design of a signal conditioning circuit.  Fig. 4 Signal-conditioning circuit This amplifier circuit uses a single power supply because the system power is 5V, under which the LM358 amplifier can be used. The voltages on R1 and R2 are both 2.5V DC. Moreover, the "input" is connected to the output of the sensor. Fig. 5 shows the tests of the signal conditioning circuit. Yellow channel 1 is the input, and blue channel 2 stands for the output. The signal is amplified with the DC voltage of 2.5V.

Comparator circuits
The comparator can transform the output signal from amplifiers into pulse signals, which can be recognized by logic circuits. Fig. 6 shows the comparator circuit. Hysteresis is added to the comparator to prevent false triggering caused by the noise. R6 and R7 provide about 20% hysteresis, while R8 and R9 provide the reference voltage for the comparator. LM311 is an open-drain output, so R5 is used for a pull-up operation.  Fig. 6 Comparator circuit Fig. 7 shows the tests of the comparator circuit. The yellow channel 1 is the input signal; the blue channel 2 the reference voltage; the red channel 3 the output signal. The signal is shaped into a rectangular pulse.

.2 Pulse shaping circuit
The rectangular pulse generated by the comparator has two features: one is that the duty circle is narrow, and the other one is the pulse width changes owing to the instability of sensor signals. These may bring errors. The 555 monostable trigger is chosen for pulse shaping. Fig. 8 shows the pulse shaping circuit.  Fig. 9 shows the tests of the pulse shaping circuit. Besides, the comparator output is in the yellow channel 1; the output of the monostable trigger in the blue channel 2. The narrow pulse is shaped into a square wave with constant TW width. Fig. 9 Tests of the pulse-shaping circuit 5. Design of heart-rate data-processing circuits A single chip microcomputer processes the heart-rate data, and it has functions of display and alarm. Fig. 10 shows the data-processing circuit.  Figure 11. The pulse signal can be calculated and processed by the timer interrupt and counting functions of SCM to obtain the heart-rate data. LCD1602 can read out the accurate results. If the pulse rate is out of the normal range, the buzzer alarms.  Fig. 11 Simulation of the SCM circuit Fig. 12 shows the real circuit build on the personal multi-functional experiment platform.

Fig. 12 Overall unit
Compared with the data on a pulse-measuring app downloaded on the Internet, the error rate of the device made by us can be controlled within 10 percent. During measuring, fingers and devices must be static as far as possible; otherwise, it causes signal fluctuations or even the buzzer to alarm.

Conclusion
The work is a typical example of solving practical problems in electronic system engineering. From the design process, it is a complete small system design, which needs sufficient knowledge reservations, scheme demonstrations, system design, circuit welding, single and overall circuit debugging and testing. Through the comprehensive experiment of cross-course contents, we make full use of the flexibility of pocket experiment platforms, designs progressive experiments independently, and experience the process and fun of electronic system design thoroughly.