This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK 12.1.0 and BLE Proximity Example with SAADC

Hi everyone,

I wanted to test out SAADC using the ble_app_proximity example using the nRF52-DK but I am having some issues. I modified the example with the below changes:

...    
#define BATTERY_LEVEL_MEAS_INTERVAL       APP_TIMER_TICKS(1000, APP_TIMER_PRESCALER)    // changed from 120000 to 1000
...
NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN3);      // changed so that the ADC is read from P05
...

I made 'adc_result' as a global variable and I put an if statement in the main loop so that P31 outputs high if adc_result > 0. However, no changes are seen when I connect VDD with P05.

Am I doing something wrong here?

Thank you.

  • Hi,

    Did you connect to the device and enabled notifications for the battery service? Notice that the timer for battery measurement is first started in the bas event handler, on_bas_evt(), on the event BLE_BAS_EVT_NOTIFICATION_ENABLED.

    You can move the starting of the timer to timers_init function or somewhere else, if you want to continuously measure the battery current.

    Best regards,

    Jørgen

Related