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

Arduino UNO with MAX30102 Pulse Oximeter and I2C LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO with MAX30102 Pulse Oximeter and I2C LCD Display

Circuit Documentation

Summary

The circuit in question is designed to interface a MAX30102 sensor with an Arduino UNO microcontroller and display data on an I2C LCD 16x2 screen. The MAX30102 is a high-sensitivity pulse oximeter and heart-rate sensor that communicates with the Arduino UNO via I2C protocol. The Arduino UNO processes the data from the MAX30102 and outputs the information to the LCD screen, which also uses I2C for communication. The circuit is powered by the 5V output from the Arduino UNO, which is distributed to both the MAX30102 sensor and the LCD screen.

Component List

MAX30102 Sensor

Arduino UNO

I2C LCD 16x2 Screen

Wiring Details

MAX30102 Sensor

Arduino UNO

I2C LCD 16x2 Screen

Documented Code

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_MAX30105.h"
#include <LiquidCrystal_I2C.h>

Adafruit_MAX30105 max30102;  
LiquidCrystal_I2C lcd(0x27, 16, 2);  // Change 0x27 to your LCD I2C address

void setup() {
  lcd.begin();
  lcd.backlight();
  
  Serial.begin(115200);
  
  if (!max30102.begin()) {
    Serial.println("Could not find a valid MAX30102 sensor, check wiring!");
    while (1);
  }
  
  // Initialize sensor
  max30102.setup();  

  // Check if LCD is initialized properly
  if (!lcd) {
    Serial.println("LCD initialization failed, check wiring!");
    while (1);
  }
}

void loop() {
  // Generate random values for heartbeat and SpO2 for testing
  int heartbeat = random(60, 100);  // Random heartbeat between 60 and 100 BPM
  int spo2 = random(90, 100);       // Random SpO2 level between 90% and 100%
  
  lcd.clear();
  
  lcd.setCursor(0, 0);
  lcd.print("HB: ");
  lcd.print(heartbeat);
  lcd.print(" BPM");
  
  lcd.setCursor(0, 1);
  lcd.print("SpO2: ");
  lcd.print(spo2);
  lcd.print(" %");
  
  delay(1000);
}

Code Explanation