Random Nerd Tutorials

ESP8266 ADC – Reading Analog Values with NodeMCU


Both ESP-12E and ESP-07 have an ADC pin that is easily accessible. This means that those ESP boards can read analog values from components, such as, temperature sensors, potentiometers, light sensors, etc.

Before you continue reading this project, please complete the following tutorials: 

If you like the ESP WiFi module and you want to build more projects you can download my eBook called “Home Automation using ESP8266” hereLet’s get started!

ADC Specifications

When referring to the ESP ADC pin you will often hear these different terms interchangeably:

  • ADC (Analog-to-digital Converter)
  • TOUT
  • Pin6
  • A0
  • Analog Pin 0

All these terms refer to the same pin in the ESP8266 that is highlighted in the next section.

Currently, TOUT (Pin6) has a 10-bit precision and its input voltage range is 0 to 3.3V when TOUT is connected to an external circuit.

Accessing the ESP8266 Analog Pin

With the ESP-12E is very easy to access the A0, you simply connect a jumper wire to the pin (see figure below).

With the ESP-07 you need solder a wire to that pin.

Parts List

Here’s the hardware that you need to complete this tutorial:

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Flashing Your ESP with NodeMCU

In this tutorial we are going to use the NodeMCU firmware to read analog values.

You have to flash your ESPs with NodeMCU firmare.

Downloading ESPlorer IDE

I recommend using the ESPlorer IDE which is a program created by 4refr0nt to send commands to your ESP8266.

Follow these instructions to download and install ESPlorer IDE:

1) Click here to download ESPlorer

2) Unzip that folder

3) Go to the main folder

4) Run ESPlorer.jar

5) Open the ESPlorer


According to the ESP8266 datasheet, the ADC pin has 10 bit resolution. This means that your analog reading will return a value between 0 to 1024.

The ADC only converts voltage between 0 and 3.3Volts. So before you apply any voltage to your A0 pin, you need to make sure that you’re using a device that only outputs 3.3V. Otherwise you might need to use a voltage divider:

Note: with earlier versions of the ESP, the A0 pin operated at maximum voltage of 1.0V, so check your board A0 voltage before following the next circuit.

Final Circuit

Here’s the final circuit that you need to assemble:

  • red wire: 3.3V
  • orange wire: A0
  • black wire: GND

Testing the ADC Pin (A0)

To send commands with the ESPlorer IDE, you need to establish a serial communication with your ESP, follow these instructions:

1) Connect your ESP-12E or FTDI programmer to your computer

2) Set bad raute as 9600

3) Select your ESP-12E or FTDI programmer port (COM3, for example)

4) Press Open/Close

esplorer (1)

Then type the command “print(adc.read(0))” and click the button “Send” as shown below.


It should return a value between 0 and 1024. Rotate your potentiometer and send the “print(adc.read(0))” command a few more times.

When your potentiometer is near 0V it prints 0 and when it reaches 3.3V it should print 1024.

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Learn ESP32 with Arduino IDE

This is our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! The registrations are open, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Add Your Reply