Description
The jm_dhtxx.spin2 object wakes and reads data from the DHT11, DHT22 and CM2302 Humidity and Temperature Sensors. In the top file, configure the S_TYPE for the sensor you are using (DHT11 or DHT22). The CM2302 should be set as DHT22 since they use the same communication protocol.
con
#true, ON, OFF
#false, NO, YES
S_TYPE = dht.DHT22 ' set sensor type
To use the sensor, I modified the example to have a second instance of the jm_dhtxx object to use with a second sensor, with one inside a conditioned sunny office and another one outdoors on a cold, storm day. The Parallax Serial Terminal showed the following data for the two sensors:
The CM2302 sensor packaging and response time is designed for measuring ambient environments commonly found inside and outside, provided it can be kept dry. For interest, I conducted some informal tests to see the sensor’s response to rapidly changing humidity and temperature with ice, a heat gun, compressed air and steam.
Document Author
- Ken Gracey
Source Code Author
- Jon McPhalen