code ledsON(red);. The bit_test function returns a
logical high which is passed to the RED_LED GPIO pin
by the output_bit function. Logical low signals are sent
to the YELLOW_LED and GREEN_LED GPIO pins.
Coding ledsON(grn_yel_red); would pass logical highs
to all of the E3mini’s GPIO pins that are driving the
Blinking LEDs may seem to be a
trivial task. However, that’s not the
point. Check out the Sensor
Explorer Kit’s ex_sk_7seg_led.c
example file and you will see where
the elegance of our simple LED
selection application originated.
Motion Sensing with
The Sensor Explorer Kit contains
a wide range of sensors. In that all
of the kit’s sensors are supported by
text and code, I decided to write an
E3mini sensor application using a
sensor that is not part of the original
Our E3mini motion sensing
application will employ the services
of a Zilog ZMOTION motion
sensing module like the one you see
in Photo 2. The ZMOTION sensor
is very easy to use. All we need to
do is monitor the ZMOTION
module’s output pin. When no
motion is sensed, the ZMOTION
output signal is held logically high.
In this case, logically high is + 3. 3
volts. The E3mini is a five volt
Since the ZMOTION module
provides a signal at its output that
will be sensed as a logical high by
our E3mini, we can directly interface
an E3mini pin to the ZMOTION
module’s output pin. The
ZMOTION circuitry is also easy to
As you can see in Schematic 2,
February 2017 53
■ PHOTO 2. The Zilog ZMOTION module is a complete PIR
sensing system. The motion-sensed output signal falls to a logical
low when motion is detected.
■ SCHEMATIC 2. The ZMOTION module is just as
easy to wire as it is to write code for.
■ SCHEMATIC 3. No rocket science here. It doesn’t get any
simpler than this.
■ PHOTO 3. It ain’t pretty, but it
works. The 3. 3 volt regulator is
perched on a three-pin SIP header.
The filter capacitors are 10 μF at
10WV in 0805 packages.