■ BY JON MCPHALEN THE SPIN ZONE
Some Like It Hot
Over the summer, I was able to escape the
heat and traffic of Los Angeles for 10 days
of heaven in Wasilla, Alaska — a wonderful
birthday gift from my sister, Reenie and her
husband, Lew. It was as a vacation should
be: Mostly relaxing, enjoying the tranquility
of the forest that is their back yard, though
we did mix in a fantastic day of fishing in
As you might imagine, the growing season in Alaska isn’t long — even with a greenhouse — so Lew orks very hard tending to his crops to get the
most out of them. Of course, there’s the occasional
moose that likes to pop in and steal a snack — something
most gardeners don’t have to worry about. Temperature
control of his greenhouse is completely manual: opening
and closing louvers and using fans as needed. I really like
Seward (I caught two salmon, two halibut,
three rockfish, and a sabelfish!). The night
we got home from fishing, we enjoyed an
incredible feast: halibut and rockfish fresh
from the ocean, with vegetables fresh from
Lew, and while flying home I started noodling ideas for
some kind of automation to help him maximize
production from the greenhouse. I’ve got between now
and June to come up with something neat.
Lew's greenhouse. There were even wild
raspberries picked from the perimeter of the
yard. It was amazing!
To that end, I thought I’d start with temperature and
humidity monitoring. I’ve had a Parallax SHT11 module
sitting on my desk for ages, and many years ago I used it
with a BASIC Stamp 2. Seems like now would be a good
opportunity to write a Propeller object for it (yes, others
exist, but I really like to write my own objects, and I
encourage you to do the same when the opportunity
presents itself).
The SHT11 module combines a surface-mount sensor,
a pull-up (to Vdd) on the data pin, and an inline series
resistor onto a breadboard-friendly DIP- 8 module (Figure
1). The clock pin of the module is a driven input, but there
have been reports of the module locking up if the
connection between the host and the SHT11 is not pulled
down. I figure a 10K resistor is cheap insurance from
possible frustration. Figure 2 shows the connection
between the module and the Propeller.
Communications with the SHT11 are fairly
straightforward; we just have to remember that we’re
using an open-drain connection on the data (DIO) line.
■ FIGURE 1.
SHT11 module.
Just for clarification, this means the pull-up on the module
will create the “1” state on the DIO line when we float
that pin. To write a “0,” we will make the control pin an
output and low. All this is accomplished by write a zero to
the outa[dio] bit, then manipulating the
dira[dio] to cause a 1 or 0 state on the DIO line.
After power-up and assigning pins, we need to run a
connection reset sequence to the SHT11. This is defined
as nine or more clock pulses while the data line is high
(left side of Figure 3). Again, floating the DIO pin will
allow the pull-up on the module to take that line high:
pub connection_reset
dira[dio] := 0
repeat 9
outa[sck] := 1
outa[sck] := 0
■ FIGURE 2. SHT11
module connections.
We should only need to do this once, but the method
14 December 2015