Introduction
This experiment demonstrates how to use a pulse oximeter to measure heart rate and blood oxygen levels with Arduino.
Components Needed
- Pulse Oximeter Sensor
- Arduino
- Jumper Wires
Circuit Setup
- Connect the pulse oximeter sensor to the Arduino using the specified pins (usually VCC, GND, SCL, and SDA for I2C).
The pulse oximeter measures the heart rate and blood oxygen saturation levels by emitting light through the finger and measuring the reflected light.
Code for Pulse Oximeter
Upload the following code to your Arduino to read the pulse and oxygen levels:
#include
#include
#include
Adafruit_PulseOximeter pox;
void setup() {
Serial.begin(9600);
if (!pox.begin()) {
Serial.println("Couldn't find Pulse Oximeter sensor");
while (1);
}
}
void loop() {
if (pox.update()) {
Serial.print("Heart Rate: ");
Serial.print(pox.getHeartRate());
Serial.print(" bpm, Oxygen Saturation: ");
Serial.print(pox.getSpO2());
Serial.println(" %");
}
delay(1000);
}
Explanation
The pulse oximeter works by passing light through the finger and detecting how much of the light is absorbed by the blood, which gives readings for blood oxygen saturation and heart rate.
Troubleshooting
- If readings are inaccurate, check that the sensor is positioned correctly on the finger and ensure the wiring is secure.
- If the sensor isn't detected, check the I2C wiring and libraries.