Table 5:AM2302 Communication format specifier
Name
Single-bus format definition
Start signal
Response
signal
Data format
Humidity
Temp.
Microprocessor data bus (SDA) to bring down a period of time (at least 800μ s) [1] notify the
sensor to prepare the data.
Sensor data bus (SDA) is pulled down to 80μ s, followed by high-80μ s response to host the
start signal.
Host the start signal is received, the sensor one-time string from the data bus (SDA) 40 data, the
high first-out.
Humidity resolution of 16Bit, the previous high; humidity sensor string value is 10 times the
actual humidity values.
Temperature resolution of 16Bit, the previous high; temperature sensor string value is 10 times
the actual temperature value;
The temperature is the highest bit (Bit15) is equal to 1 indicates a negative temperature, the
temperature is the highest bit (Bit15) is equal to 0 indicates a positive temperature;
Temperature in addition to the most significant bit (Bit14 ~ bit 0) temperature values.
Parity bit Parity bit = humidity high + humidity low + temperature high + temperature low
◎Single-bus data calculation example
Example 1:40 Data received:
0000 0010
1001 0010
0000 0001
0000 1101
1010 0010
High humidity 8 Low humidity 8 High temp. 8 Low temp. 8
Parity bit
Calculate:
0000 0010+1001 0010 +0000 0001+0000 1101= 1010 0010(Parity bit)
Received data is correct:
humidity:0000 0010 1001 0010 = 0292H (Hexadecimal)= 2×256 + 9×16 + 2 = 658
=> Humidity = 65.8%RH
Temp.:0000 0001 0000 1101 = 10DH(Hexadecimal) = 1×256 + 0×16 + 13 = 269
=> Temp.= 26.9℃
◎Special Instructions:
When the temperature is below 0 ℃, the highest position of the temperature data.
Example: -10.1 ℃ Expressed as 1 000 0000 0110 0101
Temp.:0000 0000 0110 0101 = 0065H(Hexadecimal)= 6×16 +5 = 101
=> Temp. = -10.1℃
Example 2:40 received data:
0000 0010
1001 0010
0000 0001
0000 1101
1011 0010
High humidity 8 Low humidity 8 High temp. 8 Low temp. 8
Parity bit
Calculate:
0000 0010+1001 0010 +0000 0001+0000 1101= 1010 0010 ≠ 1011 0010 (Validation error)
The received data is not correct, give up, to re-receive data.
Aosong(Guangzhou) Electronics Co.,Ltd.
TEL:020-36042809 / 36380552
-5-
www.aosong.com