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

How to measure Lithium battery voltage with low-power mode 1.8V

Hey everyone. Found this thread about measuring the voltage on lipo battery: devzone.nordicsemi.com/.../how-to-measure-lithium-battery-voltage

Parents
  • Hi Michal

    Thank you for your question.

    Actually, with 1/1 prescaling and reference voltage set to VBG = 1.2V, the range of the ADC is 0V - 1.2V.

    If you choose 8-bit resolution, which is 256 bits, you get 1 bit output change when you change the input voltage with 1.2V/256=0.004688V. If you choose 10-bit resolution, which is 1024 bits, you get 1 bit output change when you change the input voltage with 1.2V/1024=0.001172V. When the input goes above 1.2V, the ADC output will saturate and show value 255 for 8-bit configuration, or 1023 for 10-bit configuration.

    For the Lithium battery setup and 8 bit resolution, ADC will output following value when the battery is flat: 0.54/1.2255=115 For the Lithium battery setup and 8 bit resolution, ADC will output following value when the battery is fully charged: 0.76/1.2255=161 Result is that you will have 161-115=46 bit resolution in the Lithium battery voltage range when using 8-bit ADC configuration. So you could in principle utilize up to 46 different battery levels. However, I assume that the discharge curve of the Lithium battery is not linear between 3.0V and 4.2V, so you would most likely need to implement a transfer function to convert the ADC output to battery level percentage.

    For the Lithium battery setup and 10-bit resolution, ADC will output following value when the battery is flat: 0.54/1.21023=461 For the Lithium battery setup and 10-bit resolution, ADC will output following value when the battery is fully charged: 0.76/1.21023=646 Result is that you will have 646-461=185 bit resolution in the Lithium battery voltage range when using 10-bit ADC resolution.

    Let me know if you have further questions on the topic.

Reply
  • Hi Michal

    Thank you for your question.

    Actually, with 1/1 prescaling and reference voltage set to VBG = 1.2V, the range of the ADC is 0V - 1.2V.

    If you choose 8-bit resolution, which is 256 bits, you get 1 bit output change when you change the input voltage with 1.2V/256=0.004688V. If you choose 10-bit resolution, which is 1024 bits, you get 1 bit output change when you change the input voltage with 1.2V/1024=0.001172V. When the input goes above 1.2V, the ADC output will saturate and show value 255 for 8-bit configuration, or 1023 for 10-bit configuration.

    For the Lithium battery setup and 8 bit resolution, ADC will output following value when the battery is flat: 0.54/1.2255=115 For the Lithium battery setup and 8 bit resolution, ADC will output following value when the battery is fully charged: 0.76/1.2255=161 Result is that you will have 161-115=46 bit resolution in the Lithium battery voltage range when using 8-bit ADC configuration. So you could in principle utilize up to 46 different battery levels. However, I assume that the discharge curve of the Lithium battery is not linear between 3.0V and 4.2V, so you would most likely need to implement a transfer function to convert the ADC output to battery level percentage.

    For the Lithium battery setup and 10-bit resolution, ADC will output following value when the battery is flat: 0.54/1.21023=461 For the Lithium battery setup and 10-bit resolution, ADC will output following value when the battery is fully charged: 0.76/1.21023=646 Result is that you will have 646-461=185 bit resolution in the Lithium battery voltage range when using 10-bit ADC resolution.

    Let me know if you have further questions on the topic.

Children
No Data
Related