Teensy 3.1 use internal Temp Sensor

Status
Not open for further replies.

4styler

Member
Hello Again,

i hope someone can help me. I will use the internal Temp Sensor of the Teensy, but i didn't know what sensor is in it or how to use it correctly.
I will get an accurad reading of the Temperatur with +- 2 C°. Perhabs anyone have a Scatch for me or any further informations how to do it?

Greetings
4styler
 
Good suggestions, GremlinWrangler.

I'll just re-iterate that using Analogread(38) was very noisy in my experience. Ideally, use massive decimation/averaging to kill spikes.

Also, recently discovered the SIT1552, which will now be the TCXO of choice for my projects.
 
Hello :),

i'am sorry but i didn't get it. I read it many times but i didn't understand it. Is it possible to give me further help to understand that?

Greetings
4styler
 
An example that returns temperature-ish figures is:
Code:
int sensorValue = 0;  // variable to store the value coming from the sensor
float average = 0;

void setup() {
  analogReference(INTERNAL);
  analogReadResolution(12);
  Serial.begin(9600);
}

void loop() {
   for (byte counter =0;counter<255;counter++){    
  average = analogRead(38)+average;  
  }
  average= average/255;
  float C = 25.0 + 0.17083 * (2454.19 - average);
  Serial.print(average);
  Serial.print(' ');
  Serial.println(C);
  average =0;
  delay(255);
}

The values are taken from the linked page, but still sits higher than it should and go down while getting hotter so a problem there to be solved yet.
 
Last edited:
Status
Not open for further replies.
Back
Top