ESP8266 boards can be used to read and monitor data from both digital and analog sensors. To demonstrate this, we are going to measure data from a digital temperature and humidity sensor then display the data on the serial monitor.
In this tutorial, you will need an ESP8266 board, a USB cable, and a few other components, which include:
DHT11 temperature/humidity sensor (https://www.sparkfun.com/products/10167)
10 kΩ resistor
Breadboard
Jumper wires
The DHT11 pin configuration is shown in the following diagram:
First mount the ESP8266 board and the DHT11 sensor onto the breadboard. Connect a 10 kΩ pull up resistor to the DHT11 data pin and connect the VCC pin and GND pin to the 3.3V pin and GND pin of the ESP8266 board, respectively. Finally, connect the data pin of the DHT11 to GPIO 2 of the ESP8266 board. Use jumper wires to do the connections.
The setup is shown in the following diagram: