当前位置:首页 > 科学研究 > 电子编程 > 正文内容

Arduino Project 036 - DTH Temperature and Humid Sensor

RonWang7个月前 (11-30)电子编程267

The DHT11 Temperature and Humidity Sensor senses, measures and regularly reports the relative humidity in the air. It measures both moisture and air temperature. The warmer the air is, the more moisture it can hold, so relative humidity changes with fluctuations in the temperature.

Humidity sensors detect the relative humidity of immediate environments in which they are placed. They measure both moisture and temperature in the air and express relative humidity as a percentage of the ratio of moisture in the air to the maximum amount that can be held in the air at the current temperature. As the air becomes hotter, it holds more moisture, so the relative humidity changes with the temperature.

The DHT11 sensor operates by utilizing a thermistor to measure temperature and a humidity-sensitive capacitor to gauge the relative humidity in the surrounding environment. When connected to an Arduino board, the sensor sends digital signals that can be interpreted to obtain accurate readings of both temperature and humidity levels.

Inside the DHT11, changes in temperature cause resistance in the thermistor to vary, affecting the voltage drop across it. This change is then converted into a digital signal for processing. Similarly, fluctuations in humidity lead to alterations in capacitance within the sensor’s circuitry, which are also translated into digital data for analysis.

Project 36 DTH Temperature and Humid Sensor

/* Coding Ron Wang
   Nov.28th 2024
   Autaba provides Hardware support for the project
   © Schematic Design Fritzing By Ron Wang 2024 NY
   © Circuit Design Fritzing By Ron Wang 2024 NY
   Project 36  DHT11 Temperature and Humid Sensor
 */
#include  <SimpleDHT.h> // Adding DHT libraries
int  pinDHT11 = 11;  //Declaring digital pin no 11 as the dht11 data pin
SimpleDHT11 dht11;
void setup() {
 Serial.begin(9600); // Choose 9600 at the  port screen 
}
void loop() {
   
  Serial.println("=================================");
  Serial.println("DHT11 readings...");
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;
  //This bit will tell our Arduino what to do if there is some sort of an error at getting readings  from our sensor
  if ((err = dht11.read(pinDHT11, &temperature, &humidity, NULL))  != SimpleDHTErrSuccess) {
    Serial.print("No reading , err="); Serial.println(err);delay(1000);
    return;
  }
  
  Serial.print("Readings: ");
  Serial.print((int)temperature);  Serial.print(" Celcius, ");
  Serial.print((int)humidity); Serial.println("  %");
  delay(750);
}

Arduino Temp and Humid Circuit

DTH Temperature and Humid Sensor Circuit

Arduino Temp and Humid Sensor Schematic

DTH Temperature and Humid Sensor Schematic

版权声明:本文为原创文章,版权归donstudio所有,欢迎分享本文,转载请保留出处!

本文链接:http://www.donstudio.cn/?id=293

标签: Arduino

相关文章

Arduino Project 014 - Light Sensor

Arduino Project 014 - Light Sensor

This project introduces a new component known as a Light Dependent Resistor, or LDR. As the name imp...

Arduino Project 005 - LED Chase Lights

Arduino Project 005 - LED Chase Lights

You’re going to use a string of LEDs (10 in total) to make an LED chase effect, similar to that used...

Arduino Project 035 - Keypad 4X4 or 4X3

Arduino Project 035 - Keypad 4X4 or 4X3

Most of the time we are used key, button, or switch to get input value in our projects. When we inte...

 Arduino Project 043 - SD CardTemperature Datalogger

Arduino Project 043 - SD CardTemperature Datalogger

Todady I made a simple Arduino datalogger using SD card and DHT11  relative humidity and t...

Arduino Project 023 - Liquid Crystal Displays - Hello World

Arduino Project 023 - Liquid Crystal Displays - Hello World

Before wiring the LCD screen to your Arduino board we suggest to solder a pin header strip to the 14...

 ​Arduino Project 049 - IR Remote Control

​Arduino Project 049 - IR Remote Control

Project 49 IR Remote Control/* Project 49 IR Remote Control  * C...