Double-Knock Desk Light | Arduino Nano & Piezo Sensor
A piezo sensor turns knocks on a desk into transient electrical signals. The Arduino recognizes a double knock by timing distinct events.
The key idea
A single impact can make the desk and sensor ring, producing multiple peaks. A short ignore interval after the first event and an upper limit on the second distinguish a two-knock gesture.
What to remember
- Group nearby peaks from the same impact.
- Tune the permitted interval using representative knocks on the actual desk.
Check your understanding
Why can a single knock switch the light in an overly sensitive design?
Show the explanation
Oscillation after the impact can cross the threshold again and be counted as a second knock.