How to Wire MAX30100 Heart Rate Monitor With Arduino Microcontroller

About: something about yourself so our community can get to know you! ??

Intro: How to Wire MAX30100 Heart Rate Monitor With Arduino Microcontroller

This is the MAX300100 breakout board that reads heart rate or pulse oximetry. The chip has an integrated optical sensor that derives its reading from emitting two wavelength of light from the two LED’s then measures the absorbance of pulsing blood through a photodetector. The signal is processed by a low noise analog signal processing unit and communicated to the Microcontroller through the i2C Interface.

The MAX30100 operates from 1.8v and 3.3v voltage input and can be powered down through software with negligible standby current, permitting the power supply to remain connected at all times. The device is suitable for wearable devices like smart watch, medical monitoring equipment’s, fitness assistant and smart suits. Required Components Arduino Microcontroller, ESP8266 (Arduino IDE Integrated), Teensy MCU (TeensyDuino Integrated),Buzzer / Alarm (Optional)LCD / OLED i2C Display (Optional)Solder Less BreadboardJumper Wire

Step 1: Source Code

#include #include #include #include #include #include #include #define REPORTING_PERIOD_MS 500 /* PulseOximeter is the higher level interface to the sensor That offers: > Beat Reporting > Heart Pulse Rate Calculation > SP02 OXIDATION LEVEL Calculation */ PulseOximeter pox; const int numReadings=10; float filterweight=0.5; uint32_t tsLastReport = 0; uint32_t last_beat=0; int readIndex=0; int average_beat=0; int average_SpO2=0; bool calculation_complete=false; bool calculating=false; bool initialized=false; byte beat=0; void onBeatDetected() //Calls back when pulse is detected { viewBeat(); last_beat=millis(); } void viewBeat() { if (beat==0) { Serial.print("_"); beat=1; } else { Serial.print("^"); beat=0; } } void initial_display() { if (not initialized) { viewBeat(); Serial.print("14CORE | MAX30100 Pulse Oximeter Test"); Serial.println("--------------------------------------"); Serial.println("Place place your finger on the sensor"); Serial.println("--------------------------------------"); ; initialized=true; } } void display_calculating(int j){ viewBeat(); Serial.println("Measuring"); for (int i=0;i<=j;i++) { Serial.print(". "); } } void display_values() { Serial.print(average_beat); Serial.print("| Bpm "); Serial.print("| SpO2 "); Serial.print(average_SpO2); Serial.print("%"); } void calculate_average(int beat, int SpO2) { if (readIndex==numReadings) { calculation_complete=true; calculating=false; initialized=false; readIndex=0; display_values(); } if (not calculation_complete and beat>30 and beat<220 and SpO2>50) { average_beat = filterweight * (beat) + (1 - filterweight ) * average_beat; average_SpO2 = filterweight * (SpO2) + (1 - filterweight ) * average_SpO2; readIndex++; display_calculating(readIndex); } } void setup() { Serial.begin(115200); pox.begin(); pox.setOnBeatDetectedCallback(onBeatDetected); } // Make it sure that you need to call update as fast as possible void loop() { pox.update(); if ((millis() - tsLastReport > REPORTING_PERIOD_MS) and (not calculation_complete)) { calculate_average(pox.getHeartRate(),pox.getSpO2()); tsLastReport = millis(); } if ((millis()-last_beat>10000)) { calculation_complete=false; average_beat=0; average_SpO2=0; initial_display(); } }

Step 2: Download Codes

http://www.14core.com/wiring-the-max30100-heart-ra...

Downloads Source Code | Txt File

Download the MAX30100 Code Libraries | Zip

Download the MAX30100 Datasheet | Pdf

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Fix It! Contest

      Fix It! Contest

    3 Discussions

    0
    None
    www.pvl.vn

    2 months ago

    Could you show me how to connect and read data by using Raspberry?

    Thank you very much!

    0
    None
    Jana Shree

    7 months ago

    I have a doubt....my max30100 is not responding to the I2C scanner code
    I have checked my code with other I2C devices the cord works fine but with max30100 it is not working
    what problem do I have?? please help
    thanks in advance

    My I2C code,
    // --------------------------------------
    // i2c_scanner
    //
    // Version 1
    // This program (or code that looks like it)
    // can be found in many places.
    // For example on the Arduino.cc forum.
    // The original author is not know.
    // Version 2, Juni 2012, Using Arduino 1.0.1
    // Adapted to be as simple as possible by Arduino.cc user Krodal
    // Version 3, Feb 26 2013
    // V3 by louarnold
    // Version 4, March 3, 2013, Using Arduino 1.0.3
    // by Arduino.cc user Krodal.
    // Changes by louarnold removed.
    // Scanning addresses changed from 0...127 to 1...119,
    // according to the i2c scanner by Nick Gammon
    // http://www.gammon.com.au/forum/?id=10896
    // Version 5, March 28, 2013
    // As version 4, but address scans now to 127.
    // A sensor seems to use address 120.
    // Version 6, November 27, 2015.
    // Added waiting for the Leonardo serial communication.
    //
    //
    // This sketch tests the standard 7-bit addresses
    // Devices with higher bit address might not be seen properly.
    //

    #include


    void setup()
    {
    Wire.begin();

    Serial.begin(9600);
    while (!Serial); // Leonardo: wait for serial monitor
    Serial.println("\nI2C Scanner");
    }


    void loop()
    {
    byte error, address;
    int nDevices;

    Serial.println("Scanning...");

    nDevices = 0;
    for(address = 1; address {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
    Serial.print("I2C device found at address 0x");
    if (address
    Serial.print("0");
    Serial.print(address,HEX);
    Serial.println(" !");

    nDevices++;
    }
    else if (error==4)
    {
    Serial.print("Unknown error at address 0x");
    if (address
    Serial.print("0");
    Serial.println(address,HEX);
    }
    }
    if (nDevices == 0)
    Serial.println("No I2C devices found\n");
    else
    Serial.println("done\n");

    delay(5000); // wait 5 seconds for next scan
    }




    0
    None
    rohanap1

    11 months ago

    Can I use wrist to measure heart rate using MAX30100 ?