12 June 2010

Task 54 - Datalogging to Serial Monitor: Fritzing, Serial Monitor, software


The Fritzing diagram is very simple, & similar to the photocell Task.


Note the comparatively even readings from the first set of 10.

In the second set (i just reset), the readings are higher - i held the thermistor between my fingers for a while before resetting - then i let it go, & as expected, the values sank slowly, but didn't reach the previous level after 10 samples.

/*
* Project: DataLogging_Thermistor_task_54
* Author: Jane-Maree Howard
* Date: Saturday 12/06/2010
* Platform: Arduino 18
* Purpose: To data-log 10 successive readings from a thermistor
at 1-second intervals & output results to the SM
* Operation: The average resistance of the thermistor is about 10kOhms,
so it & the 10k resistor form a voltage divider, whose
junction is inputted to Analog 0.
* Description:
* Connect one end of the thermistor to 5V, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground
this is quite similar to the photocell Task, but the software is
a little different.
*/
int thermistorPin = 0; // the thermistor and 10K pulldown are connected to a0
int thermistorReading; // the analog reading from the sensor divider
byte readCount = 0; // this counts the readings to allow halting..

void setup(void)
{
// We'll send debugging information via the Serial monitor
Serial.begin(9600); // baud rate 9600 should be set on the SM
Serial.println(); // skip a line to start with
}//end setup()

void loop(void)
{
// test for 10 readings
if (readCount == 10)
{
return; // stop after the 10th reading
}//if()
// read value on thermistor pin i.e. analog 0
thermistorReading = analogRead(thermistorPin);
// print the analog reading to the SM
Serial.print("Analog reading = ");
Serial.println(thermistorReading);
// delay 1 second
delay(1000);
// increment counter
readCount++;
}//end loop()


6 comments:

  1. I suppose that is i held onto the thermistor for long enough, it would eventually reach body temperature - 37.5 Celsius (or thereabouts).

    I might try that - then i'll have a reference point. NNN = 37.5 therefore etc.

    But i think i'd need to look up the data on the thermistor, & since i've no idea of its make/model, i don't really know what its scale is like..
    ..could look it up, just to see..

    ReplyDelete
  2. If i look up MindKits, maybe i can find some data..
    ..hmmm.. ok

    ReplyDelete
  3. I'm guessing (via MindKits & Vishay.com)

    2381 645 90028/NTCLE201E3C90028
    PDF datasheet
    NTC Thermistors,
    Long Non-Insulated Leads

    Now i just have to persuade this stupid thing to download
    (SIIIGHH!!!!)

    ReplyDelete
  4. ooops! It's NTCLE100E3103JB0

    different thing altogether!!

    ReplyDelete
  5. NTCLE100E3103JB0 is supposed to be colour-coded, but this one isn't!!

    It's just BLACK ALL OVER!
    But i measured it @ ~10k, so i guess i just have to find the right data-sheet.

    Got round that poxy message with a Firefox add-on i found from a list (unSIGH!! if there's such a thing..)

    ReplyDelete
  6. i dunno wot the temp is in here (i'm not @home, needless 2 say - it's far 2 warm 4 that!!), but i just measured the NTC thermistor & it's actually ~8k.
    i knew it was an NTC coz the Analog 0 input voltage rose with the temperature, i.e. the resistance vis-a-vis the 10k pull-down was falling, i.e. NTC!!
    Simple, huh!

    ReplyDelete