Share this

Portable microcontroller-controlled LCD heart rate monitor

2026-04-06 08:24:29 · · #1
Introduction In the past, people commonly measured pulses using stethoscopes or electrodes attached to the body, methods that were inconvenient for outdoor use. This heart rate monitor was designed with this in mind. It uses infrared light to detect and collect the pulse, detecting any finger or earlobe. The basic principle is that the translucency of human tissue changes with the heartbeat. When blood flows into the tissue, its translucency decreases; when blood flows back to the heart, its translucency increases. This phenomenon is most noticeable in areas with thinner tissue, such as the fingertips and earlobes. Therefore, this heart rate monitor uses infrared light generated by an infrared LED to illuminate these areas, and uses an infrared photocell mounted on the other side or next to the area to detect the transparency of the tissue and convert it into an electrical signal. Since the frequency of this signal is proportional to the number of pulses per minute, by converting it into pulses, shaping, counting, and displaying them, real-time pulse rate detection can be achieved. Hardware Circuit Design The portable microcontroller-controlled LCD heart rate monitor designed by the author has an overall hardware circuit as shown in Figure 1. It can be divided into two main circuit components: the heart rate acquisition and processing circuit and the microcontroller-controlled display section. Heart Rate Acquisition and Processing Circuit The heart rate acquisition and processing circuit is shown in Figure 2. This circuit mainly consists of three main circuit modules: an infrared pulse count detection and acquisition circuit module, a signal anti-interference circuit module, and a signal shaping circuit module. The infrared emitting diode D1 and the infrared receiving diode Q1 form the infrared detection and acquisition circuit; R2 and C1, C2 and C3, R4 and C4, and IC1a together constitute the signal anti-interference circuit group, which respectively undertakes the tasks of low-pass filtering of the signal, photoelectric isolation of interfering light, and filtering of residual high-frequency interference. In addition, IC1b, C5, R10, and IC1c together form the signal shaping circuit module. The basic working process of the heart rate acquisition and processing circuit is as follows: First, D1 in the infrared detection and acquisition circuit emits infrared light, while Q1 receives the translucency of the corresponding tissue and converts it into an electrical signal. Since the pulse rate is generally between 50 and 200 beats per minute, corresponding to a frequency range of 0.78 Hz to 3.33 Hz, the frequency of the electrical signal acquired and converted by infrared detection is very low. To prevent the signal from being erroneous due to interference from external high-frequency signals, the signal must first undergo low-pass filtering to filter out most of the high-frequency interference. R2 and C1 are used in the circuit to perform this task. Furthermore, since this heart rate monitor is designed for outdoor use, it will inevitably encounter strong light radiation. To avoid interference from strong light when receiving normal pulse infrared light, the circuit uses bipolar coupling capacitors C2 and C3 connected back-to-back to form a simple opto-isolation circuit, thus isolating the interfering light. In addition, to prevent insufficient high-frequency interference filtering, a low-pass filter circuit with a cutoff frequency of approximately 10 Hz, composed of IC1a, R4, and C4, is also included to further filter out interference and amplify the preceding signal by approximately 200 times. The signal obtained after the previous processing is a pulsed sine wave superimposed with noise. This signal must then be shaped. First, the sine wave is converted into a square wave by comparator IC1b. R8 allows the comparator's threshold to be set within the amplitude range of the sine wave. Next, the square wave signal output from pin 7 of IC1b is differentiated by a differentiating circuit composed of C5 and R10, resulting in alternating positive and negative spikes. To stabilize the pulse output, the circuit design inputs this pulse to the inverting input of a monostable multivibrator IC1c, using the output of IC1c as the actual pulse for subsequent operation. When IC1c is operating, it outputs a high level when the trailing edge of the input signal arrives, causing C6 to charge through R11. After approximately 20ms, the potential at the non-inverting input of IC1c decreases due to the reduced charging current of C3. When this potential falls below the potential at the inverting input (after a significant portion of the spike has passed), IC1c changes state and outputs a low level again. The 20ms pulse duration is synchronized with the pulse, and this pulse corresponds to the blinking of the red LED D3 during circuit operation. The pulse after IC1c is the actual pulse required by the subsequent microcontroller control circuit. After being sent to the microcontroller's P3.3 pin through R12, the subsequent counting and display can be realized. The 4.5V power supply voltage required for the operation of IC1a, IC1b, and IC1c is obtained in the circuit by dividing the 9V voltage through R14 and R15 and buffering it through IC1d. This setting allows the circuit to operate normally even if the battery voltage drops to 6V. Microcontroller Control Circuit The microcontroller control circuit is shown in Figure 3. This part of the circuit mainly consists of an AT89C2051 microcontroller, an SMC1602A LCD display chip, a 12MHz crystal oscillator circuit, and a reset circuit. The circuit mainly performs the task of counting and displaying the pulses obtained from the previous acquisition and processing. The pulse signal obtained after acquisition and processing is input to the microcontroller through the P3.3 pin. The microcontroller is set to negative transition interrupt trigger mode. Therefore, each time the falling edge of a pulse arrives, the microcontroller is triggered and generates an interrupt for timing; when the next falling edge of the pulse arrives, the microcontroller calculates the time interval between the two pulses, and the result is the heart rate. This result value is sent to the data port of the SMC1602A LCD chip via port P1 for display. After displaying the heart rate value, the microcontroller compares this value with the normal human pulse range of 80-120. If the value X is 80≤X≤120, the LCD chip will display "Very Good!" to indicate that the subject's heart rate is normal; if the value is outside the 80-120 range (X<80 or X>120), the LCD chip will display "A Little Bad!" to indicate that the subject's heart rate is abnormal. In addition, a beeping sound is included in the circuit to prompt the user to observe the displayed heart rate value. Each time a pulse arrives, the buzzer SP connected to the microcontroller's P3.7 pin emits a beep. When the user hears this beep a second time, it indicates that a one-minute pulse count has been completed. Combined with the flashing light effect for each pulse in the heart rate acquisition and processing circuit, this heart rate monitor can visually display the pulse rate using a combination of sound and light. Furthermore, the effective measurement range of this heart rate monitor is designed to be 50 beats/min to 199 beats/min. To avoid potential interference, the microcontroller detects the time interval between two pulses. If interference is detected, i.e., the count value is outside the set effective measurement range, the interference is ignored and not displayed. This further reduces the possibility of errors in actual use. Component Selection The microcontroller used in the circuit is the AT89C2051. The LCD chip used is the SMC1602A. The operational amplifier IC1 used in the circuit is a commonly used quad op-amp LM324, with its four channels allocated to IC1a, IC1b, IC1c, and IC1d respectively. The heart rate monitor is powered by a 7-9V DC power supply, which can be obtained from a battery or through an AC-DC converter. The normal operating current is 100mA. The prompting device used in the design is a standard buzzer, but an 8Ω miniature speaker can also be used. Furthermore, the microcontroller uses a 12MHz crystal oscillator; if a different frequency crystal oscillator is used, corresponding modifications will be required in the software design. During installation before use, the infrared transmitter D1 and infrared receiver Q1 can be connected to the two ends of a clip. The remaining circuit boards and other components are installed in a small box. For easy portability, a strap-connecting device should be attached to the outside of the box after the circuit is installed. For convenient button pressing and observation during use, designated spaces should be provided on the box for the reset button K1, red LED D3, buzzer SP, and the LCD chip's display window. Meanwhile, the LCD display window should also be protected by a hard mold to prevent damage during outdoor measurements. In actual use, first clip the detection clip device, consisting of the infrared emitter D1 and infrared receiver Q1 shown in Figure 1, onto any of the subject's fingers, then connect the power. If the red LED flashes, it indicates that the heart rate monitor is working normally. To ensure accuracy, press the reset button K1 to reset the system and then restart the measurement and counting display. Note that after hearing the buzzer twice, the first thing to observe is the subject's heart rate, followed by an English message indicating whether the heart rate is normal. If it displays "Very Good!", the subject's heart rate is normal; if it displays "A Little Bad!", the subject's heart rate is abnormal. Software Design The software design of this heart rate monitor uses assembly language. The main program flowcharts are shown in Figures 4 to 7. Figure 4 shows the main program flowchart, Figure 5 shows the timer interrupt subroutine flowchart, Figure 6 shows the INT1 external interrupt subroutine flowchart, and Figure 7 shows the display subroutine flowchart. Conclusion The novel portable heart rate monitor designed in this paper uses a relatively simple and easy-to-implement design method and readily available components. Overall, it has advantages such as small size, strong anti-interference ability, ease of use, easy observation, and portability. Therefore, this heart rate monitor is very suitable for use in sports training and outdoor work.
Read next

CAN Interface Design of Smart Instruments

Abstract: Currently, there are more than a dozen types of fieldbuses, each with different specifications and applicable ...

Articles 2026-02-22