Source: https://mokxi.com/parts/pulsesensor
Updated: 2026-11-18

Part

# Pulse sensor

A green LED and a light sensor on a fingertip: the pulse as a wave on S, centered on half the supply.

See every part

- 3 pins
- 2 settings
- In 1 project
- In 1 lesson

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Pulse sensor in brief

What it is, and every setting the properties panel gives it.

The Pulse Sensor Amped puts a fingertip's pulse on one analog wire. A green LED shines into the skin and a light sensor sees how much light comes back. Each heartbeat pushes more blood into the finger, which takes more of the light, and an amplifier turns that into a wave on pin S. With no finger there, S sits at half the supply. Mokxi models the middle level, the beat shape with its main peak and dicrotic notch, and exact beat spacing of 60000 divided by bpm milliseconds. It does not model finger movement, drift, or beat to beat variation. The PulseSensor Playground library samples S every 2 ms in the background and finds each beat, so your loop can focus on drawing or acting. Use a threshold above the notch height, or just let the library find beats for you.

Family

Sensors

Pins

3

bpm

72

swing

0.8

A circuit built around it, running and explained: the Heart rate sensor simulator.

Pins

## 3 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

S

The pulse wave, the purple wire. Read it with analogRead().

VCC

Supply, 3 V to 5.5 V, the red wire.

GND

Ground, the black wire.

How to use it

## How to use the Pulse sensor with an Arduino

"Heartbeat monitor" is a built-in project with this part wired up to an Arduino Uno. A Pulse Sensor on a fingertip, with PulseSensor Playground finding the beats. It runs beside the words on the page, and it opens in the editor as it is drawn. The sketch draws the wave on an SSD1306 OLED with the heart rate above it, and the Uno's own LED on pin 13 blinks with each beat.

With the default settings, the serial monitor showed: "Mokxi Arduino Uno: heartbeat monitor" then "beat: 71 BPM ibi 842". That is a heart rate near the starting bpm of 72.

Changing the setting to a bpm of 120 gave: "Mokxi Arduino Uno: heartbeat monitor" then "beat: 119 BPM ibi 504" and "beat: 119 BPM ibi 500". The beats come faster and the ibi, the time between beats, drops from 842 to about 500 ms.

While it runs, the simulator reports the heart rate in beats a minute, 0 with no finger, plus 1000 while the main peak passes. The slider sets the rate, and all the way left means no finger.

Part pin

Goes to

VCC

Arduino Uno R3 pin 5V

GND

Arduino Uno R3 pin GND

S

Arduino Uno R3 pin A0

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3 · the first 45 lines

Common errors

## Common Pulse sensor errors and fixes

What goes wrong

The fix

Counting every rise above the middle as a beat, so the dicrotic notch is read as a second beat.

Use a threshold above the notch height, or use PulseSensor Playground, which waits for the main peak.

Reading the sensor only once a second and missing beats.

A beat lasts well under a second. Sample every few milliseconds or let the library sample every 2 ms.

No beats found because S sits near half the supply and the threshold is wrong.

Set the threshold a little above the middle, like the library default of 550 in the sketch.

Heart rate reads 0.

Check that a finger is on the sensor. The slider all the way left means no finger, and the rate reports 0.

Questions

## Questions and answers

### How do I wire a pulse sensor to an Arduino Uno?

Connect S to A0, VCC to 5V, and GND to GND. That is exactly how it is wired in the Heartbeat monitor project.

### Which library works with the pulse sensor?

PulseSensor Playground. It samples the signal every 2 ms in the background, finds each beat, and keeps the heart rate with getBeatsPerMinute().

### Why does my heart rate read 0?

The simulator reports 0 when there is no finger on the sensor. Move the slider right to simulate a finger with a heart rate.

### What do the pulse sensor settings mean?

bpm is the starting heart rate, 72 by default, or 0 for no finger. swing is how far the main peak rises above the middle, 0.8 by default.

How it is modeled

## What is true about the Pulse sensor, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The middle. S sits at half the supply, about 512 counts on a 5 V Uno, and the
wave rides on it, so a threshold a little above the middle (PulseSensor Playground's
default is 550) catches each beat.

The shape. Each beat is a quick rise to the main peak, a fall with a smaller bump
(the dicrotic notch) and a shallow dip before the next. A sketch that triggers on
any rise above the middle counts the notch as a second beat; one that waits for the
main peak does not.

The rate. The beats come exactly 60000 / bpm milliseconds apart.

### Not modeled

The light itself, a finger that moves or presses too hard, the slow drift as a
finger settles, and the small variation from beat to beat of a real heart. The wave
is a stand-in with its features in the right places, not a recording.

From Pulse sensor, in full.

Projects

## See the Pulse sensor in a project

One built-in project uses it. It opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

One lesson places it in its own circuit.

### Learn articles

1 lesson

- Arduino Pulse Sensor: Heart Rate on an OLED

Boards

## The boards it is shown on

This board has a built-in project with the Pulse sensor in it.

- Arduino Uno R3

Keep going

## Keep going

- MAX30102 pulse oximeter
- Heart monitor (ECG), AD8232

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Pulse sensor

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
