Build Your Own Heart Rate Monitor A Detailed Circuit Guide

Start with an infrared LED and photodiode pair for optical sensing–this combination provides reliable signal acquisition through reflected light changes. Use a 940nm wavelength for minimal interference from ambient sources while ensuring sufficient penetration through skin tissue. Position the emitter and receiver at an optimal 5–10mm spacing to balance signal strength and noise reduction; closer placement increases sensitivity but risks saturation, while wider gaps weaken the response.
Incorporate a two-stage amplification system: a TL072 or LM358 op-amp first filters and boosts the raw signal, then a second stage refines the output with a bandpass filter centered at 0.5–4Hz. This range isolates physiological pulses from motion artifacts and electrical noise. Add a 10μF coupling capacitor at the input to block DC offset, preventing false readings–a common failure point in poorly designed setups.
For digitization, pair the analog output with an ATmega328P or STM32 microcontroller, sampling at 50–100Hz to capture transient variations without aliasing. Implement a simple moving average filter in firmware to smooth data, but avoid oversampling; excessive filtering delays response to real-time changes. Power the circuit with a regulated 3.3V or 5V source, isolating sensitive analog components from switching noise with a dedicated linear regulator like the AMS1117.
Validate performance against a commercial medical-grade device–correlate beat-to-beat intervals under controlled conditions (resting, post-exercise). Calibrate threshold values empirically; typical peak amplitudes range from 50–200mV, but skin tone and sensor alignment introduce variation. Include a test point for an oscilloscope probe to monitor signal integrity during development.
Pulse Sensing Schematic: Key Components and Build Instructions
Start by assembling a photoplethysmography (PPG) sensor using an infrared LED (940nm) and a photodiode (e.g., BPW34). Position them at a 5-10mm gap with opaque material (e.g., black silicone) to block ambient light–signal noise drops by ~70% with proper shielding. Use a 100Ω resistor in series with the LED to limit current to ~20mA; higher values reduce brightness but extend sensor lifespan. The photodiode’s output connects to a transimpedance amplifier (op-amp: MCP6002) with a 1MΩ feedback resistor–this converts microampere-level currents to a 0-5V signal. Add a 100nF capacitor in parallel with the resistor to filter high-frequency interference (
Signal Processing and Output
Feed the amplified signal into an analog-to-digital converter (ADC) with ≥10-bit resolution (e.g., Arduino’s 10-bit ADC). Sample at 100Hz to capture pulsatile waves without aliasing; store data in a circular buffer to analyze real-time peaks. Implement a moving average filter (window: 5 samples) to smooth baseline drift. For peak detection, use hysteresis thresholding: set the upper limit at 70% of the recent signal maximum and the lower limit at 30% to ignore false triggers. Output results to a serial terminal or a 16×2 LCD screen (Hitachi HD44780 protocol). For battery-powered devices, replace linear regulators with an MCP1700 (3.3V) to reduce quiescent current to 2μA.
- Critical PCB traces (PPG sensor to op-amp): keep
- Power supply decoupling: place 0.1μF ceramic capacitors within 2mm of each IC’s VCC pin.
- Test with a finger phantom (5mm silicone tube filled with blood-mimicking fluid: 96% glycerol, 4% water) to validate signal fidelity.
Calibrate the system by comparing measured BPM against a commercial oximeter (±2 BPM accuracy target). Adjust the LED intensity dynamically via PWM if signal saturation occurs with darker skin tones. For wearables, add a 3-axis accelerometer (ADXL345) to distinguish motion artifacts from pulsatile signals–subtract accelerometer data from PPG using least-squares regression.
Key Parts for a Pulse Detection System
Begin with an optoelectronic pair, the core of signal acquisition. Use an infrared LED (940nm) as the emitter and a phototransistor (or photodiode) as the detector. Match the emitter’s wavelength to the detector’s peak sensitivity for optimal SNR. Surface-mount variants (e.g., Kingbright APTD3216P3C) reduce parasitic capacitance and improve response time. Avoid 850nm LEDs–ambient light interference increases significantly.
Signal amplification demands a precision op-amp (e.g., Texas Instruments OPA333). Configure it as a transimpedance amplifier with a feedback resistor between 100kΩ and 1MΩ, adjusting based on ambient conditions. For DC offset cancellation, integrate a high-pass filter (cutoff ~0.5Hz) using a 1μF polyester film capacitor and a 330kΩ resistor. Bypass the op-amp power rails with 0.1μF ceramic capacitors to suppress high-frequency noise.
| Component | Recommended Model | Critical Parameter |
|---|---|---|
| Infrared Emitter | Kingbright APTD3216P3C | 940nm, 50mA max forward current |
| Photodetector | Vishay BPW40 | Spectral range: 400–1100nm |
| Op-Amp | OPA333 | 1.8μVpp noise (0.1–10Hz) |
| High-Pass Capacitor | KEMET R82KN4100AA30J | 1μF, ±5% tolerance |
For digital interfacing, a microcontroller with an ADC (e.g., STM32F103C8T6) samples the conditioned signal at ≥200Hz to satisfy the Nyquist criterion for pulsatile waveforms. Use a 12-bit ADC for sufficient resolution–10-bit variants risk quantization errors with small-amplitude signals. Implement oversampling (4x–8x) and decimation in firmware to reduce noise by exploiting the central limit theorem.
Power supply stability is non-negotiable. Use a low-dropout regulator (LDO) (e.g., MCP1700) to deliver 3.3V from a single-cell Li-ion battery. Add a Schottky diode (e.g., 1N5817) in series with the battery to prevent reverse current during charging. Decouple the LDO output with a 10μF tantalum capacitor and a 0.1μF ceramic capacitor placed as close as possible to the load. Avoid linear regulators with >2% load regulation–fluctuations degrade SNR.
Physical enclosure design directly impacts performance. Use absorptive infrared plastic (e.g., 3mm thick acrylic with carbon black) to block ambient light while allowing the emitter’s wavelength to pass. Ensure the optoelectronic pair sits flush against the skin–gaps >0.5mm introduce motion artifact due to tissue deformation. For wearable applications, add a flexible PCB (polyimide substrate) and medical-grade adhesive (e.g., 3M 1522) to minimize slippage during dynamic activity.
Step-by-Step Wiring of Pulse Sensor to Microcontroller

Select a photoplethysmography (PPG) module with at least three terminals: VCC, GND, and Signal. Verify the voltage range–most operate at 3.3V–5V, but confirm with your module’s datasheet to prevent damage. Use a low-dropout regulator if your microcontroller outputs inconsistent voltage levels.
Connect the GND pin of the PPG module to the microcontroller’s ground rail. Use a common ground plane for noise reduction, especially if other sensors or high-current components share the same power source. Avoid long ground loops–keep wiring under 10 cm where possible.
Attach the VCC pin to the microcontroller’s power output pin matching the module’s requirements. For Arduino Uno, use the 3.3V or 5V pin; for ESP32, the 3.3V pin is optimal. Add a 10µF–100µF decoupling capacitor between VCC and GND to filter power fluctuations.
Wire the Signal pin to an analog input on the microcontroller. For Arduino, use A0–A5; for ESP32, any ADC1_CHx pin. Enable internal pull-down resistors if the module lacks built-in signal conditioning. Test with a multimeter–the resting signal should hover around 1V–2V for accurate readings.
Signal Noise Mitigation

Route the signal wire away from motor drivers, Wi-Fi antennas, or switching power supplies. Twist the signal wire with its ground counterpart to cancel electromagnetic interference. For high-precision applications, add a 0.1µF ceramic capacitor between the signal line and ground near the microcontroller pin. Increase sampling resolution to 12-bit or higher if using an ADC.
Power-Up Sequence
Initialize the microcontroller’s ADC with the correct reference voltage–external 3.3V for ESP32, default 5V for Arduino. Run a startup calibration: read the baseline signal for 1–2 seconds and subtract it from subsequent measurements. If the signal drifts, implement software high-pass filtering with a cutoff frequency of 0.5Hz to remove DC offset.
Signal Conditioning Techniques for Accurate Pulse Detection
Apply a bandpass filter with cutoff frequencies of 0.5 Hz and 4 Hz to isolate biological signals from noise. This range captures typical resting oscillations while rejecting motion artifacts and powerline interference. For optimal performance, use a fourth-order Butterworth topology–its flat passband minimizes signal distortion better than Chebyshev or Bessel alternatives.
Implement automatic gain control (AGC) to normalize amplitude variations caused by electrode placement or skin impedance. A dynamic range of ±2.5 mV with a 0.1–10 V output ensures consistent peak detection across subjects. Combine AGC with a logarithmic amplifier for weak signals (below 0.5 mV) to maintain resolution without clipping.
Add a Schmitt trigger with hysteresis adjusted to 15–20% of the peak-to-peak input. This prevents false triggers from baseline drift while preserving sharp transitions. For microcontroller-based systems, set the upper threshold at 60% and lower at 40% of the expected signal amplitude to balance sensitivity and noise immunity.
Use a differentiator with a time constant of 50–100 ms to accentuate pulse transients before peak detection. Follow this with a squaring circuit to enhance signal-to-noise ratio–this works particularly well for low-amplitude inputs where simple thresholding fails. Test differentiator performance with both sine and square wave inputs to verify phase distortion remains under 5°.
Incorporate a moving average filter with a 1-second window to smooth erratic readings from irregular rhythms. For real-time applications, use a circular buffer of 128 samples at 100 Hz sampling rate to achieve a 1.28-second latency while reducing jitter by 70% compared to raw input.
For ambulatory devices, add a 50/60 Hz notch filter with a Q-factor above 30 to reject mains interference without attenuating adjacent frequencies. If using active filters, ensure op-amps have a slew rate of at least 10 V/μs to prevent distortion in the notch’s deep stopband. Calibrate the notch frequency dynamically by measuring ambient noise during startup.