10
\$\begingroup\$

What is the intended purpose of a temperature sensor (TS) inside a microcontroller?

Of course, you could say it is to measure the inside temperature of the IC, but also depending on the ambient temperature the TS might be used for measuring this temperature, for example in colder environments when the whole device might be colder.

I am asking because so far I have not seen any descriptions in datasheets that mention whether the TS is solely for measuring the inside temperature or also the ambient/outside temperature.

\$\endgroup\$

4 Answers 4

14
\$\begingroup\$

There are a few things you can do:

  • Overtemperature protection. ​
  • Voltage reference and oscillator temperature correction.
  • Ambient temperature estimation, the kelvin per watt (k/w) temperature rise is reasonable stable over the entire range, so you can make a rough guess. If you don't jump into sleep modes that complicate the package power calculation.
    enter image description here
    (data from a temperature test of a product with an STM32 I tested)
\$\endgroup\$
2
  • \$\begingroup\$ Wow, hope you had the extended temperature range version! Even then you are pushing it close to the 105 degree max. \$\endgroup\$
    – Glen Yates
    Commented Jan 14, 2022 at 21:13
  • \$\begingroup\$ @GlenYates That was exactly the point of the test. \$\endgroup\$
    – Jeroen3
    Commented Jan 15, 2022 at 20:36
7
\$\begingroup\$

The main objective of that sensor is to measure the temperature of the microcontroller itself when it is enclosed in the case of any equipment. It is used to check whether or not the IC is too hot either because of internal high temperature of case or may be because of high-power dissipation through microcontroller.

Moreover, it is not a reliable source for measuring surrounding environment temperature and thus to measure external temperature, a separate temperature sensor must be used (away from heatsink or any other hot components)

\$\endgroup\$
6
  • 3
    \$\begingroup\$ I have wondered whether it might be okay for measuring ambient if the mcu spends its time in sleep and occasionally wakes up to measure temperature, so as to do a "one chip" solution. \$\endgroup\$
    – Ian Bland
    Commented Jan 3, 2022 at 7:18
  • 2
    \$\begingroup\$ @IanBland that can be determined experimentally \$\endgroup\$
    – jsotola
    Commented Jan 3, 2022 at 7:25
  • 2
    \$\begingroup\$ @IanBland It really depends upon the application and environment where the microcontroller is used. Even if the microcontroller sleeps for some time and then wakes up occasionally, it's going to give you an average of internal and ambient temperature. Moreover, If its only purpose is to measure the ambient temperature and then go back to sleep then I better recommend you to use a more precise temperature sensor instead of using a whole microcontroller and wasting its other capabilities. \$\endgroup\$
    – No Man
    Commented Jan 3, 2022 at 7:27
  • 2
    \$\begingroup\$ As long as the MCU has very low power consumption and isn't placed close to any other hot components/heatsinks, it should show pretty close to ambient temperature. If all you need is a rough indication of ambient temperature, it might be usable. But as said, it depends on the application. \$\endgroup\$
    – Klas-Kenny
    Commented Jan 3, 2022 at 7:31
  • \$\begingroup\$ Just add a heatsink on the microcontroller. The heat exchange with ambient air should be better ... and the measured Temp also. \$\endgroup\$
    – Antonio51
    Commented Jan 3, 2022 at 8:39
4
\$\begingroup\$

The real purpose of the temperature sensor is to prevent damage to the chip and to make sure software running on the chip run correctly. All other uses are side-effects.

All electronics components have a maximum temperature before they start to fail. A high enough temperature will even damage a component (this is actually common sense, everything has a maximum temperature rating - even you: there is a temperature where you will start cooking and your brain will stop working).

Before being damaged, electronics components may produce unexpected results. Transistors may randomly turn on or off, conductors become more resistive etc. When it comes to a CPU, this results in incorrect execution of instructions. In most cases you will experience this as a crash. Crashing is lucky because in the worst case this will silently execute something you don't expect and don't crash but will silently do something bad to your data like corrupt a file on disk or damage an external device.

The old-school solution to this is to make sure your CPU never get too hot by using huge heatsinks and limit how fast you run your CPU. The more complicated solution is to monitor your system's temperature and slow down your CPU (thereby reducing the heat it generates) when it gets too hot.

Note: Slowing down the GHz works because CMOS circuits consume practically zero amps when not switching, unlike regular circuits that consume amps when just turned on. So for CMOS circuits if it is zero Hertz it consumes no current and produce no heat at all. For CMOS it is the clocking of the transistors that generate heat. The more times it is switched on and off the more heat it generates - thus heat is proportional to GHz and the number of transistors in use.

It does not really matter if the heat comes from the CPU itself or the environment. Too hot is too hot. If you run a PC out in the sun it should still throttle when the internal temperature is out of spec.

\$\endgroup\$
2
\$\begingroup\$

A number of possibilities:

  1. Marketing. It was inexpensive and could sell more MCUs; add it!
  2. Technically possible, could be useful, inexpensive: why not?
  3. Allows determining whether the system is within the intended operating range.
  4. For higher-power devices, allows throttling the operating frequency.
  5. For low-power devices, allows measuring (close to) the ambient temperature. Errors will be added by any (unpredicted / unmodeled) temperature rise, and this is likely not a lab-grade temperature sensor to start with.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.