heartrate10 2.0.0.0
Main Page

Heart Rate 10 click

Heart Rate 10 Click is a compact add-on board suitable for heart rate monitoring applications. This board features the MAX86916, an integrated optical sensor with applications in bio-sensing, proximity, and color from Maxim Integrated.

click Product page


Click library

  • Author : Luka Filipovic
  • Date : May 2021.
  • Type : I2C type

Software Support

We provide a library for the HeartRate10 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for HeartRate10 Click driver.

Standard key functions :

Example key functions :

Example Description

‍This example showcases ability for device to read Heart Rate with 4 different diodes.

There is IR, Red, Green and Blue. You can control every one of them individualy, and change theirs sequence in FIFO register. All leds data is read from FIFO register, it's 19bit data for every led.

The demo application is composed of two sections :

Application Init

‍Initialization of host communication periphrials and interrupt pin. Configures default

configuration to device where device is reset, checks Part ID and enables all 4 leds and sets sequence as IR-Red-Green-Blue. Sets their power to maximum, and enables interrupt on new data ready.

void application_init ( void )
{
log_cfg_t log_cfg;
heartrate10_cfg_t heartrate10_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
// Click initialization.
heartrate10_cfg_setup( &heartrate10_cfg );
HEARTRATE10_MAP_MIKROBUS( heartrate10_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == heartrate10_init( &heartrate10, &heartrate10_cfg ) )
{
log_error( &logger, " Initializtion." );
log_info( &logger, " Please, run example again... " );
for ( ; ; );
}
if ( HEARTRATE10_ERROR == heartrate10_default_cfg ( &heartrate10 ) )
{
log_error( &logger, " Configuration." );
log_info( &logger, " Please, run example again... " );
for ( ; ; );
}
#define HEARTRATE10_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition heartrate10.h:141
@ HEARTRATE10_ERROR
Definition heartrate10.h:189
void application_init(void)
Definition main.c:37

Application Task

‍Reads FIFO data for all 4 didoes and logs them with separation character ','.

void application_task ( void )
{
uint8_t rd_dat = 0;
if ( ( rd_dat & 0x40 ) )
{
uint32_t ir, red, green, blue = 0;
heartrate10_read_complete_fifo_data( &heartrate10, &ir, &red, &green, &blue );
log_printf( &logger, "%lu,%lu,%lu,%lu\r\n", ir, red, green, blue );
}
Delay_ms ( 3 );
}
#define HEARTRATE10_REG_INT_STATUS
Heart Rate 10 communication register.
Definition heartrate10.h:73
err_t heartrate10_generic_read(heartrate10_t *ctx, uint8_t reg, uint8_t *rx_data)
Reading function.
void application_task(void)
Definition main.c:74

Note

‍For testing this example application SerialPlot was used.

There you can see heart rate graphicly shown.

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.HeartRate10

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.