[PIC] Programming of DHT11 sensor

Status
Not open for further replies.

guravsid

Junior Member level 1
Joined
Oct 8, 2013
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
108
I am using PIC18F4550 microcontroller to sense the data from DHT11 sensor. The sensor gives humidity and temperature. How should I decode the data from sensor. Can anyone provide me the program ??
 

Looking at the info supplied by the manufacturer

1) The microcontroller must initiate communication with the DHT11 maintaining the data line low state for at least 18 ms. on pin 2 of the DTH11
2) DHT11 then sends a response with a low pulse 80 uS and then left to "float" the data line for another 80 uS.
3) After the float the dataline goes high
4) All bits start with a low pulse of 50 uS.
5) Then comes a high pulse which varies the logic state or the bit value that DHT11 conveyed. 26-28 microsecond pulses for a "0" and pulses of 70 microseconds for a "1" are used. The pulses are repeated until a total of 40 bits.
6) 40 bits (5 bytes) are transmitted in total
The first byte is that we receive the integer part of the relative humidity (RH)
The second byte is the decimal part of the relative humidity (not used in the DHT11 is always 0)
The third byte is the integer part of the temperature
The fourth byte is the decimal part of the temperature (not used in the DHT11 is always 0)
The last byte is the checksum (checksum), resulting from adding all previous bytes
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…