打印
[活动专区]

【AT-START-F437测评】+I2C采集max30102血氧数据

[复制链接]
4456|28
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 skylove1233 于 2023-2-2 14:22 编辑

#申请原创# @21小跑堂 前言
收到开发板有一段时间了,前段时间由于年底工作忙+阳了等原因,一直没来的及评测。正好前段时间血氧仪涨价,就参照网上的血氧仪制作教程,写了个血氧和心率采集的系统。
血氧心率采集系统组成
系统框图和接线方式如下所示:

此系统中,AT32F437通过I2C接口与MAX30102连接,MAX30102配置后,开始采集数据,出发MAX30102的中断,AT32F437判断中断引脚IM的GPIO值,为0时,则对数据以SPO2的算法进行计算,计算出血氧浓度和心率后,将结果通过USART1传到串口调试助手。

MAX30102
MAX30102是一个集成的脉搏血氧仪和心率监测仪生物传感器的模块。它集成了一个红光LED和一个红外光LED、光电检测器、光器件,以及带环境光抑制的低噪声电子电路。MAX30102采用一个1.8V电源和一个独立的5.0V用于内部LED的电源。从某宝买大概7块钱左右,长这样:

MAX30102本身自带18位高精度ADC,使用I2C接口与外接MCU通信。而且自身还有FIFO,可以减轻MCU负担,降低功耗。
MAX30102的发光部分包括两个LED,一个是红光LED(660nm),另一个是红外光LED(880nm),这个是测量血氧饱和度SPO2最常见的配置。接收部分是一个对可见光和红外光都敏感的光电二极管,其接收的光强度信号转换为电流信号,经过环境光消除电路后,最后被自带的18位ADC进行采样转化,至此模拟部分完成。AD转化后的数字经过数字滤波后储存在数据寄存器中,最后可通过I2C总线被外接MCU读取。
在使用MAX30102时,我们主要做的事情有:
(1)MAX30102 I2C驱动编写
其中,驱动编写时参考MAX30102的标准,通过i2c总线对MAX30102进行一些寄存器的配置。因此,需要知道MAX30102的读地址和写地址。通过阅读MAX30102的官方文档,可查到,读地址为0XAE,写地址为0xAF。如下所示:

写MAX30102寄存器时,我们使用了AT官方固件库中的i2c_memory_write函数,读寄存器时,使用i2c_memory_read。使用固件库的好处就在于,官方帮我们屏蔽了I2C协议的实现细节,我们只要知道I2C怎么使用即可。而且,雅特力官方的文档真的是我用过的开发板中,最详细的了,没有之一,所以开发起来很快乐。
(2)MAX30102 血氧算法编写
驱动编写完,实现了对MAX30102的初始化,就要从MAX30102读FIFO数据了,这时就要编写算法了。

MAX30102传感器上具有红光(660nm)和红外光(880nm)两个LED,人体氧合血氧蛋白和非氧合血氧蛋白对这两个不同波长的光吸收率的差异较为明显。可以据此得出血氧饱和度。

官方提供的方法如下:


参照此算法,进行一些滤波即可得出最终结果。

具体代码
main.c

//各引脚初始化
void gpio_config(void)
{
        gpio_init_type gpio_init_struct;
  /* enable the gpioa clock */
  crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);

  /* set default parameter */
  gpio_default_para_init(&gpio_init_struct);
        
  /* configure button pin as input with pull-up/pull-down */
  gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
  gpio_init_struct.gpio_out_type  = GPIO_OUTPUT_PUSH_PULL;
  gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
  gpio_init_struct.gpio_pins = GPIO_PINS_9;  //MAX30102中断引脚
  gpio_init_struct.gpio_pull = GPIO_PULL_UP;
  gpio_init(GPIOB, &gpio_init_struct);
        
}

/**
  * [url=home.php?mod=space&uid=247401]@brief[/url]  main function.
  * @param  none
  * @retval none
  */
int main(void)
{
  //i2c_status_type i2c_status;

  /* initial system clock */
  system_clock_config();

  /* config nvic priority group */
  nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);

  /* at board initial */
  at32_board_init();//初始化LED

  hi2c2.i2cx = I2Cx_PORT;

  /* i2c config */
  i2c_config(&hi2c2); //初始化I2C
  gpio_config(); //初始胡GPIO
  uart_print_init(115200);//初始化串口

        
  max30102_init();
  while(1)
  {
         if (gpio_input_data_bit_read(GPIOB, GPIO_PINS_9) == 0)  //当采集到数据
        {        
                at32_led_toggle(LED4);   //LED4翻转
                max30102_cal();  //计算血氧浓度
                uint8_t spo2 = max30102_getSpO2();
                uint8_t heartReat = max30102_getHeartRate();
                printf("spos2= : [%d] heartReat = [%d] \n",spo2,heartReat);//上传数据到串口
               
         }
         
        
}
}

