This is a simple Arduino sketch that was originally designed to experiment with arrays and the built-in timing functionality. I based it on the tutorial sample code http://www.arduino.cc/en/Tutorial/Knock

The system consists of a piezo sensor connected to an analog pin that listens for a knock from the user. The Arduino then stores the time the knock occurred in an array. After a predefined time without further knocks occurring, the Arduino will 'play back' the knocks on a buzzer and LED in time to the original knocking pattern.

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.

Step 1: Materials

You will need:

1. An Arduino UNO or compatible board.
2. An LED and appropriate resistor (I used 220R).
3. A piezo sensor.
4. A 1M pull-down resistor.
5. A piezo buzzer or alternative output device (see page one notes).
6. A breadboard and wires.
<p>Works great Dan. Well commented code too :-)</p>
Very nicely done.
It's a SainSmart UNO (an arduino clone)
what type of arduino is that?

About This Instructable




Bio: I am a Software Developer based in the North East of England. I'm currently experimenting with Arduino and posting tutorials as I go.
More by dan_nicholson:Arduino Baby Sleep Monitor 'Knock Back' - A Knock Echoing Arduino Ultrasonic gesture based TV remote control 
Add instructable to: