-
1Setup
There are 4 pins on the sensor:
Since one of the 4 pins has no function, there are temperature/humidity sensors with only 3 pins on the market:
DHT is normally in the sleeping mode. To get the temperature/humidity data, please follow the steps:
- Awake DHT: Ameba toggles low its DATA pin of GPIO. Now the DATA pin of GPIO serves as digital out to Ameba.
- DHT response: DHT also toggle low its DATA pin of GPIO. Now the DATA pin of GPIO serves as digital in for Ameba.
- DHT sends data: DHT sends out the temperature/humidity data (which has size 5 bytes) in a bit by bit manner. To represent each bit, DHT first pull low the DATA GPIO pin for a while and then pull high. If the duration of high is smaller than low, it stands for bit 0. Otherwise it stands for bit 1.
Follow the wiring diagram below:
-
2Final Result
Open the sample code in “Files” -> “Examples” -> “AmebaGPIO” -> “DHT_Tester”. Compile and upload to Ameba, then press the reset button. The result would be shown on the Serial Monitor.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.