Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano-Based Heart Rate and SpO2 Monitor with MAX30102 Sensor

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Heart Rate and SpO2 Monitor with MAX30102 Sensor

Circuit Documentation

Summary

This circuit consists of an Arduino Nano microcontroller connected to a MAX30102 Heart Rate and SpO2 sensor. The Arduino Nano reads data from the sensor and processes it to determine heart rate and SpO2 levels, which are then output via the serial monitor.

Component List

Arduino Nano

MAX30102 HR + SpO2 Sensor

Wiring Details

Arduino Nano

MAX30102 HR + SpO2 Sensor

Code Documentation

Arduino Nano Code

#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"

MAX30105 particleSensor;

void setup() {
  Serial.begin(115200);
  Wire.begin();

  if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) {
    Serial.println("MAX30102 was not found. Please check wiring/power.");
    while (1);
  }

  particleSensor.setup();
  particleSensor.setPulseAmplitudeRed(0x0A); // Turn Red LED to low to indicate sensor is running
  particleSensor.setPulseAmplitudeGreen(0); // Turn off Green LED
}

void loop() {
  long irValue = particleSensor.getIR();

  if (checkForBeat(irValue) == true) {
    float beatsPerMinute = 60 / getTimeBetweenBeats();
    Serial.print("BPM: ");
    Serial.print(beatsPerMinute);
    Serial.print(", SpO2: ");
    Serial.println(computeSpO2());
  }

  delay(1000);
}

float computeSpO2() {
  // Placeholder function for SpO2 computation
  // Implement SpO2 algorithm here
  return 98.0; // Dummy value for SpO2
}

This code initializes the MAX30102 sensor and sets up the Arduino Nano to read data from the sensor. The setup function configures the sensor and the loop function continuously reads the IR value from the sensor. If a heartbeat is detected, it calculates the beats per minute (BPM) and a placeholder SpO2 value, which are then printed to the serial monitor.