The clip switch is a custom switch I made using a clothespin with two aluminum pads. There is an insulator between the pads, which is tethered to the hinge-side of the door with a string. As soon as the door is kicked in, the buzzer sounds. However, the buzzer is still sounding even if the insulator was always there since the arduino was powered up. How do I fix the problem?
A pulldown resistor is required on A0 so that the voltage can ever go down to 0V.
A digital input with the built-in pullup resistor would be easier to handle. Unless you want to add protection against short circuit or break of the sensor wires, then an analog input is required.
10K does not work. I tried it and only the tiny resistor I used before worked. By the way, the tiny one is 22Ω, not 2Ω. I also paralleled the buzzer pin with some other pin using staples (I jumped pins using staples) to make the current stronger, therefore making the speaker louder.