‘Knock Back’ – A Knock Echoing Arduino
The device could be expanded to include a stepper motor or similar suitable output that would recreate the knocks exactly, just replace the output buzzer.
You could also use the piezo input sensor as the output buzzer by altering the code.
- An Arduino UNO or compatible board.
- An LED and appropriate resistor (I used 220R).
- A piezo sensor.
- A 1M pull-down resistor.
- A piezo buzzer or alternative output device (see page one notes).
- A breadboard and wires.
Step Two: Assemble
The configuration of the device is fairly simple.
- Connect the LED to pin 9 (via the resistor) and GND.
- Connect the output buzzer to pin 8 and GND.
- Connect the knock senzor to analog pin 0 AND GND.
- Connect your 1M resistor to the positive wire of the knock sensor and GND. This is used as a pull-down resistor.
Note: Be sure to check that my resistor recommendations are correct for the components you are using, including the lack of resistors on the two piezo buzzers.
Step Three: The Sketch
Upload the following to your Arduino.
Step Four: Knock it ’till you’ve tried it”