Thermistor

The Thermistor is a resistor whose resistance varies significantly (more than in standard resistors) with temperature.

Output: This module’s output approches 5v as the temperature increases. As the temperature decreases, it approaches 0V. When connected to an input on the Arduino using the TinkerKit Shield, expect to read values between 0 and 1023

(NB: any changes in the values will be slow and may not vary a great deal).

Module Description: This module features a Thermistor, a signal amplifier, the standard TinkerKit 3pin connector, a green LED that signals that the module is correctly powered and a yellow LED whose brightness changes according to the temperature.

This module is a SENSOR. The connector is an OUTPUT which must be connected to one of the INPUT connectors on the TinkerKit Shield.

/*
Thermistor
 
 The TinkerKit Thermistor Module [T00020] is hooked up on I0.
 Three values are displayed on the Serial Monitor every second:
 - the Analog Input value, between 0 and 1023
 - the temperature expressed in Celsius degrees
 - the temperature expressed in Fahrenheit dedegrees
 
 created 29 Nov 2011
 by Federico Vanzati
 
 This example code is in the public domain.
 */

// include the TinkerKit library
#include <TinkerKit.h>

// creating the object ‘therm’ that belongs to the ‘TKThermistor’ class 
// and giving the value to the desired output pin
TKThermistor therm(I0);       

float C, F; // temperature readings are returned in float format

void setup()
{
  // initialize serial communications at 9600 bps
  Serial.begin(9600);
}

void loop()
{
  // Reading the temperature in Celsius degrees 
  // and store in the C variable
  C = therm.getCelsius();  
  // Reading the temperature in Fahrenheit degrees
  // and store in the F variable  
  F = therm.getFahrenheit();   

  // Print the collected data in a row on the Serial Monitor
  // Reading the analog value from the thermistor
  Serial.print("Analog reading: \t");   
  Serial.print(therm.get());
  Serial.print("\tC: \t");
  Serial.print(C);
  Serial.print("\tF: \t");
  Serial.println(F);

  // Wait one second before get another temperature reading
  delay(1000);                
}