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

Arduino Project 036 - DTH Temperature and Humid Sensor

RonWang6个月前 (11-30)电子编程242

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://parentscn.com/?id=293

标签: Arduino

相关文章

Arduino Project 015 - Simple Motor Control

Arduino Project 015 - Simple Motor Control

First, you’re going to simply control the speed of a DC motor in one direction, using a power transi...

Arduino Project 041 - Ultrasonic Distance OLED 128X64 Display

Arduino Project 041 - Ultrasonic Distance OLED 128X64 Display

About the Ultrasonic sensor knowledge and infor mation click the link : Arduino Project 038 - S...

Arduino Project 030A - Dual Motor Driver L298N

Arduino Project 030A - Dual Motor Driver L298N

L298N Dual Motor Driver Project Description  The L298N Motor Driver is a control...

Arduino Project 021 -  LED Dot Matrix Display - Scrolling Message

Arduino Project 021 - LED Dot Matrix Display - Scrolling Message

There are many different ways to drive LEDs. Using shift registers is one way and they have their a...

Arduino Project 018 - Dual Shift Register 8-Bit Binary Counter

Arduino Project 018 - Dual Shift Register 8-Bit Binary Counter

In Project 18, you will daisy chain (or cascade) another 74HC595 IC onto the one used in Project 17...

Arduino Project 023A - Liquid Crystal Displays - Autoscroll

Arduino Project 023A - Liquid Crystal Displays - Autoscroll

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