在您的解决方案中添加光学脉搏血氧仪技术,实现精确可靠的血氧饱和度监测。
A
A
硬件概览
它是如何工作的?
Oximeter 5 Click 基于 MAX30102,这是一款来自 Maxim Integrated(现为 Analog Devices 一部分)的高灵敏度脉搏血氧仪和心率传感器。MAX30102 集成了红光和红外光 LED,具有 660nm 的红光和 880nm 的红外光波长,用于调制 LED 脉冲以进行血氧饱和度 (SpO2) 和心率测量。LED 脉冲宽度可以编程,以允许算法根据使用情况优化 SpO2 和 HR 的准确性和功耗。MAX30102 的 SpO2 子系统包含环境光消除 (ALC)、具有 18 位分辨率的连续时间过采样 sigma-delta ADC 和专有的离散时间滤波器。ALC 具有内部的跟踪/保持电路,用于消除环境
光并增加有效动态范围。MAX30102 还具有片上温度传感器,具有 0.0625°C 的固有分辨率,用于校准 SpO2 子系统的温度依赖性。MAX30102 不需要特定的上电顺序,但需要 1.8V 的电源电压才能正常工作。因此,使用了一个小型调节 LDO MAX8511,它从选择的 5V 或 3.3V mikroBUS™ 电源轨提供 1.8V 输出。此外,它可以通过软件关闭,待机电流为零,允许电源轨始终保持通电状态。Oximeter 5 Click 使用标准 I2C 2 线接口与 MCU 通信,最大时钟频率为 400kHz。它通过软件寄存器完全可调,数字输出数据存储在设备内的 32 深度 FIFO 中。由于传感器操作需要 1.8V
的电源,该 Click board™ 还配备了 PCA9306 和 SN74LVC1T45 电压电平转换器。I2C 接口总线线连接到电压电平转换器,使该 Click board™ 能够与 3.3V 和 5V MCU 正常工作。此外,它使用 mikroBUS™ 插座的 INT 引脚作为中断引脚,通知系统 MAX30102 已准备好运行。该 Click board™ 可以通过 VCC SEL 跳线选择使用 3.3V 或 5V 逻辑电压电平。这样,具有 3.3V 和 5V 功能的 MCU 都可以正确使用通信线路。然而,该 Click board™ 配备了包含易于使用的功能和示例代码的库,可以作为进一步开发的参考。
功能概述
开发板
Nucleo 32开发板搭载STM32F031K6 MCU,提供了一种经济且灵活的平台,适用于使用32引脚封装的STM32微控制器进行实验。该开发板具有Arduino™ Nano连接性,便于通过专用扩展板进行功能扩展,并且支持mbed,使其能够无缝集成在线资源。板载集成
ST-LINK/V2-1调试器/编程器,支持通过USB重新枚举,提供三种接口:虚拟串口(Virtual Com port)、大容量存储和调试端口。该开发板的电源供应灵活,可通过USB VBUS或外部电源供电。此外,还配备了三个LED指示灯(LD1用于USB通信,LD2用于电源
指示,LD3为用户可控LED)和一个复位按钮。STM32 Nucleo-32开发板支持多种集成开发环境(IDEs),如IAR™、Keil®和基于GCC的IDE(如AC6 SW4STM32),使其成为开发人员的多功能工具。

微控制器概述
MCU卡片 / MCU

建筑
ARM Cortex-M0
MCU 内存 (KB)
32
硅供应商
STMicroelectronics
引脚数
32
RAM (字节)
4096
你完善了我!
配件
Click Shield for Nucleo-32是扩展您的开发板功能的理想选择,专为STM32 Nucleo-32引脚布局设计。Click Shield for Nucleo-32提供了两个mikroBUS™插座,可以添加来自我们不断增长的Click板™系列中的任何功能。从传感器和WiFi收发器到电机控制和音频放大器,我们应有尽有。Click Shield for Nucleo-32与STM32 Nucleo-32开发板兼容,为用户提供了一种经济且灵活的方式,使用任何STM32微控制器快速创建原型,并尝试各种性能、功耗和功能的组合。STM32 Nucleo-32开发板无需任何独立的探针,因为它集成了ST-LINK/V2-1调试器/编程器,并随附STM32全面的软件HAL库和各种打包的软件示例。这个开发平台为用户提供了一种简便且通用的方式,将STM32 Nucleo-32兼容开发板与他们喜欢的Click板™结合,应用于即将开展的项目中。
使用的MCU引脚
mikroBUS™映射器
“仔细看看!”
Click board™ 原理图

