Briefly, this project shows the current temperature on a LED
display using an absolute minimum of parts and with very good accuracy. A
temperature set-point can also be entered, enabling control of external devices
for rudimentary heating or cooling applications via a single digital output.
Temperature measurement is realised with a DS18B20 digital
temperature sensor IC, a device that will be familiar to many PICAXE
experimenters. The sensor can be mounted directly on the board or via short
flying leads tailored to suit the application.
For those interested in experimenting with 7-segment displays,
this project can also be connected to the Schools Experimenter (see
SILICON CHIP, May 2005) using an optional
header.
Power for the project can come from a three or 4-cell battery
pack or better still, a regulated 5V DC supply.
Three variants
First up, we must mention that the author is not releasing the
BASIC code for this project. Instead, you can purchase pre-programmed PICAXE-08M
chips (and PC boards) for a reasonable price. Three distinct versions of the
code have been created to cater for a variety of needs. There are two
thermostatic versions, identified as "heating" and "cooling", and a "temperature
only" version.
Both thermostatic versions display the temperature of the
DS18B20 sensor from 1°C to 124°C and allow entry of a user-selected setpoint.
Above the programmed setpoint, the "cooling" version produces a logic high (+5V)
on the digital output, whereas for the "heating" version, a logic high is
produced while the temperature is below the setpoint.
The "temperature only" version is just that; it displays the
temperature of the DS18B20 sensor, ranging from -55°C to +125°C, but has no
thermostatic functions. The digital reading from the DS18B20 is accurate to
±0.5°C from -10°C to +85°C, so the displayed reading will be accurate to 1°C.
The on-board LED is used to indicate negative temperature readings. Pressing S1
switches the display to read in degrees Fahrenheit, with a range of
32°F-125°F.
Note: a simplified version of the "temperature only" BASIC
program (named tempdisplay.bas) is available for download from our
website for those that wish to experiment with their own
code.