KW40 Heart rate sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KW40 Heart rate sensor

653 Views
syed_idris
Contributor III

Hi,

We debugged the "heart rate sensor" example code in USB-KW40 using IAR and able to see the data on "Kinetis BLE toolbox" application,

it is giving the data in between 40 to 50 bpm. But in the code it is written as

#define mHeartRateLowerLimit_c          (40) /* Heart beat lower limit, 8-bit value */

#define mHeartRateUpperLimit_c          (201) /* Heart beat upper limit, 8-bit value */

lower limit is 40 and upper limit is 201 so how it is giving 40 to 50 bpm ?

And it seems that sensor data is taken from ADC of KW40, isn't it ? from which ADC input channel the sensor data is expected? because when we open board.c file the function of initialization of adc it is empty.

void BOARD_InitAdc(void)

{

}

Can we define our own ADC channel in this fuction and how?

Tags (2)
0 Kudos
1 Reply

372 Views
isaacavila
NXP Employee
NXP Employee

Hello Syed,

For USB-KW40 board, heart rate value is taken from a Random Number (using Random Number Generator module) and implements a specific calculation (due this board does not contain a potentiometer). You can look at TimerMeasurmentCallback function at app.c (line 708) where this calculation is made.

In FRDM-KW40 board example, it uses an ADC channel where potentiometer is connected (ADC channel 0). In this example, there is an ADC initialization in board.c file (BOARD_InitAdc function) and heart rate value is taken from potentiometer's value.

I hope this can help!

Regards,

Isaac Avila

0 Kudos