PROJECTS: SECRET-KNOCK GUMBALL MACHINE
Open Sez Me
Sweet, satisfying gumballs
A piezoelectric sensor detects knocks
on the front panel.
An Arduino microcontroller listens for
the knocks and tracks the relative times
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.
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.
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.
Illustration by Rob Nance
94 Make: Volume