Accurate temperature and humidity sensor for breadboards and easy connection with Dupont cables.
SKU: OT729-D67 Article number: AB060 EAN: 4312640130235 Location: D06.07
Alternative
Temperature and humidity sensor in one | DHT11
€ 1,80
View this alternative
How to connect the Temperature and humidity sensor in one | DHT22 module for breadboard to an Arduino UNO or ESP32, with an example sketch you can upload straight away.
This project reads ambient temperature and relative humidity using a DHT22 sensor and an Arduino Uno. The readings are refreshed every two seconds and displayed on the Serial Monitor. It provides a simple and reliable way to verify your sensor is working correctly.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : DHT22 Temperature and Humidity Monitor
* Board : Arduino UNO (arduino:avr:uno)
* Parts : DHT22
* Libraries : DHT sensor library 1.4.7
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Serial.println(F("DHT22 Reading Demo"));
dht.begin();
}
void loop() {
// DHT22 sampling rate is roughly once every 2 seconds
delay(2000);
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();
if (isnan(humidity) || isnan(temperature)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
Serial.print(F("Humidity: "));
Serial.print(humidity, 1);
Serial.print(F("% | Temperature: "));
Serial.print(temperature, 1);
Serial.println(F("°C"));
}
Required libraries: DHT sensor library 1.4.7
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project reads temperature and humidity data from a DHT22 sensor using an ESP32. Power is supplied at 3.3V to ensure safe logic levels for the ESP32. Open the Serial Monitor at 115200 baud to view continuous real-time environmental measurements every two seconds.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : DHT22 Temperature and Humidity Monitor
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : DHT22
* Libraries : DHT sensor library 1.4.7
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Serial.println("DHT22 Sensor Reading Test");
dht.begin();
}
void loop() {
// Wait 2 seconds between measurements (DHT22 sampling rate is ~0.5Hz)
delay(2000);
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();
// Check if any reads failed and exit early
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Serial.print("Humidity: ");
Serial.print(humidity, 1);
Serial.print(" % | Temperature: ");
Serial.print(temperature, 1);
Serial.println(" °C");
}
Required libraries: DHT sensor library 1.4.7
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This is the big brother of the DHT11 and much more accurate. The sensor measures both temperature and humidity.
Module for breadboard or easy connection of Dupont cables (included)
Temperature measurement range is -40 to +80 degrees Celsius.
Accuracy of +/- 0.5 degrees
Power supply: 3.3v to 6v
Humidity range: 0-100% RH.
Humidity accuracy: ±2.0% RH.
Response time: < 3 sec.
Incl: Dupont cables Female-Female
Dimensions
Length: 4.35cm
Width: 1.53cm
Height: 0.97cm
| Power supply | 3.3V to 6V |
|---|---|
| Width | 1,53 cm |
| Suitable for | breadboard |
| Temperature range | -40 to +80 °C |
| Length | 4,35 cm |
| Height | 0,97 cm |
| Temperature accuracy | ± 0.5 °C |
| Humidity range | 0-100% RH |
| Humidity accuracy | ±2,0% RH |
| Response time | < 3 sec |
Accurate.
Temperature and humidity sensor in one | DHT22 module for breadboard