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

Arduino UNO with DHT11 Temperature Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO with DHT11 Temperature Sensor

Circuit Documentation

Summary of the Circuit

This circuit consists of an Arduino UNO microcontroller board interfaced with a KY-015 DHT11 temperature and humidity sensor module. The Arduino UNO is responsible for controlling the sensor module, reading temperature and humidity data, and communicating the information to a computer via the serial interface. The sensor module is powered by the 5V output from the Arduino and communicates with a digital input pin on the Arduino.

Component List

Arduino UNO

KY-015 DHT11 Temperature and Humidity Sensor

Wiring Details

Arduino UNO

KY-015 DHT11 Temperature and Humidity Sensor

Documented Code

// include DHT library
#include<DHT.h>

// save pin to a variable
int tempPin = 6;

// clone the dht library
dht DHT;

void setup() {
  // put your setup code here, to run once:
  // begin serial monitor to enable communication between the board and the computer
  Serial.begin(9600);
  // set pinMode
  pinMode(tempPin, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  int chk = DHT.read11(tempPin); // check the data coming from the DHT pin
  Serial.print("Temperature = "); // print temperature on the serial monitor
  Serial.println(DHT.temperature);
}

File Name: sketch.ino

Description: This code initializes the DHT library for the temperature and humidity sensor, sets up the serial communication at 9600 baud rate, and continuously reads the temperature data from the sensor, printing it to the serial monitor. The tempPin variable is assigned to pin 6, which is connected to the sensor's data pin. The DHT.read11(tempPin) function reads the temperature and humidity from the sensor and stores it in the DHT object. The temperature is then printed to the serial monitor.