Pages: [1]   Go Down
Author Topic: Atmega328p internal temperature sensor  (Read 1177 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I came across a few sources that claim the atmega has a not-so-accurate temperature sensor.

http://www.netquote.it/nqmain/2011/04/arduino-nano-v3-internal-temperature-sensor/
http://arduino.cc/forum/index.php/topic,38043.0.html

I tried both of these approaches, but both give me 110-112 no matter if I go stand outside or put my finger on the package. Room temperature is around 18C while outside is more like 6C.

The only consistent difference I get is changing between the 3.3v serial cable and 3.6v battery pack. The latter gives readings of 97-99.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That sensor was meant to provide changes in temperature, not temperature itself.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be happy with that, but it doesn't change. It keeps at 97 if I attach the battery and walk from room temperature to a fair number of degrees colder outside temperature and stand there for a minute.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it doesn't change.

You probably want to provision for the possibility that it does change but your code cannot read the changes.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's called an internal temp sensor because it's measuring the temperature of the internal chip die not the temperature of the air outside the chip. If you want to see it increase, wire a few leds to output pins and turn them on and see the temp reading increase. It's usefulness and accuracy is very limited for practical applications. In fact in 3 years I've never seen it used in any useful published project other then to show that it is indeed there and functions to some degree. Some have proposed that is could be used to seed a random number generator but that doesn't sound like a good source for a decent seed to me.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With 2 leds and an E-paper display, constantly turned on and updating, I get 112-113. So it does respond a little to internal heat, but hardly at all to external temperature changes.

Okay, if this is how it is supposed to work, it is not useful at all. Unless you want to do some dynamic overclocking thing or something.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With 2 leds and an E-paper display, constantly turned on and updating, I get 112-113. So it does respond a little to internal heat, but hardly at all to external temperature changes.

Corrrect

Okay, if this is how it is supposed to work, it is not useful at all. Unless you want to do some dynamic overclocking thing or something.

Correct again.
Lefty


Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone. I am the beginner of Arduino, and I found it is the powerful tools for project. I am using Arduino Micro to do one project on equipment research and development. One of my task is to monitor the chip internal temperature. I knew there are internal temperaures in Atmaga328, Atmaga32U4, and I alsol learned that some wise man have developed the codes for Atmaga328, but I didn't find the codes for Atmaga32U4, and evenif I find difficulties in reading through the codes for Atmaga328.

I wonder to know can I copy the codes of Atmaga328 for the use of Atmaga32U4 directly? or could you please give me a hand? thanks very much. my email is shxplf@gmail.com. Thanks a lot.

I am looking forward to improving with you... smiley-cool
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a page for this: http://playground.arduino.cc/Main/InternalTemperatureSensor

But I have not found some values for the offset and gain for the Leonardo. So the temperature for the Leonardo is totally wrong. I hope someone will do some measurements to have at least some start values for the offset and gain.
Logged

Pages: [1]   Go Up
Jump to: