Skip to content

Commit 8ac7e2a

Browse files
committed
built out the Arduino readme
1 parent 3add5f6 commit 8ac7e2a

File tree

9 files changed

+32
-3
lines changed

9 files changed

+32
-3
lines changed

PulseSensor_Arduino_Pi/PulseSensor_Arduino_Pi.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,37 @@ Once the Manager has settled down, type `PulseSensor` into the search field and
6262
Install the latest version, and we're ready to program Arduino!
6363

6464
## Program Arduino
65-
For this example, we're going to use an Arduino Uno. The playground works with just just about everything. If you're having trouble connecting Pulse Sensor with anything, please use the issues tab. Go get your Arduino and follow our [getting started guides]().
65+
For this example, we're going to use an Arduino Uno. The playground works with just just about everything. If you're having trouble connecting Pulse Sensor with anything, please use the issues tab. If this is your first time using Pulse Sensor, check out our [handy guide](https://docs.google.com/document/d/1d8EwDcXH1AZpIpEnrET28EBgStrbkbppxjQZcNRAlkI/edit?usp=sharing) for getting your Pulse Sensor set up to read beats. We also have lots of [tutorials](https://pulsesensor.com/).
6666

67-
t o b e c o n t i n u e d . . .
68-
67+
Plug your Arduino into an unused USB cable on RasPi. Then open up Arduino IDE, and select the PulseSensor_BPM sketch from the examples folder.
68+
69+
![examplesPulsSensor_BPM](../images/exampleSketch.png)
70+
71+
Now, you have to select the serial port that your Arduino UNO is connected to. Click `Tools > Port` to find the right one. UNO is easy to find.
72+
73+
![selectPort](../images/selectPort.png)
74+
75+
Press the upload button on Arduino IDE to upload the sketch.
76+
77+
![upload](../images/uploadButton.png)
6978

79+
This example sketch is designed to send pulse data right to the Arduino Serial plotter. Once it's uploaded, click on `Tools > Serial Plotter` to open it up and see the plot. **NOTE: make sure that the baud rate is set to 115200 in the bottom right corner of the Serial Plotter!**
7080

81+
![SerialPlotter_5V](../images/serialPlotter5V.png)
82+
83+
This pulse signal is a bit noisy. That's because the power coming out of the USB on the RasPi is pretty noisy. To fix this, you can run the Pulse Sensor on 3V. Here's how you do that.
84+
85+
First, you need to make sure that Arduino and Pulse Sensor are working at 3.3V. I'm going to use a breadboard and some jumper wires to set this up. Find the 3.3V pin on the Arduino, and connect it to the breadboard red rail. Then also connect the Arduino `AREF` pin to the breadboard red rail. This will show Arduino how you want to measure analog signals. Connect the Pulse Sensor as usual, but make sure that the Pulse Sensor red wire is connected to the breadboard red rail. Here's a fritzing diagram to help you out.
86+
87+
![arduinoAref](../images/PulseSensorUno3V3.png)
88+
89+
The last thing you have to do, is tell the Arduino that we want it to read the `AREF` pin when it reads analog signals. Put the following code into the `setup()` of the PulseSensor_BPM example sketch.
90+
91+
analogReference(EXTERNAL);
92+
93+
Then upload to the UNO. Now, when you open the Serial Plotter, you will see a much cleaner signal.
7194

95+
![serialPlotter3V3](../images/serialPlotter3V3.png)
7296

7397

7498

PulseSensor_C_Pi/PulseSensor_C_Pi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Pi may ask you to reboot, so go ahead and do that, otherwise arrow your way to `
3030

3131

3232
## Connect your Pulse Sensor to Raspberry Pi
33+
If this is your first time using Pulse Sensor, check out our [handy guide](https://docs.google.com/document/d/1d8EwDcXH1AZpIpEnrET28EBgStrbkbppxjQZcNRAlkI/edit?usp=sharing) for getting your Pulse Sensor set up to read beats. We also have lots of [tutorials](https://pulsesensor.com/).
34+
3335
The Pulse Sensor outputs an analog signal, which the RasPi cannot natively handle. In the examples below, we are using an Analog to Digital Converter (ADC) IC to digitize the Pulse Sensor signal. As of this writing, the code below supports the MCP3008 ADC IC. (You could use the MCP3004 if you like). The Wiring Pi library has functions that enable us to easily access data from the MCP3008. You can pick one up at [Mouser](https://www.mouser.com/ProductDetail/Microchip-Technology/MCP3008-I-SL?qs=BYQkrObauiuZK6Atf%2FfReA%3D%3D&gclid=CjwKCAjwhbHlBRAMEiwAoDA343G0yGlECsWZ5zo-5UbrMk58sLaK11XtHWNU8w9fzKlpIiY343y0YBoCrBgQAvD_BwE) or [SparkFun](https://www.sparkfun.com/products/15099) or [Adafruit](https://www.adafruit.com/product/856).
3436

3537
The RasPi interfaces the MCP3008 via the hardware SPI pins. Here's a diagram to help you assemble the circuit.

PulseSensor_Processing_Pi/PulseSensor_Processing_Pi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ In the next pane, arrow down to the SPI option and enable it.
2929
Pi may ask you to reboot, so go ahead and do that, otherwise arrow your way to `<Finish>` and get out of the config menu.
3030

3131
## Connect your Pulse Sensor to Raspberry Pi
32+
If this is your first time using Pulse Sensor, check out our [handy guide](https://docs.google.com/document/d/1d8EwDcXH1AZpIpEnrET28EBgStrbkbppxjQZcNRAlkI/edit?usp=sharing) for getting your Pulse Sensor set up to read beats. We also have lots of [tutorials](https://pulsesensor.com/).
33+
34+
3235
The Pulse Sensor outputs an analog signal, which the RasPi cannot natively handle. In the examples below, we are using an Analog to Digital Converter (ADC) IC to digitize the Pulse Sensor signal. As of this writing, the code below supports the MCP3008 ADC IC. (You could use the MCP3004 if you like). The Wiring Pi library has functions that enable us to easily access data from the MCP3008. You can pick one up at [Mouser](https://www.mouser.com/ProductDetail/Microchip-Technology/MCP3008-I-SL?qs=BYQkrObauiuZK6Atf%2FfReA%3D%3D&gclid=CjwKCAjwhbHlBRAMEiwAoDA343G0yGlECsWZ5zo-5UbrMk58sLaK11XtHWNU8w9fzKlpIiY343y0YBoCrBgQAvD_BwE) or [SparkFun](https://www.sparkfun.com/products/15099) or [Adafruit](https://www.adafruit.com/product/856).
3336

3437
The RasPi interfaces the MCP3008 via the hardware SPI pins. Here's a diagram to help you assemble the circuit.

images/PulseSensorUno3V3.png

142 KB
Loading

images/exampleSketch.png

77.6 KB
Loading

images/selectPort.png

37.1 KB
Loading

images/serialPlotter3V3.png

87.4 KB
Loading

images/serialPlotter5V.png

78.6 KB
Loading

images/uploadButton.png

12.1 KB
Loading

0 commit comments

Comments
 (0)