Battery level Reading Error

Hi,

I am trying to use cr2032 battery with nrf52840 to measure the battery level.

To begin with, I first integrated the battery level measuring code in my  application from ble_app_hrs which is located in the examples/ble_peripheral/ which did not work at all and then i tried to code normally using 14 bit resolution for better accuracy.

For simulation, I am using DC Power Supply to change the voltage, NRF_SAADC_INPUT_VDD as the input channel and nrf connect app so as to validate the measurement. However, battery percentage is 100  from 3.3V to 2.5V / 2.4V and started to decrease only after 2.5V from 100%.It was showing 98% for 2.4V, 80% for 2.1 V and decreasing further up to 58% for 1.8V Could anyone please help me on how to accurately measure battery level of nrf52840 with CR2032 battery from 3.3V? Code Snippets are attached .

Related