/**
  * [url=home.php?mod=space&uid=247401]@brief[/url]  initializes peripherals used by the i2c.
  * @param  none
  * @retval none
  */
void i2c_lowlevel_init(i2c_handle_type* hi2c)
{
  gpio_init_type gpio_init_structure;

  if(hi2c->i2cx == I2Cx_PORT)
  {
    /* i2c periph clock enable */
    crm_periph_clock_enable(I2Cx_CLK, TRUE);
    crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
    crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);

    /* gpio configuration */
    gpio_pin_mux_config(I2Cx_SCL_GPIO_PORT, I2Cx_SCL_GPIO_PinsSource, I2Cx_SCL_GPIO_MUX);

    gpio_pin_mux_config(I2Cx_SDA_GPIO_PORT, I2Cx_SDA_GPIO_PinsSource, I2Cx_SDA_GPIO_MUX);

    /* configure i2c pins: scl */
    gpio_init_structure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
    gpio_init_structure.gpio_mode           = GPIO_MODE_MUX;
    gpio_init_structure.gpio_out_type       = GPIO_OUTPUT_OPEN_DRAIN;
    gpio_init_structure.gpio_pull           = GPIO_PULL_UP;

    gpio_init_structure.gpio_pins           = I2Cx_SCL_GPIO_PIN;
    gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_init_structure);

    /* configure i2c pins: sda */
    gpio_init_structure.gpio_pins           = I2Cx_SDA_GPIO_PIN;
    gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_init_structure);

    /* configure and enable i2c interrupt */
    nvic_irq_enable(I2Cx_EVT_IRQn, 0, 0);
    nvic_irq_enable(I2Cx_ERR_IRQn, 0, 0);

    /* config i2c */
    i2c_init(hi2c->i2cx, 0x0F, I2Cx_CLKCTRL);

    i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
  }
}

max30102驱动代码如下:
void max30102_init()
{
    uint8_t data = 0;
    /*reset*/
    data = 0x40;
    i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_MODE_CONFIGURATION, &data, 1, 0xffffff);
    do
    {
                i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_MODE_CONFIGURATION, &data, 1, 0xffffff);
    } while (data & 0x40);
    /*新数据中断*/
    data = 0x40;
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_INTERRUPT_ENABLE_1, &data, 1, 0xffffff);

    /*16384量程 50Hz 18位adc分辨率*/
    data = 0x63;
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_SPO2_CONFIGURATION, &data, 1, 0xffffff);
    /*灯的亮度*/
    data = 0x47;
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_LED_PLUSE_AMPLITUDE_1, &data, 1, 0xffffff);
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_LED_PLUSE_AMPLITUDE_2, &data, 1, 0xffffff);
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_PROXIMITY_MODE_LED_PLUSE_AMPLITUDE, &data, 1, 0xffffff);
    /*FIFO clear*/
    data = 0;
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_FIFO_WRITE_POINTER, &data, 1, 0xffffff);
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_OVERFLOW_COUNTER, &data, 1, 0xffffff);
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_FIFO_READ_POINTER, &data, 1, 0xffffff);

    /*interrupt status clear*/
    max30102_getStatus();

    /*SPO2 Mode*/
    data = 0x03;
        i2c_memory_write(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_WRITE, RES_MODE_CONFIGURATION, &data, 1, 0xffffff);

}
uint8_t max30102_getUnreadSampleCount()
{
    uint8_t wr = 0, rd = 0;
        i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_FIFO_WRITE_POINTER, &wr, 1, 0xffffff);
        i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_FIFO_READ_POINTER, &rd, 1, 0xffffff);

    if ((wr - rd) < 0)
        return wr - rd + 32;
    else
        return wr - rd;
}

void max30102_getFIFO(SAMPLE *data, uint8_t sampleCount)
{
    uint8_t dataTemp[5 * 6];
    if (sampleCount > 5)
        sampleCount = 5;
        i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_FIFO_DATA_REGISTER, dataTemp, 6 * sampleCount, 0xffffff);

    uint8_t i;
    for (i = 0; i < sampleCount; i++)
    {
        data[i].red = (((uint32_t)dataTemp[i * 6]) << 16 | ((uint32_t)dataTemp[i * 6 + 1]) << 8 | dataTemp[i * 6 + 2]) & 0x3ffff;
        data[i].iRed = (((uint32_t)dataTemp[i * 6 + 3]) << 16 | ((uint32_t)dataTemp[i * 6 + 4]) << 8 | dataTemp[i * 6 + 5]) & 0x3ffff;
    }
}

