🩺

Introduction to Pulse Oximetry with Raspberry Pi

Sep 8, 2024

Embedded Projects Lecture Notes

Introduction to Pulse Oximetry using Raspberry Pi

  • Pulse Oximetry: Non-invasive method for monitoring pulse and oxygen saturation.
  • Objective: Measure both pulse oximetry and heart rate using Raspberry Pi and the MAX30100 sensor.

Sensor Overview: MAX30100

  • Functionality: Integrated pulse oximeter and heart rate monitor.
  • Signal Processing: Low noise analog signal processing for better quality detection.
  • Communication: I2C (Inter-Integrated Circuit) communication protocol.
    • I2C Characteristics:
      • Asynchronous multi-master/multi-slave.
      • Suitable for low-speed peripheral ICs.
      • Invented by Philips Semiconductor.

Understanding Oximetry

  • Oximetry Definition: Measures a person's oxygen saturation (fraction of oxygen related to hemoglobin).
  • Importance: Human body requires a precise balance of oxygen in the blood.
  • Sensor Enclosure: Ideally, keep the sensor in an enclosed space to avoid external light interference.

Connecting MAX30100 to Raspberry Pi

Required Connections

  • Wires: VCC, Ground, SDA, SCL (4-wire connection).
  • Power Supply: Can use either 3.3V or 5V (5V recommended).
  • Connections:
    • GND: Ground to sensor and GPIO.
    • SDA: Sensor SDA to GPIO SDA.
    • SCL: Sensor SCL to GPIO SCL.

Raspberry Pi Setup

  1. VNC Connection: Access Raspberry Pi through VNC.
  2. Enabling I2C:
    • Command: sudo raspi-config
    • Navigate to Interfacing Options âž” I2C âž” Enable.
  3. Verification:
    • After reboot, check in cat boot config.txt to see if I2C is enabled (dtparam=i2c_arm=on).
    • Use sudo i2cdetect -y 1 to check connected I2C devices.
    • MAX30100 I2C address: 0x57.

Downloading Libraries and Test Applications

  • GitHub Repository: Download the library and test application files for MAX30100.
  • File Structure: Contains max30100.py (library) and test_max30100.py (test application).

Code Overview

  • Programming Language: Python (suitable for Raspberry Pi).
  • Main Components of Code:
    • Import libraries (MAX30100 and Time).
    • Create an instance of MAX30100 class.
    • Enable SpO2 measurement.
    • Read sensor data in a loop and print values (IR and Red).
  • Stabilization: Initial readings may give junk values; placing a finger stabilizes readings over time.

Testing the Sensor

  • Execution: Run the test file to start reading values from the sensor.
  • Expected Outcome: Stabilized readings for pulse and SpO2 values displayed.
  • Calibration Suggestion: In case of discrepancies, calibrate readings accordingly.
  • Buffer Values: Observe stored buffer values over time.

Conclusion

  • Integration: Simple integration of the MAX30100 sensor with Raspberry Pi.
  • Next Steps: Use the code and library in actual application development.