NodeMCU Temp/Humidity Sensor
Posted 7 months ago - 2 min read
Connect a DHT22 temperature/humidity sensor to an ESP8266 (NodeMCU) and display the values to a self-hosted webpage.
Part List
Setup
- Download and install the latest version of Arduino.
- Open
esp8266-dh22.ino
using Arduino. - Open preferences and include the additional board manager url:
https://arduino.esp8266.com/stable/package_esp8266com_index.json
- Open board manager and search for and install esp8266.
- Select select your compatabible esp8266 board and verify COM port
- Using the library manager, search for and install DHT sensor library by Adafruit and PageBuilder by Hieromon Ikasamo.
- Update code to use desired credentials for wifi.
- Verify, compile and upload code to ESP8266.
Testing
- After uploading the code to ESP8266, open the serial monitor.
- Make note of the IP address listed for the device.
- Verify temperature and humidity readings are displayed to the serial monitor.
- Open a browser and navigate to the IP address of the device.
- You should see the temperature and humidity values printed to the webpage.