OpenFramework addon to read that from PulseSensor develop by Joel Murphy and Yury Gitman.

This addon helps you get the heartbeat (BPM and IBI) and use it in your openFrameworks project using the GPIO's of your RaspberryPi or by using an Arduino to send the signal by Serial connection.


Clone this addon repository into your openFrameworks/addons folder:

cd openFrameworks/addons
git clone https://github.com/patriciogonzalezvivo/ofxPulseSensor

Setting Up

On you computer through an Arduino Using Arduino as Server and your laptop (tested on OSX) as a client:

  1. Flash your Arduino with this firmware
  2. Connect the Arduino by USB to this computer and the PulseSensor to the arduino following this guide or this video
  3. Add this addon to your program (see arduino-example) and compile

In the RaspberryPi through the GPIOs:


  1. RaspberryPi don't have analog-in like Arduino. That's why we are going to use MCP3008 to transform the resistance of the photocell into pulse frequency. Maybe you also want to by the Pi Cobbler breakout to make the connections easier.

  2. Everything is almost like this tutorial except that we are not using #23, #24 and #25 instead we are using SPI just like Jason Van Cleave and Andreas Muller did in this example. Off course instead of using a potentiometer the PulseSensor.

  3. Configure your RaspberryPi for wiringPi ( https://github.com/openFrameworks-RaspberryPi/openFrameworks/wiki/Raspberry-Pi-Using-the-GPIO-pins-with-Wiring-Pi-and-openFrameworks ).

    sudo nano /etc/modprobe.d/raspi-blacklist.conf

Comment with # (or remove) those lines

sudo reboot
  1. Add ofxPulseSensor to your addons.make file, compile and run as root. (Attention! Because the wiringPi the App need to be run in super user mode or sudo )

    make sudo make run

More References about Analog Inputs in RaspberryPi:

01 02 03

Check the Git Repository