Hi there,
If I may. You have looked at the schematic, then you will be able to see the VBUS is derived from the USB being plugged in. Also from the schematic it is connected to pin 1 on the Xiao header as 5V.
You could put a jumper with a series Resistor of 10k to an input pin and just use INPUT,PULLDOWN for configuration. When the USB is plugged in, The input will be HIGH.
Something along those lines should get it done. AFAIK, the level is only available if you use a pair of inputs for battery level detection or do msfujino’s tech here.
https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/#check-the-battery-voltage
Not Ideal I know when IO Pins are so limited.
For devices touted as battery powered or " good for IOT"
On the Xia ESP32C3 the battery stuff is on it’s own ISLAND only sending smoke (LED) signals for status.
I hope Future SEEED Studio designs take into account the HIGH importance of Device Battery information, managements, Status etc. are Paramount.
IMO there is NO technical reason the same battery management that is in the Xiao nRF52840’s to be present in the ESP Xiao’s other than cost or availability (part shortage).
HTH
GL PJ