Project 12 - Servo vibrates and this is read as knocks

Hi there,

I am trying to complete Project 12 of the Arduino handbook: Knock Lock.
Unfortunately when I press the switch, the servo locks, but in about a second it unlocks automatically, without me having actually knocked. I think the vibration of the servo is being interpreted as a knock.
Any way to solve this?

Any help would be appreciated as soon as possible!

Thank you!

If you think that it's the servo, remove it and check again, watching the LEDs.

If your circuit is too sensitive, increase the threshold.