" Connecting world ,down to Earth"
This is an asynchronous ESP32 web server with the DHT11 that displays temperature and humidity using esp32 using MicroPython Code. We will first interface the Sensor with ESP32 only and check the temperature and humidity reading in Shell Window. Similarly, we will add extra 0.96″/1.3″ I2C oled display to the same circuit and display the Humidity Temperature reading on OLED Screen.
-User are able to control , system remotely - system reboot, deep sleep ,led on ,led off, send mail.
-User will get email that contain device data.
-The web server we’ll build updates the readings
automatically with the need to refresh the web page.
-Display the Humidity Temperature reading on OLED Screen.
-ESP32 ESP-32S Development Board (ESP-WROOM-32)
-DHT11 Humidity Temperature Sensor
-Jumper Wires
-Breadboard
- Oled
DHT11 Humidity Temperature Sensor
The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed).
Interfacing DHT11 Sensor with ESP32 using MicroPython Code DHT11 Sensor & ESP32 & start with MicroPython Code for measuring Humidity & Temperature. The connection is fairly simple. Connect the DHT11 VCC & GND pin to ESP32 3.3V Pin & GND Pin. Connect the digital output pin to ESP32 GPIO5 Pin.
from machine import Pin
from time import sleep
import dht
sensor = dht.DHT11(Pin(5))
while True:
try:
sleep(2)
sensor.measure()
t = sensor.temperature()
h = sensor.humidity()
print('Temperature: %3.1f C' %t)
print('Humidity: %3.1f %%' %h)
except OSError as e:
print('Sensor Reading Failed')
Monitor DHT11 Humidity Temperature Data on OLED with MicroPython Code Here is the connection diagram. The OLED Display is an I2C Module. So connect the SDA & SCL pin of OLED Display to ESP32 D26 & D25 Pin respectively.
Open a browser and type the ESP32 IP address. Your web server should display the latest sensor readings.