Can Arduino/ESP32 read it's input voltage?

With the ESP32 I can power it via 5v and have a 3.7v battery as backup.

Can it tell me which voltage it is running off as it's primary power input, so I can execute code dependant.

I'm looking for an internal function rather than using the header pins/gpio etc.

TIA

You can connect its power input, through a suitable resistor divider network, to one of its analog inputs.

1 Like

How do you expect the processor can identify which supply is active?

Thought that's what I would have to do, cheers.

If it had its own voltage divider or transistor built into the board like the pull-up resistors etc. Cheers

Not going to work that way.

1 Like

Worth a longshot.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.