Issue
113 December 1999
Being
Cool is Easy
A
Temperature-Sensing Control Device
by
Donald Blake
Skip
the expensive sunglasses and red sports car. According
to Donald, all you need is a microcontroller, an
X-10 temperature sensor, and some interfacing software
to control a fan to stay cool on a hot summer day.
Start
Putting
It All Together Overview
of the Sensor The
LCD
Power Line
Interface
Processing
Requests
Prototype
Construction
Sources
and PDF
My
experiments with Microchips PIC line of micro-controllers
began with the 16C84. The PIC16C84 is a good starting
device. Its 1-KB EEPROM is quickly reprogrammed and
inexpensive programming devices are commercially available
or easily built from readily available plans.
The
elemental structure of any embedded architecture consists
of input, processing, and output. My initial experiments
started with the output component. I used a 2-line by
16-character LCD module.
The
LCD module, which contains an onboard controller, has
a relatively simple interface. I used the Optrex DMC16207,
although there are a number of other manufacturers with
many sources for new and surplus devices. The interface
is documented in Optrexs databook and theres
a good technical document available online.
Now
that I had a working output device capable of presenting
up to 32 characters, I needed an input device. Ive
always been fascinated with temperature measurement
and thats where I focused.
My
first temperature sensor was an analog device. An external
ADC as well as a voltage reference was required because
these functions arent built into the 16C84.
Another downside to the analog device is that a constant
current source is required when the sensor is placed
at any significant distance from the ADC.
I
discovered the Dallas Semiconductor DS1820 1-Wire digital
thermometer shortly after implementing the analog sensor.
The DS1820 provides a digital interface, eliminates
several external components, gives better accuracy,
and permits the sensor to be located a considerable
distance from the microcontroller.
Using
the 16C84, LCD display and the DS1820 digital
thermometer, my first complete PIC project was a simple
indoor/outdoor thermometer that recorded minimum and
maximum temperature, and displayed readings in Fahrenheit
and Celsius.
THE
X-10 INTERFACE
Ive
used the X-10 line of home automation (HA) products
for many years. I started with simple one-way "dumb"
controllers and later migrated to the programmable CP-290
X-10 Powerhouse. My current HA setup uses the Homebase
intelligent controller by Home Controls, Inc. I decided
on an X-10 interface for the next step in my PIC experiments.
Homebase
uses the X-10 TW-523 two-way power line interface module
to send and receive X-10 commands. My one and only TW-523
module failed a short time back and left me to rely
on my old faithful CP-290 for several days. I ordered
a replacement TW-523 along with a few spares. These
spare TW-523 modules enabled me to further my PIC experimentation.