Digital Temperature and Humidity Sensor AM2320 Product Manual Product Features: Ultra-small size Super cost-effective Ultra-low voltage operation Excellent long-term stability Standard I2C and single-bus output
1. Product overview Temperature and humidity combined sensor AM2320 digital temperature and humidity sensor is a digital signal output has been calibrated. Using special temperature and humidity acquisition technology, ensure that the product has a very high reliability and excellent long-term stability. Sensor consists of a capacitive moisture element and an integrated high-precision temperature measurement devices, and connected with a high-performance microprocessor .
External Interface: 1: VDD 2: SDA 3: GND 4: SCL 5. Sensor performance 5.1 Relative Humidity Table 1: AM2320 relative humidity performance table parameter condition mi typ max unit n resolution 0.1 Range Accuracy 0 99.9 25℃ Repeatability Interchangeability Response time %RH ±3 %RH ±0.1 %RH Completely interchangeable 1/e(63%) Sluggish Drift %RH Typical <5 S ±0.3 %RH <0.5 %RH values Figure 2: 25 ℃ relative humidity of maximum error AM2320 /yr 5.
Interchangeability Response time 1/e(63%) Drift <5 S ±0.1 ℃/yr Figure 3: The maximum error of the temperature sensor 6. Electrical Characteristics Electrical characteristics, such as high energy consumption, low level, input and output voltage, etc., depending on the power supply. Table 3 details the AM2320 electrical characteristics, if not marked, it means that the power supply voltage of 5V.
Table 4: AM2320 pin assignment Pin Name Description 1 VDD Power supply(3.1-5.5V) 2 SDA Serial data, bidirectional port 3 GND Ground 4 SCL Serial clock input port (single bus ground) 7.2 Power supply pin (VDD GND) AM2320 supply voltage range of 3.1V - 5.5V. 7.3 Serial clock input (SCL) The SCL pin is used to communicate the choice and I 2 C sensor communication clock line.
8.1.2 I 2 C Bus Overview Philips (Philips) at 20 years ago invented a simple two-wire bidirectional serial communication bus, the bus is called the Inter-I 2 C bus. Currently I 2 C bus has become the industry standard solution for embedded application, is widely used in a variety of professional-based micro controller, consumer and telecommunications products, as a control, diagnostics and power management bus.
is limited, the transfer rate on a I 2 C bus data in standard mode speeds up to 100Kb / s. ◎I 2 C Bus bit transmission I 2 C bus bit transmitted through the data line SDA and SCL clock line two lines together to complete. During high clock line SCL and SDA data line represents the current transmission is low logic level "0"; during high clock line SCL and SDA data line is high logic level represents the current transmission "1.
transition from. Bus stop condition is generated in an idle state. The stop condition abbreviated as P. Start and stop conditions diagram shown in Figure 7. Figure 7: Schematic start and stop conditions ◎Byte transfer format I 2 C bus to send and receive data in bytes. Each byte is transmitted to the SDA line must be 8. The number of bytes per transfer is unrestricted. First, is the highest transmission bit data (MSB bit 7), the last transmission is lowest (LSB, bit 0).
C bus Response: 9 Figure ◎Slave Address I 2 C bus does not additional address decoder and chip select signals. Multiple with I 2 C bus interface devices can be connected to the same I 2 C bus, through the device address to distinguish between them. I 2 C bus addressing procedure is usually starting at the first byte determines the conditions to choose which one from the host machine, the seven addressable address (the other is a 10-bit addressing addresses differ the sensor uses seven addressable address).
Figure 11: C bus master sends the data to the machine from the basic format 2 Figure 12: I C bus master basic format for receiving data from a machine 8.2 AM2320 sensor I 2 C communication protocol AM2320 serial interface for the I 2 C bus, in full accordance with I 2 C standard protocols addressing, can be directly linked to the I 2 C bus.
This section describes the I 2 C interface characteristics AM2320 sensor, if you want to get the best communication with the sensor results, designed in strict compliance with the conditions of Figure 13 and Table 6 design. Figure 1 13 3: AM2320 typical application circuit I2C bus and timing diagram Table 6 : AM2320 sensor C interface characteristics Symbol Standard C mode Parameters min SCL clock frequency 100 T w (SCLL) SCL Clock low time 4.7 T w (SCLH) SCL Clock high time 4.
When a command is sent by the sending communication device (host) to the sensor, the command line with the sensor address, the sensor was to receive, and read the information in accordance with the function codes and requirements; then the results (data) is sent back to the host. The information returned includes the function code, and after execution of the data CRC code (the user may read the CRC, can be sent directly to a stop condition).
(24-31) Bit Retention 0x04 Retention 0x05 Retention 0x06 Retention 0x07 Device ID (24-31) Bit Device ID (24-31) Bit Device ID (24-31) Bit Status Register 0x0C Retention 0x14 Retention 0x1C 0x0D Retention 0x15 Retention 0x1D 0x0E Retention 0x16 Retention 0x1E 0x0F Retention 0x17 Retention 0x1F ◎Temperature output format Temperature resolution is 16Bit, temperature highest bit (Bit15) is equal to 1 indicates a negative temperature, the temperature highest bit (Bit15) is equal to 0
Sensor address 1 0xB8 Sensor C address (0xB8) + W (0) Function Code 1 0x03 Read register Starting address 1 0x00 Register start address is 0x00 Number of registers 1 0x04 Read the number of register Sensor response message format returned: Slave response Byte count Transmitting information Remarks Function Code 1 0x03 Read register Returns the number of bytes 1 0x04 Returns 4 of 4 byte register Register 1 1 0x01 Address for the content of 0x00 (high humidity bytes) Register 2
Save word length 1 0x02 Save the data word length (2 words) Save Data1 1 0x01 Save the data (address: 10) Save Data2 1 0x02 Save the data (address: 11) CRC code 2 C092 Host calculated CRC code, low byte first(C addresses are not included in the CRC calculation) Sensor response message format returned: Slave response Byte count Transmitting information Remarks Function Code 1 0x10 Write Multiple Registers Starting address 1 0x10 Starting address saved Save the data length 1 0x10
{ } 8. The resulting CRC register contents is: CRC code. ◎CRC calculation code in C language code Description: This program to calculate the length len * ptr bytes before the CRC. unsigned short crc16(unsigned char *ptr, unsigned char len) unsigned short crc =0xFFFF; unsigned char i; while(len--) { crc ^=*ptr++; or(i=0;i<8;i++) { if(crc & 0x01) { crc>>=1; crc^=0xA001; }else { crc>>=1; } } } return crc; 8.2.
2 Figure14: I C sensors read the complete example of fig ◎I 2 C read and write timing decomposition Sensors read or write, you must follow these three steps, otherwise it will not communicate or can’t read the correct data: Step one: Wake Sensor In order to reduce the humidity sensor errors caused by self-heating, the sensor in a non-working state, dormant, so to read the sensor must wake sensor to transmit commands to read and write, otherwise the sensor will not respond.
clock, reading data, or communication error occurs. Figure 17: Read the sample temperature and humidity values Host read back the data as follows: 0x03(Function Code)+0x04(data length)+0x03(high humidity)+0x39(low humidity) + 0x01 (high temperature) +0x15(low temperature)+0xE1(CRC checksum low byte) + 0xFE (CRC checksum high byte); Therefore: 0339H = 3×256 +3×16 +9 = 825 => humidity = 825÷10 = 82.5% RH; 0115H = 1×256 +1×16 +5 = 277 => temperature = 277÷10 = 27.
2 Figure18: The I C read sensor flowchart 2 Tables Table 1: I C_MODBUS communication protocol summary table 2 Read Bus Description: I C address is 0xB8; access a maximum of 10 registers; Time to read a communication bus for a maximum of 3 S.
Register Addr Register Addr Register Addr information ess information ess information ess High humidity Low humidity High temperatur e Low temperatur e 0x00 Model High 0x08 0x01 Model Low 0x09 0x02 The version number 0x0A 0x03 Retention 0x04 Retention 0x05 Retention 0x06 Retention 0x07 Device ID (24-31) Bit Device ID (16-23) 0x0B Users register a high Users register a low Users register 2 high Users register 2 low Register informatio n Addre ss 0x10 Retention 0x18 0x
Send:(SLA+W)+0x10+0x0F+0x01+0x01+0xF4(Low)+0xB7(High) Note:Function code + register start address + register number Write Status Register 0x10 0x0F + save content+ CRC Return:0x10+0x0F+0x01+0xB4(Low Byte)+0x35(High Byte) Note:Function code + number + register start address register+ CRC Write a user registers a Send:(SLA+W)+0x10+0x10+0x02+0x01+0x02+0xC0+0x92 0x10 0x10 Return:0x10+0x10+0x02+0xFC+0x04 Note: SLA = I2C address 0xB8.
◎ Single Bus Description AM2320 device uses a simplified single-bus communication. Single bus that only one data line, the data exchange system, the control by the data line is completed. Device (microprocessor) through an open-drain or tree-state port is connected to the data line to allow the device when not transmitting data to release the bus, and let other devices use the bus; single bus usually requires an external 5.
Humidity:0000 0010 1001 0010 = 0292H (hex) = 2×256 + 9× 6 + 2 = 658 => Humidity = 65.8% RH Temperature:0000 0001 0000 1101 = 10DH (hex) = 1×256 + 0×16 + 13 = 269 => Temperature = 26.9 ℃ ◎ Special Instructions: When the temperature is below 0 ℃ temperature data for a top position. Example One: -10.1 ℃ expressed as 1,000,000,001,100,101 Temperature: 0000 0000 0110 0101 = 0065H (hex) = 6×16 +5 = 101 => Temperature = -10.
T h0 Signal "0" High Time 22 26 30 µS T h1 Signal "1" High Time 68 70 75 µS T en Sensor releases the bus time 45 50 55 µS Note: To ensure quasi-sensor indeed communication, the user reads the letter when number, strictly in accordance with table 10 and the parameters in figure 21 program design. 8.3.4 Peripheral reading step example Communication between the host and the sensor reads the data can be done through the following three steps.
Figure 23: Single-bus timing diagram decomposition Data bus SDA AM2320 output 40-bit of data , the continued output low 50 microseconds after the entry into the state, due to the pull-up resistor attendant goes high. Meanwhile AM2320 retest internal temperature and humidity data, and record data, test recording ends, the micro controller automatically goes to sleep. Only after receipt of the start signal micro controller host, only to re-awaken the sensor, enter the working state. 8.3.
recovery process can be found in "recovery process." The use of the product will accelerate the aging process for a long time under abnormal operating conditions. Avoid placing components on a long-term condensation and dry conditions and the following environment. A, salt spray B, the acid or oxidizing gases such as sulfur dioxide, hydrochloric acid Recommended Storage Environment Temperature: 10 ~ 40 ℃ Humidity: 60% RH or less 2.
only the signing of a contract or license the software. 11. Warnings and personal injury Do not use this product as safety or emergency stop devices, as well as due to the failure of the product could result in personal injuries to any of the other applications. The product shall not apply unless there is a particular purpose or use authorization. Before installation, handling, use or maintenance of the product to the reference product data sheets and application notes.