Fb ESP32-E V1.0 Detect USB Power, Battery, Charging

userHead Adrian.Naegeli 2022-11-24 02:43:30 206 Views1 Replies

Hi there,


is there a way to detect if the Firebeetle is powerered by USB or Battery, and the charge status?



2022-11-24 06:39:44

If your board works according to the specs (mine doesn't seem to, I uploaded a post about it today, but I have a different board - an ESP32), you should be able to check the battery voltage at the A2 PIN (GPIO34). See e.g. here: https://github.com/Torxgewinde/Firebeetle-2-ESP32-E/blob/main/Firebeetle_DeepSleep.ino


To check if it's powered by USB, you could check the voltage at the VCC pin. If it's 5V it's USB and much less (≤ 4.2V) if it's battery powered. Note that you should not connect the VCC pin directly to the ESP - it's not 5V tolerant, you'd have to add a voltage divider.

userHeadPic Janko.Walski