Electronic – Noise in simple BC547-Raspberry Pi GPIO doorbell

noiseraspberry piresistorstransistors

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:

enter image description here

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:)

 GPIO.wait_for_edge(pin,GPIO.FALLING)

So I suppose some noise can trigger the transistor? But what can I do about it?

Best Answer

Your voltage-detection circuit has a very high impedance. I would go for a (much) lower impedance, for instance an 10k resistor, with an additional 10k resistor between the base and emitter of the transistor. This makes it much less likely that a stray voltage (moisture?) triggers your circuit.