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§?

  • thank you so much for your kind reply yes i understood the ADC configuration but am providing the supply via battery (2.91V )on VDD and am using NRF_ADC_CONFIG_SCALING_INPUT_ONE_THIRD; so it will come around like this VDD/3 where 1.455 is the VBG reference voltage so can you tell me is it possible to check the ADC _VALUE in the UART terminal(putty log) so that i can do some manual calcualtion to find out how much voltage left in battery, please verify my assumption are correct about ADC configuration? and also am using nrf_adc_input_select(NRF_ADC_CONFIG_INPUT_2);is function for the analog input pin

  • The raw ADC sample can be read from the RESULT register. In the example, this is done on line 206:

    adc_value = nrf_adc_result_get();
    

    If you have logging of some sort (UART or RTT) you can print adc_value.

    You write that you are using NRF_ADC_CONFIG_INPUT_2. I do not see a problem with this, bit it is unnecessary to waste a pin when you can use the internal connection. Is there a reason you are not doing it as in the example?

  • Thank you for your kind reply i did not want to change the program i just checked with the UART log terminal i got 117872 as the adc_value can you please explain what is this value indicates? the reason i try to use analog pin in order to measure the voltage available on that parrticular pin but now i used the example as it is so and i checked with the adc_simple example on the SDK 10peripheral i got 173 as the ADC_VALUE so can you tell me what is the difference between these two examples?

  • How are you printing the sample? It is a 10 bit number, so the sample value cannot be 117872.

  • i have just add the main printf statement in the main function and for your kind reference i ahve attached my main.c file please ahve a look and if i am wrong in the approach pleas let me know and liek what you said previously adc sample is a 10bit number if it is that case i compiled the adc_simple program in the peripheral folder of the SDK10for that i just got 173 and that program also ADC _configured to 10bit resolution only so what is going wrong in my apporach then?

Related