PROJECTS: SECRET-KNOCK GUMBALL MACHINE
makezine.com/25/gumball
Open Sez Me
Sweet, satisfying gumballs
tempt passersby.
A piezoelectric sensor detects knocks
on the front panel.
An Arduino microcontroller listens for
the knocks and tracks the relative times
between them.
If the Arduino determines that the input
knock rhythm matches the target pattern, it
switches on the servomotor.
The servo rotates the dispensing wheel
through the gumballs, which causes one of
them to fall into its delivery hole.
As the wheel completes its
rotation, it dumps the gumball from
its delivery hole into the delivery tray.
Whenever the Arduino hears a knock,
it also flashes the green indicator light.
You can program the
Arduino to listen for different
patterns by pressing the
programming button on the
back and knocking
a new sequence.
The Arduino
shines the red
indicator light while the
programming button is
pressed and whenever a
knock pattern fails
to match the target.
The sensitivity potentiometer
sets the level of loudness the
circuit will recognize as a knock.
makezine.com/
25/gumball
All project-specific circuitry is built onto a perf board
shield that plugs on top of the Arduino. This lets you
unplug the microcontroller for use in other projects.
G
B
D
G
GD
GND
I
G
J
H
Illustration by Rob Nance
94 Make: Volume
25