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

Arduino Project 036 - DTH Temperature and Humid Sensor

RonWang5个月前 (11-30)电子编程216

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 048 - Human Body Infrared Detector and Relay Light

​Arduino Project 048 - Human Body Infrared Detector and Relay Light

Project 48 Human Body Infrared Detector and Relay Light/*  * Coding by Ronwang&...

Arduino Project 013 - Piezo Knock Sensor

Arduino Project 013 - Piezo Knock Sensor

A piezo disc works when an electric current is passed over the ceramic material in the disc, causing...

Arduino Project 023D - Liquid Crystal Displays - Custom Character

Arduino Project 023D - Liquid Crystal Displays - Custom Character

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

Arduino Project 008 - RGB LED Mood Lamp

Arduino Project 008 - RGB LED Mood Lamp

In the last project, you learned how to adjust the brightness of an LED using the PWM capabilities o...

Arduino Project 039 - Ultrasonic Distance Display

Arduino Project 039 - Ultrasonic Distance Display

Ultrasonic sensors measure distance by sending and receiving the ultrasonic wave. The ultrasonic sen...

Arduino Project 026 - Dual Servo Control

Arduino Project 026 - Dual Servo Control

This project you’ll create another simple project, but this time you’ll control two servos using com...