Is it possible to have analog input on ESP-01?

Hello,

I am trying to read from an analog sensor using ESP-01. I did some research and found that the ESP-01 does not have an ADC pin broken out, but i could tap it by soldering a wire.
Is that the only solution and also, will it actually work?

To access and use the pin TOUT in the Arduino sketch, will any of these work?

pinMode(TOUT, INPUT);

or

pinMode(6, INPUT);

esp01chip.jpg

ESP8266EX.jpg

ESP8266EX.jpg

esp01chip.jpg

It appears it should. Lotsa luck!

Note as ever, the allowable voltage range is only 0 to 1 Volt, you will need a voltage divider to measure any higher voltage.

There seem to be some complaints in the past about this but nothing really substantial. The code should be the same as for any other version of the ESP.

Another option would be to attach an external adc chip via i2c, such as ads1115 or similar. If you need digital outputs and using i2c would use those that the esp01 has, you could also add digital pins via i2c using for example pcf8574.

But adding these modules/chips to esp01 would make the circuit as large or larger than an esp12, so you might as well swap to that chip.

I always wondered why they used the range 0V-1V.

I think the adc on esp8266 was almost an afterthought, so the circuit is pretty basic. More complex adc circuits like those on AVR chips offer a choice of references (internal 1.1V, Vcc, external etc) and a multiplexer to offer multiple adc pins. The esp has only one option (internal 1V) and no multiplexer. I think if only one option can be offered, a fixed reference is preferable.

PaulRB:
I think the adc on esp8266 was almost an afterthought, so the circuit is pretty basic. More complex adc circuits like those on AVR chips offer a choice of references (internal 1.1V, Vcc, external etc) and a multiplexer to offer multiple adc pins. The esp has only one option (internal 1V) and no multiplexer. I think if only one option can be offered, a fixed reference is preferable.

Always nice to learn something new. :slight_smile:

1 Like