own, I created a bottom copper
mask (available at the article link).
Since this is for a single-sided PCB,
the design isn’t as compact as my
professionally-made boards.
The Thermometer
Program
There’s a sample of the
thermometer’s program also online at
the article link. Below is the fifty cent
tour of the program.
The program begins by setting
up I2C communications with the
24LC128 EEPROM. The data will be
stored here, and the PICAXE needs to
communicate at 400 kHz and in one
word addresses. Next, the code zeros
out the LED displays to show 00.
Prior to measuring the
temperature with the LM335, the
PICAXE checks to see if the
thermometer’s switch is set to Run or
Download. If set to Download, the
PICAXE starts at the beginning of the
memory’s address and gets each
value stored.
The data — which is stored in
words (since the PICAXE uses the 10-
bit A-to-D (analog-to-digital)
command for greater temperature
resolution) — is dumped onto a PC
using the SERTXD command. This
means the user must open the
Terminal program under the PICAXE
Editor.
In Run mode, the PICAXE uses
the READADC10 command to
digitize the voltage produced by the
LM335 temperature sensor. At 10-bit
resolution, the thermometer program
can measure changes as small as a
single degree Fahrenheit. This also
means the results must be stored in
one word records (rather than smaller
one byte records).
The math routine that converts
digitized voltage readings into a two-digit display first determines if the
temperature is above or below zero.
This occurs at a digitized reading of
522 for the sensor I am using. You,
however, might find you’ll need to
adjust this value up or down one
number.
Every change in one digitized
voltage reading (say, from 522 to
523) is a change by 1.16 degrees
Fahrenheit. Therefore, for every
change in seven digitized voltage
readings, the temperature is
decremented by one.
Whether the temperature is
above or below a reading of 522
determines whether I/O pin B.0 is set
high (to illuminate the red LED) or
low (to illuminate the blue LED). The
LED digits represent the tens and
ones of the temperature reading.
Each is set separately, so the program
must divide the temperature value by
10 to separate out each digit.
There’s a subroutine to show the
digits zero through nine on each
display, and the program jumps
execution to the proper subroutine.
After displaying the temperature,
the thermometer program records
the digitized temperature reading
into the next address in the 24LC128
memory. After a pause (you program
the length of the pause), the program
repeats itself.
That’s about it for the Totable
TVC (t-TVC) Thermometer. It’s a fun
project that’s useful for applications
off the work bench. We had some
pretty cold days in Idaho this winter
(although not as bad as the upper
Midwest and East experienced), and I
would have liked to use to record
and display temps overnight. Perhaps
you’ll find this project equally
interesting and useful.
For readers who don’t want to
make their own PCB, I’m making kits
available on my website at
NearSys.com.
Onwards and Upwards,
Your near space guide NV
May 2014 71