Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Timpanogos Slim
#36815 All you need is an i2c adc and a level converter.

something like a pcf8591p is cheap and effective.

http://www.aliexpress.com/item/Free-shi ... 80082.html

And of course an i2c-compatible level converter:

http://www.aliexpress.com/item/Free-shi ... 53538.html
User avatar
By trackerj
#36822 Option 1:

You can use the ESP8266 Internal ADC with a simple Resistor Voltage divider (see picture and descriptions in link).


Long story short, you can use the simple formula:
Image

Vout=Vin*R2/(R1+R2).

If you need Vin_max = 5V and Vout_max = 1V
- > In this case you can choose 40K and 10K for the resistors.

Actually I will suggest you to use 39K and 9k1 , for a Vout_max = 0.946V when Vin_max=5V, for some reasons that you will discover as soon as you will start playing with the ESP8266 internal ADC :).

Option 2:
For a higher resolution you need a dedicated ADC, like the 18 Bit MCP3421. You can find there examples and driver.