@boozz
Many Thanks, now I understand but I still have doubts, in the skecth i have change this
float batteryV = sensorValue * 0.003363075;
in
float batteryV = sensorValue * 0.00575035;
because if I understand it ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
in my case is ((1+0,23)/0,23)*1,1 = 5,88 and after 5,88/1023 = 0,0057478
Now, however with new battery the output is
99
Battery Voltage: 0.57 V
Battery percent: 9 %
The code i used is
// get the battery Voltage
int sensorValue = analogRead(BATTERY_SENSE_PIN);
Serial.println(sensorValue);
// 1M, 470K divider across battery and using internal ADC ref of 1.1V
// Sense point is bypassed with 0.1 uF cap to reduce noise at that point
// ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
// 3.44/1023 = Volts per bit = 0.003363075
float batteryV = sensorValue * 0.00575035;
int batteryPcnt = sensorValue / 10;
Thanks
Mattia