Measuring the Heart BeatHere is a video that shows the sensor you will build. This way, you know what to expect. We will use a sensor to get a plot of our heartbeat. Specifically, the sensor measures the IR light going through/off your skin. As blood pumps, this value changes. The graph portion starts at about 2:30 minutes.
|
|
Flip over your sensor and find the 4 prong labels (Vin, SDA, SCL, GND). That row should have soldered pins in it. Use 4 wires to connect the sensor to the Arduino following these directions.
Vin (volts in) to the 5V Arduino pin. GND (ground) to the GND Arduino pin. SDA to the Arduino A4 pin. SCL to the Arduino A5 pin. |
After you upload the code to the board successfully, check if the little red light came on that is on top of the sensor. If it did not, try these tips to get it to work.
1) Double check your wiring and reupload Also try replacing all 4 wires with new ones and reupload 2) Switch the A4 A5 pins and reupload 3) Unplug the Arduino from the computer and plug it back in 4) Unplug the 5V and GND from the Arduino, upload the code, plug the 5V and GND in again, and upload code |
If the red light is on, open the serial plotter. Need help? Ask a teacher!
|
Here is a screenshot of Mr. Dorsey's data from the serial plotter after it zooms.
Here are tips to get a good reading. 1) Use your thumb, it is bigger and has more blood flow. (Fun fact, you shouldn't take someone else's pulse with your thumb. You'll just feel your own pulse...) 2) Do not push down too hard on the sensor (that would restrict blood flow) 3) Keep pressure on the sensor as constant as possible. Hopefully values center on about the same values. |
4) Putting the sensor on a breadboard may also help so that you can just lay your hand loose on it.
|
Play around with your correction for awhile and find a good threshold value like I did in the above picture. Then add that if else statement for it to blink whenever the value falls below that point.
You can also attach your buzzer to pin 13 and ground and it will buzz each time your heart beats. Warning, it's pretty loud lol. |