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

SAADC battery measurement current consumption

Hello,

I'm trying to measure battery voltage on nRF52832 chip using SAADC based on examples/peripheral/saadc and examples/ble_peripheral/ble_app_proximity and noticed that just enabling saadc makes my device consume ~7mA constantly.

This is the code for initialization, sampling is later done once per second.

saadc_init code:

ret_code_t                 err_code;
nrf_saadc_channel_config_t channel_config =
    NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);

err_code = nrf_drv_saadc_init(NULL, _saadc_callback);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_saadc_channel_init(0, &channel_config);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], BATTERY_SAADC_SAMPLES_IN_BUFFER);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], BATTERY_SAADC_SAMPLES_IN_BUFFER);
APP_ERROR_CHECK(err_code);

It doesn't matter if I later sample with nrf_drv_saadc_sample(); or not, the current is being constantly consumed. Just commenting out the code above makes the consumption drop to acceptable levels.

Does anyone had such experience before? I understand that ADC sampling comes at a cost but I didn't expect it to be a constant one.

Parents
  • Hi,

    The SAADC enables EasyDMA, which will increase the current. 8mA does sound very high though. What is the current before SAADC initialization.

    You can try enabling the Low-Power mode of the SAADC driver, as described in the documentation. This will reduce the current consumption, at the cost of and increased number of interrupts. There is a low-power SAADC example available at our GitHub page. Note that this is written for SDK 11, but it should not be a big job to migrate it to SDK 12.2 if this is what you are using.

    Best regards,

    Jørgen

  • Jorgen, to be honest I haven't got the bandwidth to learn all the BLE stuff. I took a project where the initial conditions were supposed to be a BLE pair that worked out of the box with AT commands to the central. Life did not work out that way and i was trying to see if i could take on the extra scope for my client. I am quickly deciding i don't have the bandwidth right now, but maybe it is easier than I think.

    To date I have managed to compile and run BLE peripheral blinky and hardware SAADC. I have not yet considered how to add SAADC battery monitor to Blinky, how to report the low battery condition, or how to sleep the peripheral with a wake on communications. The client has a little remaining budget for assistance on this and the central (control several blinky-plus-battery peripherals via AT commands or similar).

Reply
  • Jorgen, to be honest I haven't got the bandwidth to learn all the BLE stuff. I took a project where the initial conditions were supposed to be a BLE pair that worked out of the box with AT commands to the central. Life did not work out that way and i was trying to see if i could take on the extra scope for my client. I am quickly deciding i don't have the bandwidth right now, but maybe it is easier than I think.

    To date I have managed to compile and run BLE peripheral blinky and hardware SAADC. I have not yet considered how to add SAADC battery monitor to Blinky, how to report the low battery condition, or how to sleep the peripheral with a wake on communications. The client has a little remaining budget for assistance on this and the central (control several blinky-plus-battery peripherals via AT commands or similar).

Children
No Data
Related