ESP8266 reading ADC data

The ESP8266 has in built single channel ADC that can measure between 0V and 1V with 10 bit resolution. To read higher voltages you need external voltage divider. ADC is available on ESP12.

Voltage Divider

Resistor voltage dividers are commonly used to create reference voltages, or to reduce the magnitude of a voltage so it can be measured.

Voltage Divider Circuit
Voltage Divider Circuit

Formula to find Vout is. Assume (R1+R2) =  10K for 5V input or higher depending on input voltage level and find R2.

For 5V use R1=8.2 K and R2=2.2 K

ESP8266 ADC Programming

ADC programming is similar to Arduino, Only difference is you have 0 to 1V with 10-bit resolution.

Results

Observe the ADC value on serial monitor.

ADC Results
ADC Results

 

Leave a Reply

Your email address will not be published. Required fields are marked *