2
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ Keep in mind that many doorbells use AC current to actuate. They have a simple transformer connected to mains which outputs a few volts AC. Are you sure your doorbell uses a DC supply? \$\endgroup\$ – Ryan Griggs Jan 1 '16 at 21:54
  • \$\begingroup\$ Good point! But it does have four 1.5 V cells, and no mains connection :-) \$\endgroup\$ – OZ1SEJ Jan 1 '16 at 23:28
3
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your suggestion! But I'm just a bit curious (I don't have very much electronics experience): Why would reducing the base resistor to 10k reduce noise? And why would adding a resistor between base and emitter reduce noise? \$\endgroup\$ – OZ1SEJ Jan 1 '16 at 21:57
  • \$\begingroup\$ Together, the two resistors from a voltage divider, which raises the voltage that will trigger the transistor to ~ 1 Volt, and the lower impedance means that ~ 0.05 mA is required to get 1V. Together these requirements make it less plausible that a high-impedance source (statics, moisture-leakage) will trigger the circuit. \$\endgroup\$ – Wouter van Ooijen Jan 2 '16 at 9:39
  • \$\begingroup\$ Hm, I do see your point. Two things; first: If the voltage is 4.8 V and both resistors are the same, won't that raise the required voltage to 2.4 V (not that that's a problem)? And second: 4.8 V / 10 k = 0.48 mA - is that not too much for the base-emitter junction? Is this sketch correct? i.imgur.com/rak6OYg.png \$\endgroup\$ – OZ1SEJ Jan 3 '16 at 20:21
  • \$\begingroup\$ With both resistors the same the required voltage is a little over 2 x 0.6V = 1.2V. The maximum base current can be found in the datasheet, look it up. \$\endgroup\$ – Wouter van Ooijen Jan 3 '16 at 20:32
  • \$\begingroup\$ Okay, so, now I've made a voltage divider like in this diagram: i.imgur.com/rak6OYg.png. But the GPIO pin still triggers every once in a while even when the button is not pushed - typically when the kids are jumping around or I'm pulling the wires, like it's a loose connection. I just don't see how that can trigger the circuit! Especially now with the two 10 kΩ resistors... \$\endgroup\$ – OZ1SEJ Jan 5 '16 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.