Application of digital I2C bus temperature sensor in temperature detection

Publisher:温馨小屋Latest update time:2011-06-10 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Basic characteristics of ds1624

ds1624 is a powerful digital temperature sensor produced by Dallas. It is simpler to control than ds1620 of the same series, and has higher resolution than ds1621. It can use one controller to control up to 8 sensors. It supports i2c bus protocol, has a wide temperature measurement range, stable readings, high resolution, no external circuits, and a simple interface with a single-chip microcomputer. It can be widely used in temperature detection, temperature control, temperature alarm and other fields.

Temperature measurement range: -55℃~+125℃, resolution 0.03125℃

The temperature value is output as a 13-bit digital value (two-byte transmission)

Temperature conversion time is less than 1 second,

Data is read and written via a 2-wire serial interface (sda, scl) with selectable bus address.

Internally integrated 256b e2prom, which can be used to save user-set parameters

Pin Description DS1624 is an 8-pin DIP package or SOIC package, and its pin functions are shown in the following table.

Working principle of ds1624

ds1624 uses a dedicated on-chip temperature measurement technology to measure temperature. Its temperature measurement principle is shown in Figure 1.

Application of digital I2C bus temperature sensor in temperature detection

Application of digital I2C bus temperature sensor in temperature detection

When the counting gate is turned on, the number of pulses of the low temperature coefficient oscillator is counted. The period of the counting pulse is determined by the high temperature coefficient oscillator. The preset value of the counter and temperature register is -55℃. If the counter reaches 0 before the end of the pulse, the temperature register increases, and the counter is preset to the value of the nonlinear accumulator and restarts counting. If the pulse period has not ended before the counter reaches 0, the above process is repeated, otherwise the counting stops. The value in the final temperature register is the measured temperature value.

The temperature value of ds1624 is expressed in units of 0.03125℃. The temperature register inside 1624 is a 13-bit (2-byte) register, which can be serially read through the IIC bus, with the high bit first. The content of the 13-bit register is the temperature value expressed in the complement code, with the highest position being the sign bit. The sign bit "1" indicates a negative temperature value, and "0" indicates a positive temperature value. Multiply the true value of the 13-bit data by 0.03125 to get the measured temperature value. For example:
the measured temperature is: +802*0.03125=25.0625℃

How ds1624 works

ds1624 can work in two modes, continuous conversion mode and one-shot conversion mode, and the working mode is controlled by configuring the register.

done is the conversion completion bit, which is 1 when the temperature conversion is completed and 0 when the conversion is in progress. 1shot is the one-shot mode bit. When this bit is 1, a temperature conversion is performed each time a start conversion command is received. When it is 0, continuous temperature conversion is performed. This bit is non-volatile.

When ds1624 is embedded in a system, MCU is required to issue control commands to it, such as reading and writing status registers, reading temperature registers, starting temperature conversion, etc. MCU controls ds1624 through the i2c bus interface, and writing and reading completely comply with the i2c bus protocol.

The command set of ds1624 includes the following 5 commands, which is more convenient and simpler than ds1621 of the same series.

(1) Start temperature conversion [eeh]

This command starts temperature conversion without reading data. In the re-conversion mode, this command starts the conversion. After the DS1624 completes the conversion, it remains idle. In the continuous conversion mode, this command starts the DS1624 for continuous temperature conversion.

(2) Temperature conversion end command [22h]

This command stops temperature conversion and does not require more data. In continuous operation mode, this command stops DS1624's temperature conversion and remains idle until DS1624 receives a new temperature conversion start command.

(3) Read temperature command [aah]

This command reads the result of the most recent temperature conversion, and then ds1624 sends out the temperature value represented by two-byte complement. The highest bit is the sign bit, and the lowest three bits are not used.

(4) Access configuration register [ach]

If r/w=0, after the command is written into the configuration register, the MCU sends a byte to determine the working mode of DS1624; if r/w=1, DS6124 sends the current status to notify the MCU whether the conversion is completed.

(5) Access memory [17h]

This command is used to access the 256B E2 memory integrated in ds1624. The next byte of data is the address of the memory being accessed, and the E2 memory can be read and written. The reading and writing are the same as other I2C protocol E2 memories. Readers can refer to other materials.

The flow chart of DS1624 starting temperature conversion, accessing configuration registers, and reading temperature values ​​is shown in Figure 2.

Application of digital I2C bus temperature sensor in temperature detection

Application of digital I2C bus temperature sensor in temperature detection

Application of digital I2C bus temperature sensor in temperature detection

Typical Applications

The typical application diagram of ds1624 is shown in Figure 3, where the LED display and temperature alarm circuit can be designed by the reader. ds1624 does not have a special temperature control function. The user can save the temperature control information, such as the upper and lower temperature limits, in the e2 memory. When working, the ds1624 can be set to continuous working mode. The mcu reads the temperature value continuously and sends it to the display device for display. It can also compare the temperature value with the temperature control parameters in the e2 memory to drive the alarm, heating or other actuators. It can also store parameters such as pid in the e2 memory and realize closed-loop control through advanced algorithms.

Precautions

When using ds1624, you should pay attention to several issues

1. It takes 10ms to write e2prom, so after each register write operation, you need to wait 10ms before the next write operation. 2. Since SDA and SCL are both open-drain I/Os, they must have pull-up resistors.

3. When transmitting data and writing command words, the protocol of the i2c bus must be followed. When switching from a write operation to a read operation, the data transmission should be restarted, and then the address and read/write bits should be sent.

4. When constructing a temperature measurement system, a single chip can be connected to up to 8 ds1624s, and the average method can be used to improve the measurement accuracy. At this time, the addresses a2, a1, and a0 should be adjusted differently.

Reference address:Application of digital I2C bus temperature sensor in temperature detection

Previous article:Drone altitude sensor with temperature compensation
Next article:Fault Diagnosis Method of Control System Sensor Based on RBF Neural Network

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号