Interfacing DHT11 Sensor with ESP8266

In this article, I am going to explain about interfacing of DHT11 sensor with ESP8266. For that we have to make only 3 connections between the DHT11 sensor and ESP8266. For the working demonstration we will be programing ESP8266 as a web server for displaying temperature and humidity in a web browser as per request.

Components Required

ESP8266 DHT11 Sensor USB Cable Connecting Wires

Hardware

Circuit Diagram

Interfacing DHT11 Sensor with ESP8266 - Circuit Diagram

Connections

DHT11 sensor (+) pin will be connected to 3.3V DHT11 sensor...

Calling API using ESP8266

The objective of this tutorial is to explain how to do HTTP JSON GET requests using an ESP8266 and Arduino IDE.

Components Required

ESP8266 USB Cable

Hardware

Connect ESP8266 to Computer  

Software

Code

#include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> #include <ArduinoJson.h> const char* ssid = "SERVER NAME"; const char* password = "SERVER PASSWORD"; void setup() { Serial.begin(115200); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting..."); } } void loop() { if (WiFi.status() == WL_CONNECTED) { ...

>