[ ](http://patriciogonzalezvivo.com/2013/ofxpulsesensor/ )
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.
Installing
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:
- Flash your Arduino with this firmware
- Connect the Arduino by USB to this computer and the PulseSensor to the arduino following this guide or this video
- Add this addon to your program (see arduino-example) and compile
In the RaspberryPi through the GPIOs:
-
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.
-
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. -
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
-
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:
- http://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi/connecting-the-cobbler-to-a-mcp3008
- http://raspberrypihobbyist.blogspot.com/2012/12/analog-interface.html