Introduction
This web page describes a low cost temperature recorder built around the
Texas Instruments, ez430-F2013 development kit.
Addition of a 32.768 kHz watch crystal and a small LiON cell and the
device records temperatures for up to a week.
Once the data is dumped using the USB debugger, reloading the software
readies the device for the next use.
It is useful for documenting office temperatures or the
profile of a shipment.
Background
At $20, the ez430-F2013 development kit is a terrific value.
Shortly after getting mine, Texas Instruments proposed a contest to
see what projects could come out.
This project is both a training and hobbiest entry in the contest to
create a low-cost temperature recorder.
Temperature Recorder System
The following photograph shows the three key elements:
Across the top from left to right and down:
- MSP430-F2013 - a RISC, 16-bit, microprocessor on a carrier.
This has three built-in timers, a low-power mode using a watch crystal,
a 16-bit ADC, 10 digital inputs and outputs with a LED on one, 256 bytes of RAM
and 2 Kbytes of flash memory.
Not shown, on the reverse side, is 32.768 kHz watch crystal.
In low power mode, it consumes ~2 microamps at a maximum of 3.6 V.
At higher speeds, it consumes ~1 ma. but that is not used for this
application.
This unit is rated to just over 100C.
- USB Programmer and Debugger - this USB device powers and interfaces
to the MSP430-F2013 with a four-pin plug. Warning: this device is rated
only to 85C and one test confirmed failure very close to this temperature.
- Battery holder and plug - this Radio Shack LiON battery holder has
a pair of power wires held with a button of epoxy to power the MSP430-F2013.
Software
The development system uses an IAR Kickstart system that includes a
"c" compiler, loader and debugger.
Application Software
Interrupt driven, after power-on initialization, the software checks the
first free FLASH word to see if run-length encoded data is present.
If not, the watchdog timer is configured as a watch crystal controlled
interval timer and each 8 second interrupt measures the temperature.
But if FLASH has run-length encoded temperature data, it dumps the
temperature time and values to the USB debugger terminal window and log file.
The 16-bit ADC measures the temperature using a built-in thermister device.
The built-in 'short' interface is used to provide a relative zero.
By happy accident, the low-power, 32 oversampling values are a simple offset
and shift from 1/10th degree, farenheiht values.
However, the low order three bits suffer from thermal noise and are shift out.
To smooth the data, a five-element, Gaussian filter is use on
each data point.
This minimizes noise yet preserves most local peak events.
The data from the Gaussian filter is stored in a three level, run-length
encoded array.
The three levels are the high, middle and low temperatures saved
as a byte value and a byte counter.
When a new high or new low temperature reading occurs, the last array element
is saved as a run-length word and the temperature arrays shifted.
The run-length word is written to FLASH and the part goes to sleep again.
Source Code
Operation
Initialization
Operation requires initial loading of the software which also clears the
FLASH memory.
Thereafter the part is stored, unpowered until use.
Begin Recording
To use the part, plug it into the battery. It takes 40 seconds to initialize
the Gaussian array and the LED flashes on and off three times.
Unplugging it before the last flash keeps the FLASH unused and the part
still ready for use.
Put the part in a suitable container and let it run.
End Recording
When the FLASH is filled, the LED will light. But recording can be stopped
at anytime by unplugging it from the battery.
If the last temperatures are important, change the temperature and wait
about 30 seconds for the run-length buffers to flush to FLASH.
Dump Data
To read out the data, plug the MSP430-F2013 into the USB device and bring
up the IAR system.
Make sure the "FET Debugger" is configured to 'preserve memory contents' and
start the debugger.
When "run" is activated, the terminal window will list on each line the
seconds and temperatures.
Save these to a file or the log and load them into a spreadsheet.
Analyze Data
Each timer tick is 8 seconds. Each temperature value is 1/10th of a farenheiht
degree.
Set the Excel spreadsheet to calculate time from the start and divide by
10 to get the temperature.
The following excel spreadsheets are examples of an
ice water bath and
boiling-to-ice test.
Accuracy
The following graph shows the results of an ice-water bath:
This graph shows the results of a boiling water filled thermos to
an ice-water bath:
The initial calibration constants were developed using the 3.5V powered
USB device in an ice-water bath.
However, the 3.15V battery power apparently resulted in a 28F reading
instead of 32F.
This data suggests Vcc effects on the thermister need to be quantified
but for measuring office environments, it is not needed.