一步一步来
项目组装
软件支持
库描述
该库包含 Oximeter 5 Click 驱动程序的 API。
关键功能:
oximeter5_read_sensor_data- Oximeter 5 获取传感器数据功能。oximeter5_get_oxygen_saturation- Oximeter 5 获取血氧饱和度功能。oximeter5_read_temperature- Oximeter 5 读取温度功能。
开源
代码示例
完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio。 应用程序代码也可以在MIKROE的GitHub账户中找到。
/*!
* @file main.c
* @brief Oximeter5 Click example
*
* # Description
* This library contains API for Oximeter 5 Click driver.
* The demo application reads and calculate
* SpO2 oxygen saturation data.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes I2C driver and log UART.
* After driver initialization the app set
* driver interface setup and default settings,
* buffer length of 100 stores 4 seconds of samples running at 25sps
* read the first 100 samples, and determine the signal range.
*
* ## Application Task
* This is an example that demonstrates the use of the Oximeter 5 Click board™.
* In this example, display the IR and RED ADC data,
* and the SpO2 oxygen saturation data [ 0% - 100% ].
* Results are being sent to the Usart Terminal where you can track their changes.
*
* @note
* A measurement time of at least 10 seconds is required
* for the SpO2 oxygen saturation data to be valid.
*
* @author Nenad Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "oximeter5.h"
static oximeter5_t oximeter5;
static log_t logger;
static uint32_t aun_ir_buffer[ 100 ];
static uint32_t aun_red_buffer[ 100 ];
static uint32_t un_min, un_max, un_prev_data, un_brightness;
static float f_temp;
static uint8_t n_spo2;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
oximeter5_cfg_t oximeter5_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
oximeter5_cfg_setup( &oximeter5_cfg );
OXIMETER5_MAP_MIKROBUS( oximeter5_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == oximeter5_init( &oximeter5, &oximeter5_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 100 );
if ( OXIMETER5_ERROR == oximeter5_default_cfg ( &oximeter5 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
Delay_ms ( 100 );
un_brightness = 0;
un_min = 0x3FFFF;
un_max = 0;
for ( uint8_t n_cnt = 0; n_cnt < 100; n_cnt++ )
{
while ( oximeter5_check_interrupt( &oximeter5 ) == OXIMETER5_INTERRUPT_ACTIVE );
oximeter5_read_sensor_data( &oximeter5, &aun_red_buffer[ n_cnt ], &aun_ir_buffer[ n_cnt ] );
if ( un_min > aun_red_buffer[ n_cnt ] )
{
un_min = aun_red_buffer[ n_cnt ];
}
if ( un_max < aun_red_buffer[ n_cnt ] )
{
un_max = aun_red_buffer[ n_cnt ];
}
}
oximeter5_get_oxygen_saturation( &aun_ir_buffer[ 0 ], 100, &aun_red_buffer[ 0 ], &n_spo2 );
log_info( &logger, " Application Task " );
Delay_ms ( 100 );
}
void application_task ( void )
{
for ( uint8_t n_cnt = 25; n_cnt < 100; n_cnt++ )
{
aun_red_buffer[ n_cnt - 25 ] = aun_red_buffer[ n_cnt ];
aun_ir_buffer[ n_cnt - 25 ] = aun_ir_buffer[ n_cnt ];
if ( un_min > aun_red_buffer[ n_cnt ] )
{
un_min = aun_red_buffer[ n_cnt ];
}
if ( un_max < aun_red_buffer[ n_cnt ] )
{
un_max=aun_red_buffer[n_cnt];
}
}
for ( uint8_t n_cnt = 75; n_cnt < 100; n_cnt++ )
{
un_prev_data = aun_red_buffer[ n_cnt - 1 ];
while ( oximeter5_check_interrupt( &oximeter5 ) == OXIMETER5_INTERRUPT_ACTIVE );
oximeter5_read_sensor_data( &oximeter5, &aun_red_buffer[ n_cnt ], &aun_ir_buffer[ n_cnt ] );
if ( aun_red_buffer[ n_cnt ] > un_prev_data )
{
f_temp = aun_red_buffer[ n_cnt ]-un_prev_data;
f_temp /= ( un_max - un_min );
f_temp *= MAX_BRIGHTNESS;
f_temp = un_brightness - f_temp;
if ( f_temp < 0 )
{
un_brightness = 0;
}
else
{
un_brightness = ( uint32_t ) f_temp;
}
}
else
{
f_temp = un_prev_data - aun_red_buffer[ n_cnt ];
f_temp /= ( un_max - un_min );
f_temp *= MAX_BRIGHTNESS;
un_brightness += ( uint32_t ) f_temp;
if ( un_brightness > MAX_BRIGHTNESS )
{
un_brightness = MAX_BRIGHTNESS;
}
}
if ( ( OXIMETER5_OK == oximeter5_get_oxygen_saturation( &aun_ir_buffer[ 0 ], 100, &aun_red_buffer[ 0 ], &n_spo2 ) ) )
{
if ( aun_ir_buffer[n_cnt] > 10000 )
{
log_printf( &logger, "\tIR : %lu \r\n", aun_ir_buffer[ n_cnt ] );
log_printf( &logger, "\tRED : %lu \r\n", aun_red_buffer[ n_cnt ] );
log_printf( &logger, "- - - - - - - - - - - - - - -\r\n" );
log_printf( &logger, "\tSPO2 : %d %%\r\n", ( uint16_t ) n_spo2 );
log_printf( &logger, "-----------------------------\r\n" );
Delay_ms ( 100 );
}
else
{
Delay_ms ( 10 );
}
}
}
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
额外支持
资源
类别:生物识别


































