@Yveaux thanks for your answer.
I used the sketch on the Mysensors'si7021 page, so the vcc level is read at the end of the loop, before going to sleep and after sending the temp/hum values.
The only modification I made are setting up the voltage values.
As my 3.7V Li-Ion battery is at 4.2V when fully charged and at 3V when almost completed discharged, this how I configured it in the sketch:
#ifdef REPORT_BATTERY_LEVEL #include <Vcc.h> static uint8_t oldBatteryPcnt = 200; // Initialize to 200 to assure first time value will be sent. const float VccMin = 3.0; // Minimum expected Vcc level, in Volts: Brownout at 1.8V -> 0% const float VccMax = 4.2; // Maximum expected Vcc level, in Volts: 2xAA fresh Alkaline -> 100% const float VccCorrection = 1.0; // Measured Vcc by multimeter divided by reported Vcc static Vcc vcc(VccCorrection); #endif
I didn't apply any correction because read and reported VCC was very close, and I'm just testing this for now.
I didn't removed the onboard regulator nor the power led for now. Isn't the regulator only used when applying voltage to the RAW pin?