0% found this document useful (0 votes)
19 views

DHT11

The document discusses a DHT11 humidity and temperature sensor. It can measure temperature from 0 to 60 degrees Celsius and humidity from 20% to 90% relative humidity. It outputs a digital signal containing the measurement data through its three pins: power, ground, and data.

Uploaded by

Mahesh Gadekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

DHT11

The document discusses a DHT11 humidity and temperature sensor. It can measure temperature from 0 to 60 degrees Celsius and humidity from 20% to 90% relative humidity. It outputs a digital signal containing the measurement data through its three pins: power, ground, and data.

Uploaded by

Mahesh Gadekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DHT11 Humidity-temperature Sensor

The digital temperature and humidity sensor DHT11 is a composite sensor


that contains a calibrated digital signal output of temperature and humidity.
The technology of a dedicated digital modules collection and the temperature
and humidity sensing technology are applied to ensure that the product has
high reliability and excellent long-term stability.

The sensor includes a resistive sense of wet component and an NTC


temperature measurement device, and is connected with a high-
performance 8-bit microcontroller.

Only three pins are available for use: VCC, GND, and DATA. The
communication process begins with the DATA line sending start signals to
DHT11, and DHT11 receives the signals and returns an answer signal. Then
the host receives the answer signal and begins to receive 40-bit humiture
data (8-bit humidity integer + 8-bit humidity decimal + 8-bit temperature
integer + 8-bit temperature decimal + 8-bit checksum).
Features

1. Humidity measurement range: 20 - 90%RH


2. Temperature measurement range: 0 - 60℃
3. Output digital signals indicating temperature and humidity
4. Working voltage:DC 5V; PCB size: 2.0 x 2.0 cm
5. Humidity measurement accuracy: ±5%RH
6. Temperature measurement accuracy: ±2℃

6.2 Temperature - Humidity

Humidity and temperature are closely related from the physical quantity
itself to the actual people’s life. The temperature and humidity of human
environment will directly affect the thermoregulatory function and heat
transfer effect of human body. It will further affect the thinking activity and
mental state, thus affecting the efficiency of our study and work.

Temperature is one of the seven basic physical quantities in the


International System of Units, which is used to measure the degree of hot
and cold of an object. Celsius is one of the more widely used temperature
scales in the world, expressed by the symbol “℃”.

Humidity is the concentration of water vapor present in the air. The relative
humidity of air is commonly used in life and is expressed in %RH. Relative
humidity is closely related to temperature. For a certain volume of sealed
gas, the higher the temperature, the lower the relative humidity, and the
lower the temperature, the higher the relative humidity.
A basic digital temperature and humidity sensor, the DHT11, uses a capacitive
humidity sensor and thermistor to measure the surrounding air and outputs a
digital signal on the data pins (no analog input pins are required).

To measure tem and humidity following things are required.

S. No. COMPONENT QUANTITY

1 Raspberry Pi Pico W 1

2 Micro USB Cable 1

3 Breadboard 1

4 Jumper Wires Several

5 DHT11 Humiture Sensor 1

Schematic
from machine import Pin, I2C
import utime as time
from dht import DHT11, InvalidPulseCount

pin = Pin(16, Pin.IN, Pin.PULL_UP)


sensor = DHT11(pin)
time.sleep(5) # initial delay

while True:
try:
sensor.measure()
string = "Temperature:{}\nHumidity: {}".format(sensor.temperature, sensor.humidity)
print(string)
time.sleep(4)

except InvalidPulseCount as e:
print('Bad pulse count - retrying ...')

After the code is run, you will see the Shell continuously print out the temperature and humidity, and as
the program runs steadily, these two values will become more and more accurate.

How it works?

In the dht library, we have integrated the relevant functionality into


the DHT11 class.

from dht import DHT11, InvalidPulseCount

Initialize the DHT11 object. This device only needs a digital input to be used.

pin = Pin(16, Pin.IN, Pin.PULL_UP)


sensor = DHT11(pin)

Use sensor.measure() to read the current temperature and humidity, which will
be stored in sensor.temperature , sensor.humidity . They are then printed out.
Finally the DHT11 sampling rate is 1HZ, a time.sleep(1) is needed in the loop.

while True:
try:
sensor.measure()
string = "Temperature:{}\nHumidity: {}".format(sensor.temperature, sensor.humidity)
print(string)
time.sleep(4)

except InvalidPulseCount as e:
print('Bad pulse count - retrying ...')

You might also like