DHT22 SDK

From ElectroDragon Wiki

Data

DATA = 16 bits RH data + 16 bits Temperature data + 8 bits check-sum check-sum check-sum
Example: MCU has received 40 bits data from AM2302 as
0000 0010 1000 1100 - 0000 0001 0101 1111 - 1110 1110
16 bits RH data - 16 bits T data - check sum

Here we convert 16 bits RH data from binary system to decimal system,

0000 0010 1000 1100 → 652
Binary system →Decimal system
RH=652/10=65.2%RH 

Here we convert 16 bits T data from binary system to decimal system,

0000 0001 0101 1111 → 351
Binary system → Decimal system
T=351/10=35.1 

When highest bit of temperature is 1, it means the temperature is below 0 degree Celsius.

Example: 1000 0000 0110 0101, T= minus 10.1℃
         16 bits T data
Sum= 0000 0010 + 1000 1100 + 0000 0001 + 0101 1111 = 1110 1110
Check-sum = the last 8 bits of Sum = 1110 1110


Datasheet