in the center of the table would be ideal. The only issue
with that is I have never seen a triangular project box and
I certainly didn’t have one on hand. The plan to expand the
build to a custom enclosure was made so that three sensors
could be used.
The heart of this project will be the microcontroller.
Since the task isn’t complex, almost any microcontroller
would do. The main thing I was concerned about was that I
had enough I/O pins to handle everything. I chose the
Arduino Pro Mini since I had some on hand, I love the
small size, they have a ton of I/O pins, and the price is such
that you would simply use a new one for the next project
rather than scavenge one from an old one. As a bonus, this
microcontroller is programmed using an FTDI cable which
makes it very easy to do serial port debugging. The HC-
SR04 ultrasonic sensors have four connections: two for
power; a trigger; and an echo pin. The trigger and echo
pins are connected to the microcontroller to be able to
initiate a measurement and get the results. There are some
ultrasonic sensors such as the Parallax Ping))) that require
only one I/O pin. So, if I was I/O constrained, the Parallax
version could be an easy way to lighten my I/O needs.
Next, we have three LEDs that will be used to indicate
which sensor was triggered. These three blue LEDs will be
driven directly from an I/O pin since they will only draw
around 4 mA with the 470 ohm current-limiting resistor.
The LEDs and resistors are shown as individual components
in the schematic, but I ended up using some that were pre-built with the resistors soldered in place and leads attached.
The servo will use just one I/O pin to receive the
position information it needs. The servo was selected such
that it would have enough torque to spin something fairly
heavy. The Dynam B2232 that was used has a torque of
44. 4 oz-in at 4. 8 volts. The use of a servo motor meant that
using the voltage regulator that is built into the Arduino Pro
Mini would be out of the question, and that a stand-alone
voltage regulator would be needed.
The power supply section is very simple. A 12 volt DC
plug-in power supply will give power to the box using a
barrel connection; a LM7805 in a TO-220 package along
with three filter capacitors will be used to generate the five
volts for the electronics. A power-on switch will be wired in
series with the power-in and the feed to the circuit so that
the circuit can be powered down completely when needed.
The 12 volt alarm output is buffered using a small
2N4401 NPN transistor in a TO-92 package. This allows the
five volt low current I/O output from the microcontroller to
control external items such as a vibration motor with ease.
There is no current limiting on this connection, so a short
on this external alarm output would blow the transistor. A
simple current-limiting circuit could be added with a few
One method that would probably be fast enough
would be to insert an inline current sense resistor to the
output and use this as feedback to an I/O pin that is
capable of being interrupt controlled. Select the resistor
value such that the current you are wanting to trip the over-
July 2014 39