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:
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.