Page 1 of 2
ESP8266-01 - voltage meter using GPIO0
Posted:
Mon Oct 02, 2017 8:44 am
by Lars Bo Wassini
I'm feeding my ESP8266-01 using 2x1.5V battery and have connected GPIO0 to Vcc. When using AnalogRead, I get the value 214 and not 1023 as I would expect.
What should I do to get the correct value on this pin?
Thanks in advance
Lars Bo Wassini
Re: ESP8266-01 - voltage meter using GPIO0
Posted:
Mon Oct 02, 2017 3:39 pm
by schufti
there is no analog read on gpio0 or any other gpio of esp8266.
the only pin you can read any analog value is TOUT/ADC0/A0 whatever naming convention you are using.
AND since this pin is not accessible on ESP-01, the only value you can read is VCC
Re: ESP8266-01 - voltage meter using GPIO0
Posted:
Mon Oct 02, 2017 3:42 pm
by QuickFix
The ESP-01 doesn't have the TOUT port connected to the outside, so when reading, you're measuring the power supply (
relative to 0V..1V I believe).
Though you should first turn off WiFi when performing a read and the ESP actually works at 3.3V, not 3V so your milage may vary.
Re: ESP8266-01 - voltage meter using GPIO0
Posted:
Mon Oct 02, 2017 5:22 pm
by martinayotte
As mentioned, TOUT isn't available on ESP-01 ...
What you can do is to use GPIO0/GPIO2 as an I2C bus and attach I2C ADC such MCP3431.