Trying to setup my door bell using raspberry PI B+, the input from the door bell stays at 0 DC and turns to 2.9v when the switch is pressed, I'm using the following python code to detect this activity
GPIO.setmode(GPIO.BOARD)
GPIO.set(13, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
try:
while True:
sleep(0.1)
if (GPIO.input(13)==GPIO.HIGH:
print time.strftime("%H:%M:%S")
except KeyboardInterrupt:
GPIO.cleanup()
sys.exit()
the problem i'm getting is that even no one press the doorbell switch, randomly, around once per 10~20seconds, my Pi detects a GPIO.HIGH, thus, my doorbell project failed :-(
Any ideas?
PS: I used my multimeter to make sure my input is correct from doorbell, it read 0~0.01 in a steady 5 mins, while my Pi still gives me random GPIO.HIGH reads every 10~20 seconds in the same period.