Pages: [1]   Go Down
Author Topic: Help with Arduino digital thermometer!?  (Read 3405 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I just ordered an Arduino (Arduino UNO SMD and it comes in Saturday) and I want to make a digital thermometer. I have never even touched one before or seem one in person. I have the 4-digit 7 segment LED, thermometer and a small red bread board with male to male jumper wires. So can anyone explain to me how to hook it up right and where or what is the code to run it on? I already know how to download the software and stuff (connecting it) but I don't know how to set it up right and what's the code to use.

Cheers,
Ethan

   
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1121
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ethan

This depends entirely on which temperature sensor you have bought.  Do you have the model?  If it's a TMP36 (say) googling "TMP36 Arduino tutorial" will more often than not find you a step-by-step guide.  If you don't find it that way, find a datasheet for the model you have and you might find it's a drop-in replacement for another component where you'll find a guide.

Alternatively, you'll find a lot of history with sensing temperature in the playground on this site, and in this forum.

Cheers ! Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

denver
Offline Offline
Newbie
*
Karma: 0
Posts: 35
...no matter where you go, there you are
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1EAS1:

Here's something I found that you might be interested in:

Code:
//TEMP in deg C ~ /10000
//The sensor isn't very accurate - the data sheet says ±10°C. But once you've worked out the offset and correct for it, accuracy improves
//This sensor is pretty useless unless you calibrate it against a known temperature.
//The sensor outputs in approximately 1°C steps.

long readTemp() {
  long result;
  // Read temperature sensor against 1.1V reference
  ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
  delay(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Convert
  while (bit_is_set(ADCSRA,ADSC));
  result = ADCL;
  result |= ADCH<<8;
  result = (result - 125) * 1075;
  return result;
}

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println( readTemp(), DEC );
  delay(1000);
}

I just ran the code last night and it gave me an avg temp (on the arduino board) of 26 C ~ 78.8 F.  I'm going to compare the arduino value to another digital thermometer (infared? I think) for accuracy as soon as I can find it.  You may not have much use for this because it measures the temp of the board, but you never know when it might be useful.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Ethan,

You should go through the Tutorial section of Arduino.cc to get an idea of how to program it and how the language looks like.
We can post code but I assume your goal is to understand your project.

[post sensor type]+1

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: