The ESP8266 has one analog pin that we can use to read analog signals. In this recipe, we will be looking at how to write a sketch that reads analog signals. This will enable us to read input from analog sensors.
Connect your ESP8266 board to your computer via a USB cable and set up your Arduino IDE (refer back to Chapter 1, Configuring the ESP8266). Once that is done, you can proceed to make the other connections.
In this recipe, we will need a breadboard and jumper wires in addition to the ESP8266 board. Mount the ESP8266 board onto the breadboard and then connect a jumper wire from the analog ADC pin to the GND pin. The connection should be as shown in the following diagram: