Page 1 of 1

Ability of ESP8266 to sample it's supply voltage

PostPosted: Tue Mar 28, 2023 9:50 am
by xytsrm
According to the ESP8266EX Data sheet

Pin 6, TOUT
ADC pin. It can be used to test the power-supply voltage of
VDD3P3 (Pin3 and Pin4) and the input power voltage of TOUT
(Pin 6). However, these two functions cannot be used

The ADC for external signals is limited to 1v MAX; therefore there must be an internal voltage divider when sampling it's own power supply.

Also, it appears that micropython supports sampling of the power supply thru scaling:
pot.atten(ADC.ATTN_11DB) #Full range: 3.3v [Where "pot" is the pin object of the ADC.

Can anyone confirm that the information I've found regarding sampling the ESP8266 supply power is correct?


Re: Ability of ESP8266 to sample it's supply voltage

PostPosted: Fri May 05, 2023 3:57 am
by eriksl
I think internally to the ESP8266 there is a mux before the ADC, most microcontrollers have it. And yes it will have a resistor voltage divider to meet the voltage limits. So you'll need to know how to switch the mux. And as usually this is information that's known to Espressif, but they won't share it.

A suitable approach would be to add an external mux and voltage divider yourself, it isn't that hard. If you don't need the ADC for anything else, you can leave out the mux.

But keep in mind the ADC is also used by the wlan controller. This makes the readout quite flaky if wlan is enabled.