Prototype a Portable Heart‑Rate Monitor from Scratch
Ever wonder why your smartwatch can tell you when you’re stressed, but a simple Arduino board can do the same thing for a few dollars? The answer is that the core of a heart‑rate monitor is just a tiny sensor, a bit of analog math, and a microcontroller that can count pulses. Building one yourself not only saves money, it also gives you a deeper feel for how the signal travels from skin to screen. Plus, it makes a great conversation piece at the next maker meetup.
Why a DIY Heart‑Rate Monitor?
I first tried a DIY pulse sensor in my college dorm. I taped a cheap infrared LED to my fingertip, watched the LED flicker on a cheap oscilloscope, and realized I could actually see my own heartbeat on a screen. That moment sparked a habit: whenever I see a gadget I like, I ask myself, “Can I build that with parts from my drawer?” A portable heart‑rate monitor is a perfect project because it blends analog front‑end design, PCB layout, and a bit of firmware—all things I love to share on Circuit Craft.
Parts List
Below is everything you need to build a single‑lead, battery‑powered monitor that fits in a small project box. All parts are readily available from Digi‑Key, Mouser, or your local electronics store.
- Microcontroller: ATmega328P‑P (the same chip used in Arduino Uno) – 1 pcs
- Pulse sensor: MAX30102 optical sensor module – 1 pcs
- Voltage regulator: MCP1700‑33 (3.3 V, 250 mA) – 1 pcs
- Battery: 3.7 V Li‑ion 500 mAh (or a 2‑cell AA pack with a boost converter) – 1 pcs
- Battery charger: TP4056 module (if using Li‑ion) – 1 pcs
- Display: 0.96" OLED I2C (SSD1306 driver) – 1 pcs
- Resistors: 10 kΩ (x2), 1 kΩ (x1) – 3 pcs
- Capacitors: 10 µF electrolytic, 0.1 µF ceramic – 2 pcs each
- Push button: Tactile switch for power on/off – 1 pcs
- Header pins: 2 mm male/female – assorted
- PCB: Two‑layer board, 2 × 3 inches – 1 pcs (you can also use a perfboard)
- Misc: Solder, heat‑shrink tubing, double‑sided tape, 3‑mm mounting screws
Total cost stays under $25 if you already have the microcontroller and basic passives.
Schematic Overview
Block Diagram
Battery → Voltage Regulator → ATmega328P → OLED Display
|
└─> MAX30102 (Pulse Sensor)
The regulator steps the battery voltage down to a stable 3.3 V, which powers both the microcontroller and the sensor. The ATmega reads the sensor over I²C, calculates beats per minute (BPM), and pushes the result to the OLED.
Circuit Diagram
-
Power Section – The Li‑ion cell connects to the TP4056 charger. The charger’s OUT+ and OUT‑ feed the MCP1700 regulator. A 10 µF capacitor sits right at the regulator’s input, and a 0.1 µF capacitor sits at its output to keep the voltage steady.
-
Microcontroller Section – The ATmega328P is wired in its “Arduino” configuration: VCC and AVCC both tied to 3.3 V, GND to ground, a 10 kΩ pull‑up on the RESET pin, and a 1 kΩ series resistor on the crystal pins (if you use an external 16 MHz crystal; otherwise you can run it at the internal 8 MHz clock).
-
Sensor Section – The MAX30102 uses two I²C lines: SDA (data) and SCL (clock). Both are pulled up to 3.3 V with 10 kΩ resistors. The sensor also needs a small decoupling capacitor (0.1 µF) close to its VCC pin.
-
Display Section – The OLED shares the same I²C bus as the sensor. Because the bus is only a few centimeters long on the board, the pull‑up resistors we already placed for the sensor are enough.
-
Control Button – A simple tactile switch connects the ATmega’s digital pin 2 to ground when pressed. The firmware uses this pin to toggle power‑saving mode.
All connections are shown in the attached PDF schematic (download from the Circuit Craft resources page). Keep the I²C traces short and parallel to reduce noise.
PCB Layout Tips
When I first laid out the board, I made the mistake of putting the sensor far from the regulator. The result was a jittery BPM reading that jumped between 60 and 120. The fix? Keep the sensor and its decoupling caps as close to the regulator’s output as possible, and route the I²C lines as a tight pair. A ground plane on the bottom layer helps shield the analog front end from the digital noise of the microcontroller.
Assembly Steps
1. Gather Components
Lay out all parts on a clean workspace. Double‑check the polarity of the battery connector, the regulator, and the OLED. A quick visual inspection saves a lot of re‑work later.
2. Solder the Power Section
Start with the TP4056 and MCP1700. These two chips sit side by side, so the battery’s + line runs straight from the charger to the regulator. Solder the input and output capacitors right next to the pins they belong to. Use a small amount of heat‑shrink tubing on the battery connector to avoid accidental shorts.
3. Mount the Microcontroller
If you’re using a pre‑programmed ATmega328P‑P, place it with the notch facing up. Solder the crystal (or rely on the internal clock) and the reset pull‑up resistor. Keep the pins tidy; a little bit of solder wick goes a long way.
4. Attach the Sensor and Display
The MAX30102 module often comes with pins already soldered. Align it so that the I²C pins (SDA, SCL) line up with the ATmega’s pins A4 and A5. The OLED can be placed opposite the sensor to balance the board. Solder the shared pull‑up resistors between VCC and the I²C lines.
5. Wire the Button
Solder the tactile switch to the edge of the board. Connect one side to ground and the other to digital pin 2. This button will let you turn the monitor on and off without unplugging the battery.
6. Test the Power Rail
Before you plug in the microcontroller, power the board with a bench supply set to 3.3 V. Measure the voltage at the ATmega’s VCC pin and at the sensor’s VCC pin. Both should read within 0.1 V of 3.3 V. If you see a drop, check for cold solder joints or a short.
7. Program the Firmware
Upload the simple Arduino sketch found on the Circuit Craft site. The code initializes the I²C bus, configures the MAX30102 for 100 Hz sampling, and runs a moving‑average filter to smooth the pulse waveform. The BPM calculation uses a peak‑detect algorithm that looks for rising edges spaced about 600 ms apart (typical resting heart rate). The result is drawn on the OLED with a clear, large font.
8. Enclose the Device
Drill two 3‑mm holes in the project box for the sensor’s LED and the button. Use double‑sided tape to secure the board inside, then snap the cover shut. The final size is about that of a credit card—easy to slip into a pocket or a small bag.
Troubleshooting Quick Guide
- No display output – Verify that the OLED’s VCC and GND are correct, and that the I²C pull‑ups are present. A common mistake is swapping SDA and SCL.
- Erratic BPM numbers – Check the sensor’s placement on your finger. Too much pressure can saturate the LED, while too little can cause weak signals. Adjust the finger clip or use a soft rubber band.
- Battery drains quickly – Make sure the ATmega is set to sleep mode when the button is not pressed. The MCP1700’s quiescent current is only 2 µA, so most of the draw comes from the microcontroller.
What I Learned
Building this monitor reminded me that the most satisfying part of making electronics is watching a raw analog signal turn into a readable number on a screen you built yourself. The whole process—from picking parts, drawing a schematic, laying out a PCB, to writing a few lines of code—reinforces the same loop of curiosity that drives every maker. If you’re looking for a project that touches every corner of hardware design, a portable heart‑rate monitor is a perfect fit.
Happy soldering, and may your pulse stay steady while you tinker!
- → How to Build a Safe DIY Electrolysis Kit with Everyday Parts @techbrewlab
- → Building a Budget DIY Test Lab: Essential Equipment and Setup Guide @probeinsights
- → DIY Power Connector Upgrade: Step‑by‑Step Build for Reliable Hardware @plugtechinsights
- → How to Diagnose and Fix Common Relay Failures in DIY Electronics Projects @relaychronicles
- → How to Build a Low‑Cost Arduino Power Supply for DIY Electronics Projects @techwiringinsights