Application of single chip microcomputer in low power consumption temperature detection system

Publisher:LuckyDaisyLatest update time:2015-03-06 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

In measurement and instrumentation, temperature detection has almost become an indispensable part. Traditional analog temperature sensors are either complicated in peripheral circuits or require the design of A/D conversion and cumbersome operation, which are subject to certain restrictions in use. The digital temperature sensor AD7416 is used to design various control systems. It is small in size, low in power consumption, simple in programming and convenient in operation. The chip has automatic comparison and programmable control output terminal OTI, which has great advantages in the design of temperature control systems. In addition, AD7416 has low power consumption and can be programmed to control the switching between working and sleeping states. It is also widely used in low-power system design.

2 Structure and function of AD7416

2.1 Pin function

AD7416 has a total of 8 pins and adopts SOIC/MSOP package. Pin 1 is the data input and output port, IIC bus bidirectional data port; Pin 2 is the IIC bus clock port; Pin 3 OTI is the temperature comparison output terminal; Pin 4 GND ground terminal; Pin 5, 6, and 7 are IIC bus address programming bit input terminals; Pin 8 VDD is the power supply.


2.2 Internal Structure and Function

The internal structure of AD7416 is shown in Figure 2. The on-chip bandgap temperature sensor and 10-bit AD converter form a temperature measurement circuit, and the measurement result is stored in the temperature value register. There are 5 registers, a temperature comparator, and an error queue counter on the chip. The functions are introduced below. A serial bus interface is used for IIC address control and data transmission.


2.2.1 Internal registers

AD7416 has 5 internal registers: address pointer register, temperature value register (00H), upper limit register TOTI (03H), lower limit register THYST (02H), and configuration register (01H).

The address pointer register stores the address pointing to one of the four data registers. The first data byte of each serial write operation to AD7416 is the address of the data register, which is the address to which the subsequent data bytes are to be written. This value is stored in the address pointer register. Only the lowest two bits of this register are used to select a data register, and its value corresponds to the register address. The temperature value register is a 16-bit read-only register. Its upper 10 bits store the 10-bit temperature reading sent by the AD converter in 2's complement format, and the lower six bits are unused. The

configuration register is an 8-bit read/write register, which is used to set the working mode of AD7416. D7, D6, and D5 are used for channel selection and are all kept at 0; D4 and D3 set the error queue length; D2 sets the OTI output polarity; D1 sets the OTI working mode; DO sets the chip working mode. The THYST set point register and the TOTI set point register are both 16-bit read/write registers. Their 9 most significant bits store the low and high temperature threshold set points expressed in 2's complement format, corresponding to the upper 9 bits of the temperature value register, and the lower 7 bits are unused.

When the AD7416 is powered on, the address pointer points to the temperature value register, TOT1=80℃, THYST=75℃.

2.2.2 Basic working principle

The bandgap temperature sensor and the 10-bit A/D converter can measure the ambient temperature in real time according to the preset working mode. At the same time, the conversion result is saved in the temperature value register in the form of a 10-bit binary number. The

set point comparator compares the actual measured temperature value with the preset high and low threshold values. If the limit is exceeded, the high and low levels are output at the OTI end according to the configuration register setting. OTI needs to be connected to an external pull-up resistor of about 10 k when in use.

There is a fault queue counter in the AD7416 to avoid false triggering of the OTI output end caused by interference. The queue length of this counter is set by the configuration register. If the queue is set to 4, then it takes 4 consecutive temperature over-limit measurements to cause the effective output of OTI. Any less than 4 times is considered interference and the fault queue counter will be reset.

3 System Design

3.1 Hardware Design

The hardware schematic diagram of the AD7416 part of the system is shown in Figure 3. A2, A1, and A0 are connected to low, low, and high levels respectively. In the eight-bit address, the upper four bits are 1001 to select 7416, and the lower three bits are the addresses represented by A2, A1, and A0. The lowest bit represents read and write, so the write address of AD7416 in the application is 10010010B and the read address is 10010011B. In this example, only AD7416 is used to measure temperature, and OTI is left floating and not used. The serial clock and data bus correspond to the clock and data bus ports connected to the processor. [page]


3.2 Software Design

01H of AD7416 is the configuration register. If the lowest bit is 0, the chip is started to collect temperature values ​​and perform AD conversion; if it is 1, the chip is stopped. The software starts the chip first, and the program is as follows:


This program writes 00H to the configuration register of AD7416 to complete the temperature measurement startup of the chip. The I2C_START subroutine starts the IIC bus, the I2C_WwRITE subroutine writes a byte to the IIC bus, and the I2C_STOP subroutine shuts down the IIC bus. The program first writes 92H to the IIC bus, selects the AD7416 chip, then writes 01H to the address pointer register of the AD7416, selects the configuration register, and finally writes 00H to the configuration register.

When reading a double-byte temperature value, first write the destination register address 00H to the AD7416, that is, the address of the register to read the data, which is stored in the address pointer register. Then send a read command. After receiving the first byte, the processor sends a response signal to the bus, and sends a non-response signal after receiving the second byte. After completion, the bus operation is stopped. Part of the program to read the temperature value from the AD7416 is as follows, TEMPH stores the high byte, and TEMPL stores the low byte:


4 Conclusion

The temperature measurement function of AD7416 is used in the system design. From the use process, the chip has a simple structure, easy operation, and low power consumption. It is the best choice for low-power temperature measurement systems. And because of the use of on-chip temperature sensors, the design structure is greatly simplified, and the reliability of the system is also greatly improved.
Reference address:Application of single chip microcomputer in low power consumption temperature detection system

Previous article:Design of online laser power detection system based on single chip microcomputer
Next article:Design of automatic range switching voltage measurement system based on single chip microcomputer

Latest Microcontroller 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号