2450 views|3 replies

1237

Posts

66

Resources
The OP
 

[NUCLEO-L552ZE Review] + IoT Application Development: Driving Temperature and Humidity Sensor DHT22 [Copy link]

DHT22 (AM2302) is a calibrated digital temperature and humidity sensor used to detect ambient temperature and humidity, with a standard single bus
interface. It has higher accuracy and a larger range than DHT11.

The real thing is as follows:

The basic parameters of DHT22 are as follows:

Interface description:
VCC: connect to 3.3V ~ 5.5V
GND: connect to GND
DOUT: connect to MCU IO

The AM2302 device uses a simplified single bus communication. A single bus has only one data line, and the data exchange and control in the system are all
completed by the data line. A single bus usually requires an external pull-up resistor of about 5.1kΩ, so that when the bus is idle, its state is
high. SDA is used for communication and synchronization between the microprocessor and AM2302. It uses a single bus data format and transmits 40
bits of data at a time, with the high bit first. Therefore, only one GPIO of NUCLEO-L552ZE is needed to drive it, and PG1 is used here.

Add the driver code to the project, where the temperature and humidity values are printed every 1 second:

The results are as follows:

Test project:

stm32l552zet6qu_test.7z (6.49 MB, downloads: 17)

DHT22 related information:

DHT22-Temperature-Humidity-Sensor-UserManual.pdf (707.75 KB, downloads: 2)

AM2302_V1.1.pdf (865.45 KB, downloads: 4)

This post is from stm32/stm8

Latest reply

ST new product NUCLEO-L552ZE-Q (Cortex-M33) Summary post: https://bbs.eeworld.com.cn/thread-1152571-1-1.html   Details Published on 2020-12-28 10:47
 

1457

Posts

1

Resources
2
 
This post was last edited by jinglixixi on 2020-12-28 16:00

Thanks for sharing

This post is from stm32/stm8
 
 

1w

Posts

204

Resources
3
 

ST new product NUCLEO-L552ZE-Q (Cortex-M33)

Summary post: https://bbs.eeworld.com.cn/thread-1152571-1-1.html

This post is from stm32/stm8
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 

1237

Posts

66

Resources
4
 

This post is from stm32/stm8
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list