uint8_t max30102_getStatus()
{
    uint8_t data = 0, dataTemp = 0;
        i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_INTERRUPT_STATUS_1, &dataTemp, 1, 0xffffff);
    data = dataTemp;
        i2c_memory_read(&hi2c2, I2C_MEM_ADDR_WIDIH_8, MAX30102_ADDR_READ, RES_INTERRUPT_STATUS_2, &dataTemp, 1, 0xffffff);
    return data | dataTemp;
}


硬件实际连接如下:


最终上位机数据如下:


结语
从最终结果来看,还存在数据不太准的情况,可能算法还需要再优化下,我再研究研究,优化下代码。

完整工程文件见附件
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22AT32F437%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22610%22%20y%3D%22610%22%20width%3D%22230%22%20height%3D%22330%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%223%22%20value%3D%22max30102%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221110%22%20y%3D%22610%22%20width%3D%22230%22%20height%3D%22330%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%224%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%222%22%20target%3D%223%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22870%22%20y%3D%22780%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%22930%22%20y%3D%22740%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%225%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22840.0000000000005%22%20y%3D%22711.3199999999999%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221107.2399999999998%22%20y%3D%22708.6799999999998%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%226%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22776.3200000000002%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22773.6799999999996%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%227%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22832.6400000000001%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22830%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%228%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22892.6400000000001%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22890%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%229%22%20value%3D%22PB11%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22630%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2210%22%20value%3D%22PB10%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22690%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2211%22%20value%3D%22PB9%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22750%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2212%22%20value%3D%22VCC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22810%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2213%22%20value%3D%22GND%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22870%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2214%22%20value%3D%22VCC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221070%22%20y%3D%22810%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2215%22%20value%3D%22GND%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221070%22%20y%3D%22870%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2216%22%20value%3D%22SCL%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221060%22%20y%3D%22690%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2217%22%20value%3D%22SDA%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221060%22%20y%3D%22630%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2218%22%20value%3D%22INT%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221065%22%20y%3D%22750%22%20width%3D%2230%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2219%22%20value%3D%22spo2%E7%AE%97%E6%B3%95%E5%A4%84%E7%90%86%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22665%22%20y%3D%22740%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2220%22%20value%3D%22PC%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22110%22%20y%3D%22640%22%20width%3D%22230%22%20height%3D%2280%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2221%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22340.00000000000045%22%20y%3D%22682.6399999999999%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%22607.2400000000002%22%20y%3D%22680%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2222%22%20value%3D%22PA9%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22560%22%20y%3D%22650%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2223%22%20value%3D%22RX%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22345%22%20y%3D%22650%22%20width%3D%2230%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22AT32F437%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22610%22%20y%3D%22610%22%20width%3D%22230%22%20height%3D%22330%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%223%22%20value%3D%22max30102%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221110%22%20y%3D%22610%22%20width%3D%22230%22%20height%3D%22330%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%224%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%222%22%20target%3D%223%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22870%22%20y%3D%22780%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%22930%22%20y%3D%22740%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%225%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22840.0000000000005%22%20y%3D%22711.3199999999999%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221107.2399999999998%22%20y%3D%22708.6799999999998%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%226%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22776.3200000000002%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22773.6799999999996%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%227%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22832.6400000000001%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22830%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%228%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22842.7600000000002%22%20y%3D%22892.6400000000001%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%221110%22%20y%3D%22890%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%229%22%20value%3D%22PB11%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22630%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2210%22%20value%3D%22PB10%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22690%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2211%22%20value%3D%22PB9%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22750%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2212%22%20value%3D%22VCC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22810%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2213%22%20value%3D%22GND%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22840%22%20y%3D%22870%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2214%22%20value%3D%22VCC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221070%22%20y%3D%22810%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2215%22%20value%3D%22GND%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221070%22%20y%3D%22870%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2216%22%20value%3D%22SCL%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221060%22%20y%3D%22690%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2217%22%20value%3D%22SDA%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221060%22%20y%3D%22630%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2218%22%20value%3D%22INT%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221065%22%20y%3D%22750%22%20width%3D%2230%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2219%22%20value%3D%22spo2%E7%AE%97%E6%B3%95%E5%A4%84%E7%90%86%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22665%22%20y%3D%22740%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2220%22%20value%3D%22PC%22%20style%3D%22strokeWidth%3D2%3Bdashed%3D0%3Balign%3Dcenter%3BfontSize%3D12%3Bshape%3Drect%3BverticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3BfillColor%3D%23c0f5a9%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22110%22%20y%3D%22640%22%20width%3D%22230%22%20height%3D%2280%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2221%22%20value%3D%22%22%20style%3D%22endArrow%3Dnone%3Bhtml%3D1%3BexitX%3D1.016%3BexitY%3D0.134%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D0.004%3BentryY%3D0.126%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%3CmxPoint%20x%3D%22340.00000000000045%22%20y%3D%22682.6399999999999%22%20as%3D%22sourcePoint%22%2F%3E%3CmxPoint%20x%3D%22607.2400000000002%22%20y%3D%22680%22%20as%3D%22targetPoint%22%2F%3E%3C%2FmxGeometry%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2222%22%20value%3D%22PA9%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22560%22%20y%3D%22650%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%2223%22%20value%3D%22RX%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22345%22%20y%3D%22650%22%20width%3D%2230%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E

