Design of Temperature Measurement Circuit Based on EWB

Publisher:码字徜徉Latest update time:2011-12-05 Source: 互联网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This paper applies EWB software to actual projects and designs a temperature measurement circuit. The designed temperature measurement circuit does not use a dedicated temperature sensor and a high-precision A/D converter, but uses the temperature characteristics of the transistor and the RC integral characteristics. Through the temperature scanning analysis and transient analysis of EWB, the corresponding relationship between the transistor temperature and the RC charging time is obtained, and the temperature measurement is converted into time measurement, thereby obtaining temperature data. Therefore, this circuit has the characteristics of low cost, high precision, simplicity and reliability, and is suitable for occasions where the measurement speed is not high. At the same time, a single-chip microcomputer is used to complete the tasks of temperature data collection, processing, and display, and the measurement program code is given.
Keywords: temperature measurement; electronic workbench; single-chip microcomputer

0 Introduction
EWB (Electronic Workbench) is an analog digital circuit simulation software with the advantages of intuitive interface, easy operation, and multiple analysis methods. It is very suitable for electronic engineers and students. EWB software has a green version, which does not need to be installed. It can be used after decompression. Click wewb32.exe to run the software. In the main interface, various operating functions used are displayed in a graphical manner, including: component library, instrumentation, analysis methods, etc. For the specific content of EWB, please refer to the book "Computer Simulation of Practical Communication and Electronic Circuits". The application of analysis methods often brings great convenience to experiments, even more convenient than real experiments. This article will use EWB's transient analysis and temperature scanning analysis to design a cheap and practical temperature measurement circuit.

1 Circuit principle and design
The temperature measurement circuit described in this article is for the measurement of water temperature (can be used in similar occasions), and the measurement range is 0~100℃. The usual method of temperature measurement is to use a temperature sensor to send the temperature signal to the single-chip microcomputer through an A/D converter to obtain temperature data. If the measurement display is required to have high accuracy (reaching more than 10 digits), the cost will increase greatly. Figure 1 is the schematic diagram of the temperature measurement circuit in this article. The circuit does not use a dedicated temperature sensor, nor does it use the A/Di conversion method. Instead, it uses a transistor Q1 as a temperature measurement element, and uses the temperature voltage characteristics of its pn junction to measure the temperature change. The temperature voltage signal and the R2, C1 integral signal are sent to the comparator input. After R2, C1 start charging, until their voltage exceeds the temperature voltage, the comparator flips. The charging time before flipping is measured by the microcontroller, and the temperature voltage value can be measured. The following describes the measurement principle in detail through the simulation of RC integral and temperature measurement.

Figure 2 is a transistor pn junction temperature measurement circuit. According to the transistor manual parameters, the voltage across the pn junction changes with temperature. This example measures water temperature, and the temperature range is 0-100°C. In practical applications, it is necessary to know the corresponding voltage change range and the voltage values ​​at the start and end points. Using EMB for temperature scanning analysis has the advantages of being intuitive and fast. Draw the circuit of Figure 2 in EMB, select the analysis option in the main menu, select the temperature sweep function, and set the starting and ending temperature ranges in the dialog box that opens. Set the start temperature to 0, the end temperature to 100, the sweep type to linear, the output node to be simulated, and the other options to default. Then click simulate to get the simulation result as shown in Figure 3. Click cursors to accurately measure the x and y (temperature, voltage) values ​​of the coordinates of each point on the curve. The measured results are that for the x value range of 0 to 100°C, the y value is 0.642 to 0.442V, the voltage change range is 200mV, and the change law is linear.


Figure 4 is an R, C integration circuit. At the initial moment of power on, the voltage across the capacitor is 0V. Later, as the capacitor is charged, the voltage across the capacitor will increase. The voltage change rule is:

From formula (1), it can be seen that Uc is not linear, but if the values ​​of R and C are large, Uc is close to linear. This process can be determined by mathematical methods to find the curvature of Uc to determine the linearity and finally determine the size of R and C. However, the process is cumbersome and not intuitive. If EWB simulation is used, it is convenient, fast and intuitive. For the circuit in Figure 4, select transient simulation under analysis in the main menu, modify the start time to 0 and the end time to 0.02s in the dialog box that opens, add the measured nodes to the nodes for analysis dialog box, and then click simulate to obtain the results in Figure 5. The x and y data measured by the cursor are: when the voltage change range is 0.442~0.642V, the corresponding time range is 4ms.

It can be seen from the temperature simulation graph and the R and C simulation graph that both are linear. Combining the temperature simulation with the R and C simulation, the relationship between temperature and R and C charging time is determined. When the temperature changes from 0 to 100°C, the corresponding R and C charging time changes from 8 to 12ms. Let the temperature variable be tem and the time variable be t, then

the unit of t is ms.
In order to display the measured value more accurately, the fixed-point operation method is used to add 2 decimal places, then formula (2) is modified to

t in units of μs and
tem is the temperature value with 2 decimal places.
If the time change process is measured by a single-chip microcomputer, the corresponding temperature value can be calculated.


Figure 6 is a complete temperature measurement circuit. The single-chip microcomputer uses 89c2051, and the 4-digit digital tube displays the temperature value with a display accuracy of 2 decimal places. 89c2051 has a comparator. The input ports of the comparator are P1.0 and P1.1, and the output port is P3.6. The temperature measurement value of the transistor is connected to the P1.1 port. The R and C charging circuits are connected to P1.0. P1.0 is both the input port of the comparator and the output port of the microcontroller. It has the properties of the microcontroller port, that is, when P1.0 outputs a high level, it is equivalent to the internal collector open circuit state. Here, this function is used to control the charging and discharging of the capacitor. When the temperature is not measured, P1.0 outputs a low level, and the voltage across the capacitor is 0V. When measuring the temperature, first start the T0 counter, then set P1.0 to a high level, and R2 charges C1. At this time, the state of P3.6 is continuously judged until the voltage of P1.0 is greater than the voltage of P1.1, and the comparator output P3.6 flips, and the count value is taken out (if the microcontroller uses a 12MHz crystal, each number is exactly 1 μs), thereby obtaining the time value. According to formula (3), the temperature value can be obtained. The program code is as follows:


2 Conclusion
In summary, the role of EWB in the temperature measurement circuit is mainly reflected in the simulation of the unit circuit, including temperature scanning analysis and RC transient analysis. If these tasks are completed by real tests, they are very troublesome and require many harsh conditions. Under amateur conditions or general conditions, it is almost impossible to complete them. However, the use of EWB software successfully achieves the goal.

Reference address:Design of Temperature Measurement Circuit Based on EWB

Previous article:Intelligent power management solutions help portable consumer applications
Next article:LED Dimming Technology Guide

Latest Power Management 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号