RAK3172 Module analogReference/Battery level

Hello, I am powering the RAK3172 module with a CR2032 and I need to measure the voltage of this battery.
I connected the battery to ADC1 and when performing an analogRead() it always returns 1023. I believe that this happens because of analogReference = VCC.
I’m trying to use the analogReference(RAK_ADC_MODE_2_4) statement but it doesn’t seem to have any effect.
Am I doing something wrong?
Do I need to add an LDO for VCC and a voltage divider to measure the battery in this module?
Tks

1 Like

The voltage of CR2032 is 2V~3V, maybe you should use analogReference(RAK_ADC_MODE_3_0) that it means the the top of the input range.
I think you will see an analogRead() will return between 682 to 1023 base on the remaining battery level.