tinkerkit thermistor module overview 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 temp erature increases. as the temperature decreases, it approaches 0v. when connected to an input on th e 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 modu le 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 .
code example /* analog input, analog output, serial output reads an analog input pin, and T000200 themistor analog sensor connected to i0, maps the result to a range from 0 to 255 and uses the result to set the pulsewidth modulation (pwm) on a t010111 led module connected on o0. also prints the results to the serial monitor. created 29 dec. 2008 modified 4 sep 2010 by tom igoe modified 7 dec 2010 by davide gomba this example code is in the public domain. */ #define o0 11 #define o1 10 #define o2 9 #define o3 6 #define o4 5 #define o5 3 #define i0 a0 #define i1 a1 #define i2 a2 #define i3 a3 #define i4 a4 #define i5 a5 // these constants won't change. they're used to give names // to the pins used: const int analoginpin = i0; // analog input pin that the themistor is attached to const int analogoutpin= o0; // analog output pin that the led is attached to int sensorvalue = 0; // value read from the pot int outputvalue = 0; // value output to the pwm (analog out) void setup () { // initialize serial communications at 9600 bps: serial . begin (9600); } void loop () {
// read the analog in value: sensorvalue = analogread (analoginpin); // map it to the range of the analog out: outputvalue = map (sensorvalue, 0, 1023, 0, 255); // change the analog out value: analogwrite (analogoutpin, outputvalue); // print the results to the serial monitor: serial . print ( "sensor = " ); serial . print (sensorvalue); serial . print ( " \t output = " ); serial . println (outputvalue); // wait 10 milliseconds before the next loop // for the analog-to-digital converter to settle // after the last reading: delay (10); }
mouser electronics authorized distributor click to view pricing, inventory, delivery & lifecycle information: arduino: ? T000200
|