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

Measuring the battery voltage with nRF52832

Hi!

To measure the voltage level of a coin cell CR2450 can be done in different ways. You can use the comparator, the low power comparator or the ADC. I wonder which one is the most adequate to use and affects least the current consumption? The CR2450 is the only power supplay in the system and the voltage is 3,0V when it has full capacity and 2,0V when it's discharged.

BR, Nixon

Parents
  • Hi there

    I'm still wondering why there is no sample code from Nordic for measuring the battery voltage - BLE means low energy, it should be most common to have such a feature in the samples....

    Anyway, I need the battery level for a 52832 application and - thanks to you guys - I was able to use this code.

    I'm using NCS 1.9.1 and like to notice that some things are different:

    - make sure you'll #include "hal/nrf_saadc.h"
    - nrf_saadc_channel_config_t has not longer "pin_p" or "pin_n" members
    - all calls to nrf_saadc.... routines need an additional NRF_SAADC_Type* argument, I simply used NRF_SAADC
    - I was so far not able to validate whether ADC12_COUNTS_PER_VOLT = 4551 is correct in my case

    hope this might help others...

Reply
  • Hi there

    I'm still wondering why there is no sample code from Nordic for measuring the battery voltage - BLE means low energy, it should be most common to have such a feature in the samples....

    Anyway, I need the battery level for a 52832 application and - thanks to you guys - I was able to use this code.

    I'm using NCS 1.9.1 and like to notice that some things are different:

    - make sure you'll #include "hal/nrf_saadc.h"
    - nrf_saadc_channel_config_t has not longer "pin_p" or "pin_n" members
    - all calls to nrf_saadc.... routines need an additional NRF_SAADC_Type* argument, I simply used NRF_SAADC
    - I was so far not able to validate whether ADC12_COUNTS_PER_VOLT = 4551 is correct in my case

    hope this might help others...

Children
Related