Digital Thermometer Based on DS1620 and AT89C2051

Publisher:姑苏清风泉源客Latest update time:2012-11-23 Source: 单片机与嵌入式系统 Keywords:DS1620  AT89C2051 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction to DS1620 chip

DS1620 is an 8-pin integrated circuit with built-in temperature measurement and conversion to digital values. It integrates temperature sensing, temperature data conversion and transmission, temperature control and other functions. Temperature measurement range: -55~+125℃, accuracy is 0.5℃. This chip is very easy to connect with a single-chip microcomputer to achieve temperature measurement and control applications. When used as a temperature controller alone, no other auxiliary components are required.

The pin function and arrangement are shown in Figure 1.

Among them: RST, CLK/CONV and DQ are three-wire serial communication lines; DQ is the data input and output terminal. When RST is kept at a high level, corresponding to the rising edge of the CLK/CONV clock pulse, DQ can input various control instructions and data bit by bit, and start to output the 9 B temperature value bit by bit at the falling edge of the CLK/CONV clock pulse, divided into 2 bytes, the least significant bit (LSB) is output first, the first byte (8 B) output divided by 2 is the Celsius temperature value, and the last byte (only 1 B) output is the sign bit of the temperature, which is 0 for positive and 1 for negative. When RST is low, the communication ends, CLK/CONV remains low, and DQ is in a high impedance state, but the temperature is measured and digitally converted (i.e., the temperature value is updated) inside the chip, which takes about 1 s.

Pin THIGH is the high temperature critical trigger output terminal. When the measured temperature is higher than the temperature TH set in the high temperature critical register, the pin changes from low level to high level, and returns to low level when the temperature is lower than TH; TLOW is the low temperature critical trigger output terminal, and its level change is similar to THIGH; TCOM is the high/low temperature critical combination trigger output terminal; they can all be used as the output terminal of the temperature regulator to directly control the heating or cooling equipment.

There is a working mode register inside the DS1620, as shown in Table 1.



Among them: DONE is the temperature data conversion bit, which is 0 for positive, and 1 for completed conversion during the conversion process; THF: high temperature flag bit, when the temperature is higher than or equal to the set value TH in the high temperature critical register, the hardware sets this bit, but the hardware cannot clear this bit; TLF: low temperature flag bit, when the temperature is lower than or equal to the set value TL, the hardware sets this bit, and similarly, the hardware cannot clear this bit; CPU: CPU use bit, when the software clears this bit, if RST is low, the temperature data conversion can be controlled by CLK/CONV, and the software converts this specific temperature bit, if the software sets this bit to 1, the DS1620 performs the temperature conversion at this moment and waits for reading, if the bit is set to 0, the DS1620 will continue to convert the temperature.

The working state of the DS1620 is controlled by external input instructions, and the specific instructions are as follows:

AAH reads the converted temperature data; starting from the 9th clock (also known as shift) pulse after the instruction is input, the data in the temperature register will be output.
01H writes TH data to the high temperature critical register.
02H Write TL data to the low temperature critical register.
A1H Read TH data in the high temperature critical register.
A2H Read TL data in the low temperature critical register.
EEH Start converting temperature data.
22H Stop converting temperature data.
0CH Write the working mode register.
ACH Write the working mode register.

2 Circuit design

As shown in Figure 2, the microcontroller P3.3~P3.5 is connected to the DS1620 in a three-wire communication mode. The P1 port outputs seven-segment codes. P3.0~P3.2 is connected to the COM end of the common anode digital tube through the driving transistor. The three buttons provide function expansion with the cooperation of P3.7.

3 Programming

The flowchart of the program is shown in Figure 3. Each program module is a subroutine and a call to a nested subroutine. The read and write DS1620 module module is a subroutine that completes the reading and writing of 1-byte temperature values ​​or instructions; the key service module mainly completes the rewriting of TH and TL values ​​in the high/low temperature critical register. [page]

The following is the assembly language program of 5 subroutines such as write/read DS1620, configure DS1620, start conversion, and read temperature. The remaining modules and programs will not be repeated.


4 Conclusion

The designed digital thermometer has high measurement accuracy, reliable operation, small size, low cost, and can be expanded into a temperature regulator. The disadvantage is that due to the hysteresis of DS1620 temperature measurement, it is not suitable for real-time temperature measurement.

References


[1] http://pdfserv.maxim-ic.com/arpdf/DS1620.pdf.
[2] He Limin.Selected Microcontroller Application Technology (8)[M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2000.
[3] Xue Dongliang. Principle and Application of MCS-51/151/251 Microcontroller (2)[M]. Beijing: China Water Resources and Hydropower Press, 2001 .
Keywords:DS1620  AT89C2051 Reference address:Digital Thermometer Based on DS1620 and AT89C2051

Previous article:Design of vehicle-mounted compaction tester based on AT89S52
Next article:Temperature and humidity automatic detection system composed of AT89C51/55

Recommended ReadingLatest update time:2024-11-17 00:35

Hardware Design of Temperature and Humidity Acquisition System Based on Single Chip Microcomputer
By using the powerful functions of AT89C2051 single-chip computer and combining the characteristics of fast and easy-to-use temperature and humidity measurement of smart sensor SHT75, a temperature and humidity acquisition system is designed to monitor temperature and humidity in real time. Through the temperatur
[Microcontroller]
Hardware Design of Temperature and Humidity Acquisition System Based on Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号