at32f437&amp;max30102.rar

3.04 MB

使用特权

评论回复
沙发
uptown| | 2023-2-2 12:54 | 只看该作者
MAX30102的采样可以商用的吗?

使用特权

评论回复
板凳
maqianqu| | 2023-2-2 13:02 | 只看该作者
你这个心率数值怎么这么快呢?              

使用特权

评论回复
评论
skylove1233 2023-2-2 14:21 回复TA
这个心率采样算法还有点问题,还得修改下 
地板
skylove1233|  楼主 | 2023-2-2 14:21 | 只看该作者
uptown 发表于 2023-2-2 12:54
MAX30102的采样可以商用的吗?

很多血氧仪都是用这个芯片做的

使用特权

评论回复
5
everyrobin| | 2023-2-2 15:03 | 只看该作者
计算心率的效果怎么样              

使用特权

评论回复
评论
skylove1233 2023-2-2 16:40 回复TA
算法改进下的话效果应该挺好的,现在算法还有点瑕疵 
6
uptown| | 2023-2-2 16:19 | 只看该作者
AT32F437的计算能力不错。

使用特权

评论回复
7
skylove1233|  楼主 | 2023-2-2 16:40 | 只看该作者
uptown 发表于 2023-2-2 16:19
AT32F437的计算能力不错。

是的,F437的计算能力可以做更复杂的数据处理

使用特权

评论回复
8
mollylawrence| | 2023-2-4 09:10 | 只看该作者
这个型号输出是什么样子的呢              

使用特权

评论回复
9
iyoum| | 2023-2-4 10:12 | 只看该作者
有模拟IIC读取数据的吗?              

使用特权

评论回复
10
uytyu| | 2023-2-4 15:20 | 只看该作者
max30102的精度怎样?              

使用特权

评论回复
11
primojones| | 2023-2-4 17:32 | 只看该作者
心率数值不准呢,需要改善一下。              

使用特权

评论回复
12
tpgf| | 2023-2-6 14:25 | 只看该作者
请问血氧数据原理是什么呢 或者说是对哪些参数敏感呢

使用特权

评论回复
13
guanjiaer| | 2023-2-6 14:32 | 只看该作者
通过光照就能测出心率、血氧等参数

使用特权

评论回复
14
heimaojingzhang| | 2023-2-6 14:46 | 只看该作者
guanjiaer 发表于 2023-2-6 14:32
通过光照就能测出心率、血氧等参数

我看楼主的贴图上边并没有相关的光源啊

使用特权

评论回复
15
keaibukelian| | 2023-2-6 15:24 | 只看该作者
heimaojingzhang 发表于 2023-2-6 14:46
我看楼主的贴图上边并没有相关的光源啊

可能现在又有了其他的检测原理  我们关心检测准确度就行了

使用特权

评论回复
16
paotangsan| | 2023-2-6 15:35 | 只看该作者
现在的设备 不接触就能采集血氧数据了吗

使用特权

评论回复
17
renzheshengui| | 2023-2-6 15:57 | 只看该作者
现在华为等的那些手表啥的 里边集成的就是这些芯片吗

使用特权

评论回复
18
skylove1233|  楼主 | 2023-2-6 18:50 | 只看该作者
everyrobin 发表于 2023-2-2 15:03
计算心率的效果怎么样

效果取决于算法和传感器,这个传感器还是不错的,本身ADC精度高,但我代码中的算法还需要再改进下

使用特权

评论回复
19
skylove1233|  楼主 | 2023-2-6 18:50 | 只看该作者
mollylawrence 发表于 2023-2-4 09:10
这个型号输出是什么样子的呢

输出包括了心率+血样浓度

使用特权

评论回复
20
skylove1233|  楼主 | 2023-2-6 18:51 | 只看该作者
iyoum 发表于 2023-2-4 10:12
有模拟IIC读取数据的吗?

没有使用模拟IIC,使用的硬件IIC

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

62

帖子

0

粉丝