How to detect if a doorbell is ringing via GPIO

I'm looking to programmatically determine when my doorbell is ringing. I've opened it up, and it is a straightforward circuit. It is .5watt:

What I would like to do is wire up my Arduino/Raspberry Pi to this doorbell, detect when the doorbell speaker is ringing, and then do some other stuff.

What potential options do I have to detect if the speaker is currently ringing? Can I wire up the speaker in parallel with the right amount of resistance to one of the GPIO pins?

Thank you for your help!

Here are the options I have been considering:

  1. Wiring the speaker into the GPIO pin with the appropriate voltage stepdown

  2. Using a Piezo speaker to detect when the doorbell is ringing

  3. Using a microphone to detect when the doorbell is ringing

Any input is appreciated!

  1. Should do it.
  2. Opto coupler if you need isolation.

Opto coupler with opto transistor from pin (collector) to ground (emitter) and pull up enabled on the pin.
Opto Led with reverse protection diode across and current limiting resistor in series. 1-2mA should be enough.
Leo..

I would use an optocoupler as above.

Anything connected to different branches of the house wiring poses a risk of ground loops, which can easily destroy an Arduino.

Thanks for the replies!

An optoisolator seems like the way to go. I've found an easy breakout board I can use from sparkfun, I'm thinking of this one:

I've sketched my circut, I think I should wire it up like this?

Am I missing anything here? Do I need any resistors along the way? Thanks!

Am I missing anything here?

Since the voltage from the speaker is AC, the negative swings could damage the input LED. I would use a series resistor of 1K and a diode antiparallel to the input LED to protect it. See below. Reduce the 1K if needed.

You do not connect "Arduino 3.3V" to OUT1. Connect it to "HV" instead.

speaker.png

speaker.png

jremington:
Since the voltage from the speaker is AC, the negative swings could damage the input LED. I would use a series resistor of 1K and a diode antiparallel to the input LED to protect it.

I didn't know that, thank you for the advice!

Final circuit is looking like this:

Should work. Let us know how it goes!

One quick snag I've run into: I can't seem to determine the voltage coming out of the speaker.

I've soldered on extra wires onto the speaker contacts, but when I set my multimeter to AC it just displays 0. On the speaker is clearly printed: "20 Ohm, .5W" so if I trust that I know I'm working with ~3v. Is that good enough for me to start wiring things up? Reason for it not working could be:

  1. Is my multimeter not sensitive enough to register the low voltage?

  2. Did I mess up my soldering? (Unlikely, I've inspected it and it looks like a normal joint)

  1. Is my multimeter not sensitive enough to register the low voltage?

That would depend on your multimeter.

Make up the circuit that I posted in reply #5, using a red LED, and attach it to the speaker.

Then play a tone. If the LED lights up, the optocoupler will work too.

thr33:
I've soldered on extra wires onto the speaker contacts, but when I set my multimeter to AC it just displays 0. On the speaker is clearly printed: "20 Ohm, .5W" so if I trust that I know I'm working with ~3v.

Not necessarily as your speaker is an inductive load, not a resistive. So the resistance is highly dependent on the frequency of the signal applied.
For measuring the voltage with your multimeter, do make sure that you're measuring AC not DC.