Pulse Oximeter Sensor with Arduino
Pulse Oximeter Sensor with Arduino
Interfacing MAX30100 Pulse Oximeter Sensor with Arduino & LCD Display
A pulse oximeter is a device used to monitor both your heart rate and blood oxygen concentration. This device is especially important for people who need to monitor these parameters due to certain health conditions, such as asthma or congestive heart failure.
In this project, 16X2 LCD Display is used to see the value of BPM & SpO2 instead of Serial Monitor. Assemble the circuit as shown in the circuit diagram below.
Connect the Vin pin of MAX30100 to Arduino 5V or 3.3V pin, GND to GND. Connect the I2C Pin, SCL & SDA of MAX30100 to A5 & A4 of Arduino. Similarly connect the LCD pin 1, 5, 16 to GND of Arduino and 2, 15 to 5V VCC. Similarly connect LCD pin 4, 6, 11, 12, 13, 14 to Arduino pin 13, 12, 11, 10, 9, 8. Use 2-10K Potentiometer at pin 3 of LCD to adjust the contrast of LCD.
MAX30100-
If you purchased the MAX30100 Module shown below, then it might not work. The MAX30100 IC uses 1.8V for VDD and this particular module uses two regulators to achieve this voltage. Nothing wrong with that.As you can see the SCL and SDA pins are pulled-up via the 4.7k ohm resistors to 1.8V! This means it won’t work well with microcontrollers with higher logic levels.
So to operate it with the higher logic level (3.3V), cut the path in the place of the red cross and make a jumper connection as shown by the yellow line.
CODE:-
#include <LiquidCrystal.h>#include <Wire.h>#include "MAX30100_PulseOximeter.h"LiquidCrystal lcd(13, 12, 11, 10, 9, 8);#define REPORTING_PERIOD_MS 1000PulseOximeter pox;uint32_t tsLastReport = 0;void onBeatDetected(){Serial.println("Beat!");}void setup(){Serial.begin(115200);Serial.print("Initializing pulse oximeter..");lcd.begin(16,2);lcd.print("Initializing...");delay(3000);lcd.clear();power supplyif (!pox.begin()) {Serial.println("FAILED");for(;;);} else {Serial.println("SUCCESS");}pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);pox.setOnBeatDetectedCallback(onBeatDetected);}void loop(){pox.update();if (millis() - tsLastReport > REPORTING_PERIOD_MS) {Serial.print("Heart rate:");Serial.print(pox.getHeartRate());Serial.print("bpm / SpO2:");Serial.print(pox.getSpO2());Serial.println("%");lcd.clear();lcd.setCursor(0,0);lcd.print("BPM : ");lcd.print(pox.getHeartRate());lcd.setCursor(0,1);lcd.print("SpO2: ");lcd.print(pox.getSpO2());lcd.print("%");tsLastReport = millis();}}
Comments
Post a Comment