Dear guys,
I am implementing a module that monitors the battery voltage for our tracker device using NRF9160.
I do not understand how to set up two parameters for the ADC, those are ADC_GAIN and ADC_REFERENCE.
In the sample, these two parameters are set as followings:
#define ADC_GAIN ADC_GAIN_1_6
#define ADC_REFERENCE ADC_REF_INTERNAL
Our battery voltage is from 3V to 4.1V, we are using a voltage divider, so the battery voltage goes to AIN pin is from 1.5V to 2V.
With our above battery, what are ADC_REF_INTERNAL and ADC_GAIN? and how to set ADC_REFERENCE properly to measure our battery voltage?