microprocessor will then instruct the motor control
circuit (F) to stop closing the door and open back up.
This all happens in just a few milliseconds.
Microcontroller: The microcontroller is based on
the Parallax P8X32A-Q44 multicore Propeller. The
Propeller’s multiple core processors are dedicated to
monitoring and controlling the various modules of
the CoopBoss. For example, to get almost near
instant object detection, one processor is dedicated to
monitoring the object detection (G) circuit, while the
other processors are free to process ZigBee traffic, button
I/O, read coop temperature, and monitor the ambient
light level.
PCB Power Supply: The power circuit is based on the
Texas Instruments’ LM2675MX- 3. 3 switching regulator. It
has a very wide input range from 8V to 40V DC and
outputs 3.3V DC with up to one amp of current. The
power circuit also has a one farad supercapacitor to help
regulate the power through high current demands from
the motor control circuit (F).
ZigBee Radio: The ZigBee radio is from Digi
International; the part number is XBP24CZ7UIS-004. This
radio securely communicates with the SmartThings hub
that connects to the Smart Things cloud on the Internet. A
smartphone app (Smart Things Custom Device Type)
allows secure control of the CoopBoss over the Internet.
The CoopBoss is a good example of how a reliable
circuit can be enhanced by connecting it to the Io T. By
adding a ZigBee radio and support for the ZigBee Home
Automation profile, the CoopBoss now can have an
intuitive user interface accessible from a smartphone
anywhere the smartphone has Internet access (Figure 3).
By using standard ZigBee clusters with custom attributes,
you can do some very slick stuff like add sliders that allow
the user to pick the sunlight level for a close or an open.
You can even set the sensitivity of the door’s object
detection circuit, so if a chicken is in the way, the door
will bump up against her and open back up.
This project and several others like it have been very
rewarding. I would like to share my experiences with focus
on the ZigBee communications. The real story here is not
the circuit, but how you can take a simple circuit and
make it into a full blown solution by connecting it to the
Io T. To accomplish this, I have laid out a simple “hello
world” test circuit in “The Controlling a Custom Device
with Smart Things” section of this article. It’s an LED tied to
a Propeller and a ZigBee radio. We will gradually add
complexity to the circuit as we go deeper into the
protocol.
Why ZigBee?
I would like to take a step back and acknowledge that
ZigBee is not the only show in town. Frankly, there is a lot
to choose from when it comes down to picking a protocol
for Io T communications, but arguably, the big players
today are Wi-Fi, Bluetooth LTE, Z-Wave, and ZigBee HA.
Almost all the popular home automation hubs support
one or all of these protocols. It’s beyond the scope of this
article to go into technical detail on each protocol, but I
will expand on why I selected ZigBee as the
communication standard for my devices.
Self-Configuring, Self-Healing
Mesh Network
ZigBee is a mature, open solution based on a self-configuring mesh network. That is important when your
device is outside several hundred feet away from your
ZigBee hub. If it is too far away to get a good signal, you
FIGURE 3. Smartphone App.
A ZigBee device supports several clusters or the same
cluster several times each on a unique ZigBee endpoint. If
you have a device with multiple LEDs to control, each LED’s
On/Off Cluster can be on a unique ZigBee endpoint. ZigBee
treats the cluster number and endpoint as part of the device’s
destination address. This way, you cannot only direct a
packet to a device, but to the correct application within the
device. We will see examples of ZigBee addressing in a
follow-up article when we build out our circuit that controls
an LED through a ZigBee Home Automation network.
The CoopBoss’ PCB is designed to fit inside a weather-tight aluminum
enclosure with weather-tight grommets.
January 2016 37