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

how to measure the coin cell battey voltage in real

Hello Everyone,

I am trying to measure the (3v)battery voltage by having proximity example as reference but intially it is showing 100percent later it is going to 13(percent) voltage approxmiatelry (after 120seconds) i dont understand why it is happening like this can anyone suggest me some possible ways to measure out by using multimeter how much voltage available on ADC pin ? so that i can able to make some idea about the battery level measurement§?

Parents
  • The proximity example in SDK 11 uses a app timer to measure the battery level. The first measurement is not performed until the first time it times out, and the timeout is 120 second (thus measurements are performed every 120 seconds). You can modify BATTERY_LEVEL_MEAS_INTERVAL and set it to a lower value in order to measure more often. You can also do the first measurement at startup, rather than waiting the full measurement interval before doing the first measurement.

    Also, if you are not using the DK you may have to change the value of DIODE_FWD_VOLT_DROP_MILLIVOLTS to reflect your hardware.

  • To interpret the value of the ADC sample you have to take into account how the ADC is configured with regard to prescaling (voltage divider) and resolution. This post has a good description of how it works.

    The proximity example use the ADC with a 10 bit resolution, so 1024 is the sample value for the highest voltage. In order to calculate the battery voltage the following macro is used:

    #define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE)\
            ((((ADC_VALUE) * ADC_REF_VBG_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_INPUT_PRESCALER)
    

    Then the example use the battery_level_in_percent() function to convert it to a percentage (not that this is not a percentage of the voltage relative to 3 V, but a estimate of battery life).

Reply
  • To interpret the value of the ADC sample you have to take into account how the ADC is configured with regard to prescaling (voltage divider) and resolution. This post has a good description of how it works.

    The proximity example use the ADC with a 10 bit resolution, so 1024 is the sample value for the highest voltage. In order to calculate the battery voltage the following macro is used:

    #define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE)\
            ((((ADC_VALUE) * ADC_REF_VBG_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_INPUT_PRESCALER)
    

    Then the example use the battery_level_in_percent() function to convert it to a percentage (not that this is not a percentage of the voltage relative to 3 V, but a estimate of battery life).

Children
No Data
Related