I've connected a Raspberry Pi to my Friedland "Ding Dong" doorbell. The doorbell has two (apparently unused) terminals, over which there seems to be a stable voltage of 1 mV when the button is not pressed, and a stable voltage of 4.8 V when the button is pressed.
To get this signal into the Raspberry Pi, I've come up with this simple design:
Between the switch and the resistor is 10 m of UTP cable. The resistor is the largest one I had, and it can still trigger the transistor. I'm running the GPIO input high (pull-up resistor) so a signal on the base pulls it down to ground.
My problem is that every once in a while, a signal will be detected when there is none. I know noone rang my doorbell, but the Raspberry Pi detects a signal (I'm using Python3 GPIO.wait_for_edge, like this:)
So I suppose some noise can trigger the transistor? But what can I do about it?