使用带有DTH11的Arduino ATmega328P ADC读取温度[关闭]

问题描述 投票:-1回答:1

我在学校有一点问题,我必须从DTH11传感器读取Arduino的温度,然后用C语言连续打印。有人可以通过示例或其他方式帮助我。

arduino embedded temperature adc
1个回答
1
投票

例如,您可以在Internet上找到DHT11数据表

https://akizukidenshi.com/download/ds/aosong/DHT11.pdf

https://www.mouser.com/ds/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf

有一些部分解释了传感器模块如何通过1线与MCU(Arduino)进行通信。

然后,一旦你知道通信是如何发生的,你可以阅读更多的文章

https://howtomechatronics.com/tutorials/arduino/dht11-dht22-sensors-temperature-and-humidity-tutorial-using-arduino/

还有很多其他的,大多数使用已经编写的库。

如果您的作业不允许使用库,则必须阅读https://playground.arduino.cc/Main/DHTLib/文件dht.hdht.cpp中的代码,并根据您对DHT数据表中提供的信息的理解,实现您自己的,可能是最小版本。

我建议首先使用库来使工作正常,然后将其更改为无需工作。

© www.soinside.com 2019 - 2024. All rights reserved.