View Single Post
Old 10-28-10, 07:01 PM   #1
Daox
Administrator
 
Daox's Avatar
 
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
Default Quick & simple Arduino temperature logger

The other night I threw together a simple temperature data logger with my arduino. I was programming to make the differential controller for the attic fan heat dodad and figured it would be good to log some temperatures while I'm at it.

As the title says, its very simple to make. All you need is:
Arduino
LM35DZ-ND
some wire

The total cost for parts would be less than $40 and you could make a 6 channel logger out of it with a few more sensors and some additional code.


The code is also very simple:

Code:
/* quick temp data logger
*/

// Variable declaration
int temperature = 0;  // variable to keep the actual value 

// Analog pin declaration
int TsensorPin = 1;  // temperature sensor pin

void setup() 
{ 
  Serial.begin(9600);
  pinMode(TsensorPin, INPUT);
} 
void loop() 
{ 
  temperature = analogRead(TsensorPin) * .512;
  Serial.print(temperature);
  Serial.println(",");
  delay(300000);
}

Every 5 minutes the logger just spews the temperatures back to the arduino software on a computer, so you do need a laptop or desktop to connect to. Once you are done logging, you copy the text into notepad and save it as a .csv file which you can then import into excel and make a chart or what have you out of it.

Here is what I ended up with.




Now, there is a slight problem. The temperature does seem to be a bit off. However, I'm working on it.

Attached Images
 
__________________
Current project -
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
&
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
Daox is offline   Reply With Quote
The Following 2 Users Say Thank You to Daox For This Useful Post:
ervanerry (05-15-12), skyl4rk (10-30-10)