MENU

# Mixed signal verification of temperature sensor

Technology News |
By eeNews Europe

A temperature sensor can be implemented using an analog electronic circuit which can sense and indicate the ambient temperature. These sensors use a solid-state technique to determine the temperature. That is to say, they don’t use mercury (like old thermometers), bimetallic strips (like in some home thermometers or stoves), nor do they use thermistors (temperature sensitive resistors). Instead, they use the fact that, as temperature increases, the voltage across a diode (p-n junction) increases at a known rate.

This concept can be realistically implemented in a BJT where a diode (p-n junction) is present across the base and emitter terminals and the voltage drop between these two terminals – that is VBE – of a transistor changes in accordance with the ambient temperature. By precisely amplifying this voltage change, it is easy to generate an analog signal that is directly proportional to the temperature. Now let us look at some of the basic BJT based formulas. We know that for a BJT:

VBE = VG0(1 – T/T0 ) + VBE0(T/T0) + nKT/q ln(T0/T) + kT/q ln(Ic/IC0)

Where,

T = temperature in Kelvin

T0 = reference temperature

VG0 = bandgap voltage at absolute zero

VBE0 = bandgap voltage at temperature T0 and current IC0

K = Boltzmann’s constant

q = charge on an electron

n = a device-dependent constant

By comparing the bandgap voltages at two different currents, IC1 and IC2, many of the variables in the above equation can be eliminated, resulting in the relationship:

VBE1 – VBE2 = kT/q ln(IC1/IC2)

If we can maintain a constant ratio of N:1 in IC1 and IC2, then by measuring the VBE1 – VBE2 one can measure the temperature and this is how a generic temperature sensor works. There are 2 basic ways of tracking this change. If the voltage increases as temperature increases it is called Proportional To Absolute Temperature implementation or PTAT. If the voltage decreases with increase in temperature, it is called Complimentary To Absolute Temperature or CTAT. So a temperature sensor circuit can be PTAT based or CTAT based.

From a microcontroller perspective, the knowledge of temperature is very crucial. Based on temperature the parameters that are affected are:

• Performance of the chip: P-N junctions and devices inside the chip change their state very rapidly as temperature changes and hence the performance of the chip is impacted. At high temperature there are chances that the frequency of operation of the chip increases automatically.
• Leakage of the Chip: Leakage increases at high temperature and hence the chip might start burning more and more current as temperature is increased.
• Other thermal issues might also arise, like Channel Hot Carrier Effect and all that affect the performance of the chip.

If the microcontroller is aware of the temperature of the surroundings it can make multiple intelligent decisions to fix these issues. For example, it can trim its clocks in such a way that frequency is always in a desired range. It can enable a well biasing protocol to reduce leakage. It can shutdown certain peripherals that are sensitive to temperature, e.g. a micro controlling a motor might shutdown the motor if the temperature goes too high as it may damage the insulation in the windings, etc. So we understand that from an SoC perspective temperature sensors are crucial blocks and they must be verified thoroughly.

The methodology described in this paper can identify design contentions which can potentially change the output of the temperature sensor (e.g. Charge sharing at the output due to potential pull-ups or pull-downs). In fact, any variation in the temperature sensor output due to design inefficiency can be identified.

This paper contains a Mixed Signal Verification Method for temperature sensors. It basically talks about verifying this block in RTL+SPICE or RTL+VAMS based abstraction of the SoC, where the analog part of the design has an electrical based modeling (VAMS/SPICE) and rest of the design has a behavioral model (RTL). For IPs like a temperature sensor that is integrated in an SoC, a faithful verification can be done with an electrical modeling of these blocks. The accuracy of the data that comes out of such IPs is very critical for the customer.

After being integrated in the SoC, the variations in supply of this block and its integration with other IPs like the ADC, need to be thoroughly reviewed. The accuracy of this verification improves many times if done in a Mixed Signal Environment. As a generic methodology we propose a simple linear formula that can be applied on any subsystem having a temperature sensor (TSense) block. This formula gives a value for every temperature which can be compared against an Analog TSense output.  As discussed earlier, this methodology becomes very powerful if mixed signal simulations are being done.

Methodology

Initially the Analog TSense block has to be simulated in a standalone testbench across all the temperatures. The voltage output of the temperature sensor (Vout) is tabulated for all the temperatures in the interested range of operation. As expected from the standalone IP, this output voltage would vary linearly with temperature. We therefore draw this linear variation behavior. For all these voltages to lie down exactly on the best-fit line, we may need to make minor adjustments in the voltage output. We took a pilot IP of a temperature sensor that had to work in the range of -40C to 150C. We followed all the steps , made the necessary changes and came up with the following table:

 Temperature Vout Curve fitted Vout Error (in Percentage) -40 1.21E+00 1.2047 9.12E-02 -30 1.26E+00 1.2567 7.96E-03 -20 1.31E+00 1.3087 1.53E-02 -10 1.36E+00 1.3607 1.47E-02 0 1.41E+00 1.4127 2.12E-02 10 1.47E+00 1.4647 3.41E-02 20 1.52E+00 1.5167 -1.32E-02 30 1.57E+00 1.5687 -5.10E-02 40 1.62E+00 1.6207 -6.17E-02 50 1.67E+00 1.6727 -5.98E-02 60 1.72E+00 1.7247 -6.96E-02 70 1.77E+00 1.7767 -1.07E-01 80 1.83E+00 1.8287 -1.20E-01 90 1.88E+00 1.8807 -1.28E-01 100 1.93E+00 1.9327 -1.24E-01 110 1.98E+00 1.9847 -1.06E-01 120 2.03E+00 2.0367 -1.52E-01 130 2.09E+00 2.0887 -1.39E-01 140 2.14E+00 2.1407 -1.54E-01 150 2.19E+00 2.1927 -1.83E-01

Table 1: TSense output across temperature

We then derive the equation of that best fit line. A formula from the above table can be obtained using curve fitting approach which is shown in Figure 1. For this data, the formula is y = 0.0052x + 1.4127

The same formula can be represented in the form of a graph as shown below.

Figure 1: TSense output graph. X-Axis is temperature (in degrees C)

We will now have a look at the methodology to verify the temperature sensor across temperature at the SoC level

• Now from an SoC perspective we have the temperature sensor output being converted by an ADC.
• We therefore make a simulation environment that changes the temperature with respect to time.
• tran stop=200u param=temp param_vec=[0u  -40  160u 0 165u 40 170u 80 175u 120 180u 150]
• This statement shows what has been discussed. The temperature of the simulation changes from -40C to 150C as time changes from 0 to 180us.
• As the simulation runs, the output of temperature sensor is converted into digital data by the ADC. Then the result of the ADC is fed into a VAMS-based monitor.
• This monitor then back calculates the analog voltage that the ADC converted, let us call it ADC_ANA_OUT.
• It also reads the temperature of the simulation and based on the linear curve formula calculates the ideal output of the temperature sensor that it would have generated if it were running in a standalone IP simulation let us call it TSENS_IDEAL_OUT
• Then the VAMS monitor compares the ADC_ANA_OUT and TSENS_IDEAL_OUT and, if they match closely for all the various temperatures, it passes the test case.

We now show the snapshot of the simulation and some basic information printed in the Logfile.

The proposed methodology is a completely automated way of performing temperature sense verification. It is capable of identifying multiple issues such as:

• Loading issues: High loading on the temperature sense output leads to voltage differences.
• Contention issues: If any other signal is  mistakenly connected on the same wire as the Tsense Output.
• Incorrect configuration: The control signals, if not correct, can give an incorrect output which will not match with the formula.
• Complete temperature range coverage: By measuring the dynamic range of the ADC output, one can check to see if the complete temperature range is being covered by the ADC.
• System functionalities like “Over-temperature hardware protection through Software” can also be checked.

In all the above cases the difference in the Tsense output and formula would end up in an erroneous output and thus can be used to error out the simulation.

Reference

https://www.instructables.com/id/Temperature-Sensor-Tutorial/

About the authors

Kushal Kamal

Kushal Kamal holds a B.Tech degree from Manipal Institute of Technology, Manipal in Electrical and Electronics Engineering. Kamal has roughly 3.5 years of Industry experience. Kamal has been doing SoC Level SPICE based Analog and Mixed Signal Simulations for complex, low power mixed signal SoCs. By virtue of verifying these SoCs i have gathered a basic understanding of SoC Integration, Testebench and Verification Environment. Kamal also understands the basics of IPs like PMC, ADC, Crystal Oscilltors, RC Oscillator, PLLs, LCD Controller etc. The SoCs that i have been a part of are mainly from 2 segments: Automotive and Industrial Market. Kamal also has expertise in running low power use cases in a Full Chip SPICE environment. Kamal has been granted a patent from USPTO on ADC Design and filed patents on PMC Design and LCD Verification methodology. Kamal has also co-authored and presented two different papers on Mixed Mode Simulation Methodology and related automation that have been awarded best paper award in CDN Live, India 2011 and SNUG India 2012 respectively. Kamal holds multiple national and international publications.

Siddi Jai Prakash

Siddi Jai Prakash is an Analog – Mixed Signal Architecture Engineer at Freescale Semiconductor for past two years. Prakash has been involved in architecture and verification of Metering and automotive SoCs for Radar and Powertrain Applications.

If you enjoyed this article, you will like the following ones: don't miss them by subscribing to :

Share:

Linked Articles
10s