Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DHT11 and DHT22 temp/humidity sensors protocol.

Status
Not open for further replies.

dr pepper

Well-Known Member
Most Helpful Member
I might have asked this before.
I have used a few dht11 temp and humid sensors with single wire protocol.
Both the '11 and the '22 are shown in the datasheets as being the same protocol, just that the '11 only ever replies with zero's after the decimal point, whereas the '22 does reply with tenths.
Obviously theres a messup either in the devices or the datasheet which is cryptic, the fact that you can get a library for the arduino that reads both devices, but has seperate subroutine labels for each suggests theres a diffrence.
Has anyone any knowledge of the diffrences?, I'm guessing its timing.
 
Have you actually identified the text where datasheets difer?
Could you post it?
 
Hi
The DHT11/22 can be the same Read routine, ie: 32 bits.
Code:
'read DHT bit string [this is Oshonsoft Basic]
ServoIn PORTC.0, dta(0)  'Wait for dht
For bfr = 31 To 0 Step -1  'number of humidity and temp 10uSec periods/DHT bit
ServoIn PORTC.0, dta(bfr)
Next bfr

As the DHT22 has a higher degree of resolution/accuracy than the DHT11, its the formatting for the data thats different.
 
Now I'm foncused.
The datasheets says they are the same dht11 and '22, the only diffrence is that the '22 sends a valid decimal value, whereas the '11 allways sends a zero, this much I know as the 11's I have allways send a zero after the temp and humid integer.
Arduino library's for the dht specify a diffrent subroutine for the dht11 and the dht22, that confirms my suspicion that they are in fact different.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top