1 Star 0 Fork 0

DFRobot/DFRobot_MAX30102

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
e- e update bf59af8 5年前
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

DFRobot_MAX30102 Heart-rate & Oximeter Sensor Library

DFRobot_MAX30102 MAX30102-based Heart-rate & Oximeter Sensor Library The MAX30102 is an integrated pulse oximetry and heart-rate monitor biosensor module based on PPG ((PhotoPlethysmoGraphy). It is so small that you can just wear it on your finger or wrist for data collecting. Internally integrated 18bit ADC, the sensor supports I2C data output, which could be compatible for most controllers.
Examples included in this library: real-time display basic reading on serial monitor; display heartbeat on serial plotter; heart-rate and SPO2 calculation
The library offers configuration methods of all registers for users to call so as to freely control MAX30102.

Table of Contents

Summary

  • Heartbeat recognition and heart rate display
  • SPO2 Measurement

Installation

To use this library, first download the library file, paste it into the \Arduino\libraries directory, then open the examples folder and run the demo in the folder.

Methods

  /*!
   *@brief Init Sensor
   *@param pWire IIC bus pointer object and construction device, can both pass or not pass parameters (Wire in default)
   *@param i2cAddr Chip IIC address (0x57 in default)
   *@return true or false
   */
  bool begin(TwoWire *pWire = &Wire, uint8_t i2cAddr = MAX30102_IIC_ADDRESS);

  /*!
   *@brief Use macro definition to configure sensor 
   *@param ledBrightness LED brightness, default value: 0x1F(6.4mA), Range: 0~255(0=Off, 255=50mA)
   *@param sampleAverage Average multiple samples then draw once, reduce data throughput, default 4 samples average
   *@param ledMode LED mode, default to use red light and IR at the same time 
   *@param sampleRate Sampling rate, default 400 samples every second 
   *@param pulseWidth Pulse width: the longer the pulse width, the wider the detection range. Default to be Max range 
   *@param adcRange ADC Measurement Range, default 4096 (nA),15.63(pA) per LSB
   */
  void sensorConfiguration(uint8_t ledBrightness = 0x1F, uint8_t sampleAverage = SAMPLEAVG_4, \
                           uint8_t ledMode = MODE_MULTILED, uint8_t sampleRate = SAMPLERATE_400, \
                           uint8_t pulseWidth = PULSEWIDTH_411, uint8_t adcRange = ADCRANGE_4096);

  /*!
   *@brief get red value 
   *@return Red light reading
   */
  uint32_t getRed(void);

  /*!
   *@brief Get IR value 
   *@return IR reading 
   */
  uint32_t getIR(void);

  /*!
   *@brief Get module temperature in unit °C
   *@return Float temperature 
   */
  float readTemperatureC();

  /*!
   *@brief Get module temperature in unit ℉
   *@return Float temperature 
   */
  float readTemperatureF();

  /*!
   *@brief Calculate heart rate and SPO2 
   *@param *SPO2                  [out]Calculated SPO2
   *@param *SPO2Valid             [out]If the calculated SPO2 is valid, the value is 1
   *@param *heartRate             [out]Calculated heart-rate
   *@param *heartRateValid        [out]If the calculated heart-rate is valid, the value is 1
   */
  void heartrateAndOxygenSaturation(int32_t* SPO2,int8_t* SPO2Valid,int32_t* heartRate,int8_t* heartRateValid);

Compatibility

MCU Work Well Work Wrong Untested Remarks
Arduino uno
Mega2560
Leonardo
ESP32
ESP8266
FireBeetle-M0

History

  • Data 2020-6-1
  • Version V0.1

Credits

Written by(hangyu.ye@dfrobot.com), 2020. (Welcome to our website)

Copyright 2010 DFRobot Co.Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dfrobot/DFRobot_MAX30102.git
git@gitee.com:dfrobot/DFRobot_MAX30102.git
dfrobot
DFRobot_MAX30102
DFRobot_MAX30102
master

搜索帮助