Control Your World
higher precision than just the standard
.5C. The high-level DS1820ReadTemp
function does this automatically for you.
The DS18S20 is actually marked
DS1820 and comes in a TO- 92 form
factor shown in Figure 13. In parasite
mode, the VDD lead is connected to
GND. I almost always connect these
chips to a length of Cat 3 cable about
4’ in length. Once the chip has been
connected to the cable, I dip it into
liquid electrical tape as shown in
Figure 14. This allows me to place the
actual sensor in just about any location away from external heat sources.
Outdoor sensors must be placed
in the shade and must have good
air circulation. Last month, we looked
at the AAG weather instrument. This
instrument has a DS18S20 chip
installed but when the sun hits
the white plastic, the inside turns into
a solar furnace. The temperature
inside this furnace can vary as much
as 15 degrees from the actual outside
The best way to take outdoor
temperature measurements is to build a
solar shield in the shape of a pagoda.
The pagoda shape is created by stacking a series of bowls or plates so that
they overlap. This overlap creates an
area inside that is shielded from the sun.
You need at least three layers, but
more are better. The pagoda in Figure
15 was created by using three plastic
bowls. I cut a 1-1/2” hole in the center
of the two lower bowls for the PVC
pipe. The bowls are held together with
3” stainless steel bolts. The sensor is
run up through the PVC pipe and
extrudes through a small hole in the
pipe just under the second layer.
You can buy commercial pagodas but they can
run you well over $100.
This one cost me about
$1 to build. There is a
simple pagoda project
on the Kronos Robotics
website if you want to
build one of these.
sensors should be placed
away from windows and
away from direct sunlight.
Also watch out for the
heat generated by various appliances such as
monitors or other
sensors and power
supplies. I use a
small telephone surface-mount box with the
sensor attached to the
two front red and green
wires. Be sure to drill
some holes in the cover
as shown in Figure 16.
To test your temperature sensor, use the
shown in Figure 17. As
before, do a Rom
search, then double-click
the DS1820 entry and
hit the SetRom button.
program will take a
reading once every 800
ms and display the
results in Fahrenheit. If
you want to display the
Celsius values, you will have to make a
few changes to the source code. Just
to show you what you can do with a
single DS18S20 chip, I added a threshold field. When the temperature is
over this value, an alarm will sound.
■ FIGURE 14
■ FIGURE 13
■ FIGURE 15
units utilize a Honeywell HIH-4000
humidity sensor connected to a
DS2438 1-Wire chip.
The AAG module comes in only
one configuration with the case included. The Hobby Boards module comes
in several configurations including
kit form. I prefer the Hobby Boards
You will want your weather
station to keep track of both indoor
and outdoor humidity. Both AAG and
Hobby Boards sell a 1-Wire humidity
module, as shown in Figure 18. They
function almost identically and are, for
the most part, interchangeable. Both
■ FIGURE 17
■ FIGURE 16
March 2007 35