In this column, Kristen answers questions about all aspects of electronics, including
computer hardware, software, circuits, electronic theory, troubleshooting, and anything
else of interest to the hobbyist. Feel free to participate with your questions, comments, or
suggestions. Send all questions and comments to: Q&A@nutsvolts.com.
n WITH KRISTEN A. McINTYRE
QI have a backyard greenhouse and would like to find a DIY way to monitor soil moisture and ambient temperature. The greenhouse is detached, so I was hoping for something solar
powered and wireless. I know this is kind of open-ended,
but would you have design suggestions on how I can
accomplish this goal?
AMonitoring soil moisture isn’t that hard, but we should consider a couple of things. We’ll get to the
solar and wireless part in a minute.
The principle behind a moisture
monitor, though, is to measure the
conductivity of the soil.
We can think of the soil as a
variable resistor where the value of
that resistor is lower when the soil is
moister. Why is this the case? Pure
water is almost non-conductive.
A water molecule is slightly
polar, but not enough to conduct a
significant amount of charge. What
makes it conductive is usually some
ionically bonded contaminants, like
salts and some other minerals. In all
water from the tap (and in soil), these
contaminants become a pathway
to move charge because of their
own intrinsic charge. An electric
field — imposed by a bit of a voltage
difference — is enough to start moving
these charged ions, thus creating a current.
To measure the soil, we’ll use two wire probes
separated a little bit (say, an inch or less apart), inserted
into the soil. We’ll impose a voltage difference on those
probes and observe the current. What we need to do is
measure that current and convert it to a voltage. To do
that, we need what’s called a transimpedance amplifier —
converting current to voltage. Fortunately, cheapo ones are
simple to make.
The other thing to think about is that the amount of
current will vary quite a bit with the soil content, water
quality, probe depth, and probe separation. Since we must
cope with those variables, we’ll make the transimpedance
Figure 1 shows a simple transimpedance amplifier. It
doesn’t have a pure transimpedance transfer function, but
it’s good enough for our purposes. An op-amp can be used
to make a more idealized version.
Now we have the basic moisture sensor. Next, we
need to measure temperature.
There are several ways to do that
(even with a single transistor,
though it’s not linear). To make
things easier, let’s use a nice linear
temperature sensor like the TMP36
from Analog Devices; it’s a three-terminal device. You just give it 2. 7
to 5V on one pin, and a nice linear
voltage comes out another, with
one common pin. That voltage
and the moisture sensor voltage
can be measured with an Arduino
analog input pin. The datasheet for
the TMP36 can be found at www.
Add an XBee shield to the
Arduino, and now you can send
data wirelessly to another Arduino
with an XBee attached. It will take
some code to get this working,
• Moisture Monitor
• IDE Madness
• Lever Up With Steppers
n FIGURE 1. Simple, imperfect
transimpedance amplifier/moisture sensor.
14 May/June 2018