PROJECTS
●●●●
■ THIS MONTH’S PROJECTS
Build an X10 Doggy Dish . . . . .36
Flood Detection Alarm . . . . . . . 42
MagicBox—Part2 ......... 46
■ LEVEL RATING SYSTEM
To find out the level of difficulty
for each of these projects, turn
to our ratings for the answers.
●●●● . . . . Beginner Level
●●●● . . . . Intermediate Level
●●●● . . . . Advanced Level
●●●● . . . . Professional Level
Last month, I gave
you details on how to
communicate with
various X10 computer
interfaces. This month,
I had planned on
showing you how to
use each one of those
interfaces with a
microcontroller. I
want to deviate a bit
and actually
show you how to
build a cool project
using the CM17A
FireCracker.
36
May 2007
CONTROL
YOUR WORLD WITH
AN X- 10 INTERFACE
Build an X10 Doggy Dish
Over the last 10 years, I have built
many different automatic dog
watering dishes. Some worked pretty
well and others did not. Inevitably, all
dishes eventually failed and one
conclusion I came to was that it was
not practical to automatically fill the
dish; as eventually all the systems
failed and I ended up with a mess.
What I wanted instead was a system
that would let us know when the dish
needed to be filled. I came up with
the following project requirements:
• No probes are to come in contact
with the water.
• No floats or other items are to be
placed inside the dish.
• The system must be portable and
able to be installed under the dish.
While playing with the
FireCracker and the microcontroller
interface, the idea for this project
came to me. The FireCracker
(CM17A) is small and gets its power
from the control leads. The interface
is simple and requires no external
components. All that was left was to
come up with a way to detect the
amount of water in the dish.
The easiest way would have been
to sink a couple of leads into the water,
but this is not safe for the animals no
matter how low the current and
voltage is. Floats are a pain and tend to
get in the way. In the past, I had used
a special platform that measured the
weight of the dish. While this system
worked well, it was not portable and
the mechanics were prone to failure.
I tried using sonar and IR
sensors to detect the depth, but they
were a failure, as well. Then I remembered an experiment I performed
about a year ago using an I/O
interrupt (IRQ) as a counter. I set up
a DiosPro microcontroller with one
of its leads as an IRQ counter and
created a routine that would
increment a variable each time the
IRQ fired. During one of my
experiments, I found that if I toggled
one of the other ports while I was
touching the IRQ port, it would
detect the toggled port. My body
was acting as a giant antenna for the
very sensitive IRQ port and just
about any electrical activity would
cause the IRQ to fire.
To expand on the experiment, I
held the IRQ port low with a 100K
resistor. This would reduce the sensitivity, but when I touched the IRQ port,
nothing happened. If I touched both
the IRQ port and the toggling port, the
IRQ would fire with each toggle. I then
connected large metal plates to both
the IRQ port and the toggle port. I
placed them very close without touching and the toggle port would cause
the IRQ port to count. This is exactly
what I was looking for so I placed the
plates against a plastic jug and when
filled with water, the IRQ port would
pick up the toggle port level changes.