Pulse Sensor Speaker Tutorial
This Tutorial will show you how to connect a speaker to your Arduino UNO and use Pulse Sensor to make it 'beep' to your heartbeat!
Here's a list of materials you will need:
- Pulse Sensor
- Arduino IDE with Pulse Sensor Playground Library
- Arduino UNO
- 8 ohm Speaker
- Red LED
- 1K Resistor
- 470 ohm Resistor
- 10uF Capacitor
- A breadboard and some jumper wires
Our Pulse Sensor Arduino code is designed to find the moment of heart beat in the pulse waveform for accurate BPM calculation. Go to the Pulse Sensor Playground README for instructions on installing the Pulse Sensor Playground Library in Arduino. Once you've done that, navigate to
File > Examples > PulseSensor Playground > PulseSensor_Speaker
This example uses the Arduino analogWrite() command and will make a nice little beep when your heart beats! Let's lash up the circuit!
Follow the Frizing diagram at the top of this page. You can also refer to this schematic of what we're going to do
The LED is connected to Arduino pin 5. This pin will make the LED turn on when your heart beats, then it will fade softly for a nice effect. It is important to use at the very least a 470 ohm resistor. You can use up to 1K, but any less than 470 may result in weird behavior.
The 8ohm speaker is a standard device that you can pick up almost anywhere, or you can hack them out of old equipment if you like ;). The 1K resistor in between pin 3 and the speaker controls the volume of the beeps. Try different values for this resistor to increase or decrease the volume. The 10uF capacitor is there to protect the speaker from DC current which could damage it. Make sure to use the 10uF capacitor!
Once you have the circuit constructed, program your Arduino with the Speaker example sketch. Check out the code and comments for more in-depth info.