Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32 and DHT11 Wi-Fi Enabled Temperature and Humidity Sensor

View and Edit Project In Cirkit DesignerImage of ESP32 and DHT11 Wi-Fi Enabled Temperature and Humidity Sensor

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that includes an ESP32 microcontroller and a DHT11 temperature and humidity sensor. The ESP32 is used to read data from the DHT11 sensor. The circuit is powered by a 5V supply from the ESP32.

Component List

ESP32 - 38 pins

DHT11

Wiring Details

ESP32 - 38 pins

DHT11

Code

There is no code provided for this circuit. However, typically, the ESP32 would run a program to read data from the DHT11 sensor and process or transmit it as needed. Below is a sample code snippet that could be used to read data from the DHT11 sensor using the ESP32:

#include "DHT.h"

#define DHTPIN 33     // Pin connected to the DHT11 sensor
#define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);
  dht.begin();
}

void loop() {
  delay(2000); // Wait a few seconds between measurements

  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
}

This code initializes the DHT11 sensor, reads the temperature and humidity values, and prints them to the serial monitor.