Introduction
In this article, we explore the max30100 sensor that measures heart rate and pulse oximetry in the human body. the sensor is used in various filed like smart-watch, medical field and Patient Monitoring. the sensor interfacing with the I2C through.is required only 4 wires like VCC, GND, SDA and SCL.
- Now we interface the MAX30100 Sensor with Arduino & ESP8266. The pulse rate and heart rate will display in the serial monitor as well 16×2 LCD Display. Both devices are interfacing with I2C Through (LCD & MAX30100).
- We take all images to the MAX30100 Sensor Datasheet.
Principle of operation
- The MAX30100 utilizes the principle of photoplethysmography to detect changes in blood volume and oxygen saturation in peripheral tissues.
- It works by emitting a specific wavelength of light, typically in the red or infrared spectrum, into the skin and measuring the amount of light reflected back.
This Image will show how the internal sensor work.
- When blood pulses through the capillaries, it absorbs more light, leading to a decrease in the reflected light intensity.
- By analyzing these variations in light intensity, the sensor can determine the heart rate and approximate blood oxygen saturation level.
Specification of MAX30100 Sensor
PPG Sensor
-
- The wavelength is 660nm or 940nm.
- The Sampling Rate is 320 samples per second.
- The Dynamic Range is 6,000:1 and 10,000:1.
- The LED Current Range is 0mA to 50mA.
Ambient Light Sensor
-
- Photodiode: Built-in ambient light photodiode.
- Ambient Light Rejection: Provides ambient light cancellation and ambient light intensity compensation.
ADC and DSP
-
- ADC Converter: 8-bit resolution.
- Digital Signal Processor: Processing, filtering, and noise reduction.
Communication
-
- Interface: I2C (Inter-Integrated Circuit).
- I2C Address: (0x57).
Power
-
- Supply Voltage: 1.8V and 3.3V.
- Current Consumption: Low power consumption.
Advantage of MAX30100 Sensor
- Compact and Integrated Design
- Non-Invasive Measurement
- Real-Time Monitoring
- Low Power Consumption
Disadvantage of MAX30100 Sensor
- Limited Operating Range
- Sensitivity to Motion Artifacts
- Ambient Light Interference
- Limited Communication Interface
Application of MAX30100 Sensor
- Medical Monitoring Devices
- Remote Patient Monitoring.
- Sports and Fitness
- Wearable Devices
Example With Arduino
Circuit Diagram With Arduino
Code with the serial monitor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#include <Wire.h> #include "MAX30100_PulseOximeter.h" #define REPORTING_PERIOD_MS 1000 PulseOximeter pox; uint32_t tsLastReport = 0; void onBeatDetected() { Serial.println("Beat!"); } void setup() { Serial.begin(115200); Serial.print("Initializing pulse oximeter.."); if (!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("%"); tsLastReport = millis(); } } |
Code with 16×2 LCD Display
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
#include <LiquidCrystal.h> #include <Wire.h> #include "MAX30100_PulseOximeter.h" LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #define REPORTING_PERIOD_MS 1000 PulseOximeter 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(); if (!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(); } } |
Circuit Diagram With ESP8266
Code With ESP8266
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
#include <Wire.h> #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include "MAX30100_PulseOximeter.h" #include <SimpleTimer.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); char auth[] = "6497f4ca30"; char ssid[] = "JustDo"; char pass[] = "par12345"; #define REPORTING_PERIOD_MS 3000 SimpleTimer timer; PulseOximeter pox; uint32_t tsLastReport = 0; void onBeatDetected() { ; } void setup() { Serial.begin(9600); Wire.begin(D2, D1); lcd.begin(); lcd.backlight(); lcd.setCursor(3, 0); lcd.print("Welcome To"); lcd.setCursor(0, 1); lcd.print("JustDoElectronic"); delay(3000); lcd.clear(); lcd.setCursor(6, 0); lcd.print("IoT"); lcd.setCursor(1, 1); lcd.print("Pulse Oximeter"); delay(3000); lcd.clear(); Serial.begin(115200); Blynk.begin(auth, ssid, pass); Serial.print("Initializing pulse oximeter.."); if (!pox.begin()) { Serial.println("FAILED"); for (;;) ; } else { Serial.println("SUCCESS"); digitalWrite(1, HIGH); } pox.setIRLedCurrent(MAX30100_LED_CURR_24MA); pox.setOnBeatDetectedCallback(onBeatDetected); timer.setInterval(1000L, getSendData); } void loop() { timer.run(); Blynk.run(); pox.update(); if (millis() - tsLastReport > REPORTING_PERIOD_MS) { Serial.print("BPM: "); Serial.print(pox.getHeartRate()); Serial.print(" SpO2: "); Serial.print(pox.getSpO2()); Serial.print("%"); Serial.println("\n"); lcd.clear(); lcd.setCursor(0, 0); lcd.print("BPM: "); lcd.setCursor(10, 0); lcd.print(pox.getHeartRate()); lcd.setCursor(0, 1); lcd.print("SpO2:"); lcd.setCursor(10, 1); lcd.print(pox.getSpO2()); lcd.setCursor(14, 1); lcd.print("%"); Blynk.virtualWrite(V2, pox.getHeartRate()); Blynk.virtualWrite(V3, pox.getSpO2()); tsLastReport = millis(); } } void getSendData() { } |
Video
Conclusion
The MAX30100 sensor is a versatile and compact module used for pulse oximetry and heart-rate monitoring applications. Utilizing PPG and ambient light sensing technologies, enables non-invasive measurement of heart rate and blood oxygen saturation levels, making it a valuable component in various healthcare and wearable devices.
Sensor