Hello Everyone,
I’m using the Heltec Cube Cell HTCC-AB02 Board and have the following problem:
When reading the battery voltage with the function getBatteryVoltage(), I get sometimes the correct voltage, but sometimes or most of the times the read value is zero.
I also tried to modify the function, because I thought I have to wait a little time after pulling down the pin VBAT_ADC_CTL to low, but the problem is also there.
static void getBatteryVoltageFloat( void )
{
pinMode(VBAT_ADC_CTL,OUTPUT);
digitalWrite(VBAT_ADC_CTL,LOW);
delay (50);
uint16_t u16BatteryVoltage = analogRead(ADC) * 2;
pinMode(VBAT_ADC_CTL, INPUT);
fBatteryVoltage = (float)u16BatteryVoltage / 1000;
if (cbDebugConsoleActive) {
Serial.print("Battery Voltage: ");
Serial.print(fBatteryVoltage);
Serial.println("V");
}
}
I could think of the following problems: Maybe some problem after deep sleep, because I read every 5 minutes the battery voltage after deep sleep and send them by LoRaWan to TheThingsNetwork.
Or maybe some problems with the internal firmware and the mux?
Has anyone the same problem and maybe a solution?
Best regards
Thomas