Cheap Temperature Logging
June 29, 2007 5:55 AM   RSS feed for this thread Subscribe

How can I do cheap temperature logging? Is Arduino a good choice?

I want to log temperatures unattended. It's in my yard on a periodic basis, so it doesn't need to be waterproof or anything, but I don't have a laptop (and the location isn't close to a window in the computer room) so I can't log right to the computer.

Temperature loggers seem to be pretty expensive and are single-purpose. Then I thought of the Arduino. For just $35 I can get a general purpose, reusable microcontroller, stick a thermistor on there and I'm done.

Except the idea of the Arduino is that it just passes the data back to the computer, it doesn't store it there. But there seems to be some storage space (in the "EEPROM") for about 512 bytes that I guess stays there even when it turns off. I wouldn't expect the temperatures to get above 255C (or the thermistor to read them if it does), so I think I can just stash one reading per byte once every N minutes for 512*N minutes of logging.

I'm more or less a n00b at electronics, but I do have some basic experience, tools and parts. The Arduino tutorials don't address this exact application, but there are several similar ones so I don't think it would be too technically hard.

Is there a cheaper solution out there? (I'm giving the general purposeness and reusability of the Arduino about a 15-20% bonus, so a specialized device would probably have to cost less than $28 or so to be worth switching to, assuming they both work about equally well.)
posted by DU to technology (11 comments total) 11 users marked this as a favorite
I believe you can attach external storage to the arduino too using i2c or some other protocol. This page in the Arduino playground may give you some ideas.
posted by lowlife at 7:09 AM on June 29, 2007


The Arduino does have onboard storage, but it's for the program you upload to the board to run the sensor configuration. I haven't seen anything that lets you store output on the board.

You'd also need an external power source if you're not tethering the Arduino to your computer via the USB cable. That adds the cost of batteries and the wiring attachments. Long term that would add up.

The Bluetooth Arduino can communicate with your computer over a distance of about 100 feet I think, but it's quite a bit more expensive.

. . .

Here's a cheap temperature logging solution if you already have a camera. Set it on time-lapse mode and buy a large dial thermometer and an analog clock to photograph together on an hourly/daily basis. Probably less than $28.00.

Also, RSS feeds from services like Yahoo or the Weather Channel are free and have decent granularity. You could plug in your zipcode and log the temperature they report.
posted by Jeff Howard at 7:11 AM on June 29, 2007


I got the 512 bytes from this thread. But maybe the EEPROM is where the program is stored?

External power shouldn't be a problem, should it? Just plug a 9v battery into a battery clip and plug it in. Or not?

The RSS feed won't work, since I'm not measuring outdoor temperature.

The camera solution is brill--I already built a Mindstorms Lego-based time-lapse camera, so I could probably do this without any trouble whatsoever. (I actually considered a direct Lego solution to temperature problem, but the temp sensor costs as much as the Arduino.)
posted by DU at 7:21 AM on June 29, 2007


I've used a relatively cheap Protek 608 multimeter with thermocouple attachment. I forget how much internal storage it had (it wasn't a lot) but maybe newer models have more.
posted by exogenous at 7:28 AM on June 29, 2007


Definitely ask on the Arduino forums, I'd bet you get a reply in less than a day. And, yeah, battery power is very simple with the Arduino, you just need to check that it doesn't run out.

@Jeff Howard: You would still need to write an image processing application to get useful data.
posted by tmcw at 8:24 AM on June 29, 2007


I have to write the numbers down on paper anyway, so whether they start on a computer or in an image doesn't matter. But in the general case (which could apply later), good point about the image processing.
posted by DU at 8:30 AM on June 29, 2007


I've been trying to do this lately: interfacing GPS data and temperature data with Arduino, and storing it on a memory card. Arduino uses AVR processors, and I believe SD/MMC memory cards are the easiest kind of card to store on, as they can be interfaced by SPI.

There are libraries and examples out there, although I haven't gotten around to getting it work yet. Here are some links that I've been using myself:
How to use MMC/SD
AVRLIB -- library for AVR microprocessors
AVR - mmc/sd schematics and code (german)
SD/MMC read-write protocol
Code for the ATmega16, should be ported to Arduino's ATmega168
FAT32 library for AVR
posted by suedehead at 8:45 AM on June 29, 2007


The Arduino board uses an Atmel ATmega16 microcontroller. The microcontroller has 16KB of self-programmable Flash to hold your program. Separately it has up to 512 bytes of EEPROM that you can use to capture your data. In addition it has up to 1K of SRAM that you use for the program stack but can also be used for storing captured data as long is you keep power applied. If you need more memory, you can easily connect a $2 Atmel SPI serial EEPROM chip to give you another 256KB or more.

The on-chip analog to digital converter is 10 bits, which generally would require two bytes of storage per sample, but you may find that you can just throw away the two least significant bits if you don't need the accuracy.

To increase battery life you will want to keep the microcontroller in power down mode and use the on-chip timer to wake up periodically only when you need to take a sample. You can also reduce power consumption by lowering the clock frequency, but there is a trade off in some cases in which it is better to run at a fast clock rate so that you can take your sample more quickly and return to power down mode. With clever programming, it might be possible to run for a year or more on one battery.
posted by JackFlash at 8:46 AM on June 29, 2007 [2 favorites]


Awesome. I just need 8 hours or so at a time, so a year should be plenty.
posted by DU at 8:53 AM on June 29, 2007


Perhaps you want an Atmel Butterfly. It's a business-card size board with, if I remember correctly, a thermistor plus meory, a lcd display, a speaker, ...

It has pads for external connectors, and it supportssome standard serial protocol, but you'd have to solder a connector on.
posted by zippy at 12:07 PM on June 29, 2007


Followup: I have the Arduino and it is awesome. Even if the temperature thing doesn't work out, it's well worth the $35 to play with.

However, the temperature thing does seem to be working out. I salvaged a thermistor from a broken electronic thermometer. Then I read up on thermistors a bit to get the characteristic equation and did some calibration to back-calculate the parameters. Over the range of ~0-100 C (and possibly wider, but I don't have an easy way, or need, to test that) I'm within a degree of my kitchen thermometer.

I just need to make it portable (i.e. battery power) and I'm good to go.
posted by DU at 11:59 AM on July 10, 2007


« Older Where can I find Japanese cand...   |   How can I change Firefox so th... Newer »
This thread is closed to new comments.