DaxTrajero
Posts: 5
Joined: Fri Aug 10, 2018 10:59 am

How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 2:21 pm

(updated)

Hi Everyone

Just need a small bit of advice to get going. Not looking to fit any fancy camera/remote doorbell. Simply want to use a PI to detect when the old style wired doorbell button has been pushed.

The wired doorbell button is wired to a chime in the hallway. There's two wires leading into the chime/bell - as shown below. One from the transformer, one from the doorbell button.

Goal 1 - fit the PI alongside the existing chime/bell
Goal 2 - power the PI using same source the chime uses IF POSSIBLE
Goal 3 - PI to detect when the doorbell button is pressed
Goal 4 - allow the chime to work as it does currently - doorbell button triggers chime

Any initial help would be appreciated. I've looked all over the internet, instructables, etc and its a mish-mash of people using wireless doorbell buttons, linked to god knows what. I just want to keep it simple.

Image

PS: I think the HTML formatting got added automatically when I created a DRAFT first
Last edited by DaxTrajero on Fri Aug 10, 2018 9:25 pm, edited 3 times in total.

fruitoftheloom
Posts: 16934
Joined: Tue Mar 25, 2014 12:40 pm

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 2:41 pm

DaxTrajero wrote:
Fri Aug 10, 2018 2:21 pm
<r>[img]<URL url="https://electrical.knoji.com/images/use ... <LINK_TEXT text="https://electrical.knoji.com/images/use ... 2c.jpg[img">https://electrical.knoji.com/images/use ... daee2c.jpg[img</LINK_TEXT></URL>]<br/>
<br/>
Hi Everyone<br/>
<br/>
Just need a small bit of advice to get going. Not looking to fit any fancy camera/remote doorbell. Simply want to use a PI to detect when the old style wired doorbell button has been pushed.<br/>
<br/>
The wired doorbell button is wired to a chime in the hallway. There's two wires leading into the chime/bell - as shown above. One from the transformer, one from the doorbell button.<br/>
<br/>
Goal 1 - fit the PI alongside the existing chime/bell<br/>
Goal 2 - power the PI using same source the chime uses IF POSSIBLE<br/>
Goal 3 - PI to detect when the doorbell button is pressed<br/>
<br/>
Any initial help would be appreciated. I've looked all over the internet, instructables, etc and its a mish-mash of people using wireless doorbell buttons, linked to god knows what. I just want to keep it simple.<br/>
<br/>
Any help would be appreciated.</r>

The first 2 links do not work....

Please can you remove the "html" formatting tags as they are not making your post readable.


Raspberry Pi power requirements:

https://www.raspberrypi.org/help/faqs/#topPower
Adieu

drgeoff
Posts: 8354
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 2:42 pm

1. Don't try to put html code in your post.

2. It is unlikely that you can power the RPi from the existing bell transformer for several reasons:

a. it may be outputting AC.

b. even if outputting DC it is unlikely to be close enough to the 5 volts that a RPi requires.

c. bell transformers are usually not designed to provide a continuous output current at the level a RPi requires.

PiGraham
Posts: 3320
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 3:18 pm

Image


Is the transformer could be ac or dc. Can you check?


Basically you can connect and opto-isolator across the bell terminals and connect the output to a gpio. Connect it like a push button.

Choose a series resistor for the opto LED to suit the bell voltage.


If ac then the LED will pulse, if cd it will go on solid. You can handle the difference in code.


You will need to find the ratings for the transformer. If it has a couple of watts spare over and above what the bell needs you could use a rectifier (if ac) and regulator to convert to 5V dc to be suitable for the Pi.


Consider that after you get it working. Use a recommended 5V PSU to run the Pi to start with.

DaxTrajero
Posts: 5
Joined: Fri Aug 10, 2018 10:59 am

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 3:31 pm

drgeoff wrote:
Fri Aug 10, 2018 2:42 pm
1. Don't try to put html code in your post.

2. It is unlikely that you can power the RPi from the existing bell transformer for several reasons:

a. it may be outputting AC.

b. even if outputting DC it is unlikely to be close enough to the 5 volts that a RPi requires.

c. bell transformers are usually not designed to provide a continuous output current at the level a RPi requires.
Thank you, that makes sense

DaxTrajero
Posts: 5
Joined: Fri Aug 10, 2018 10:59 am

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 3:33 pm

PiGraham wrote:
Fri Aug 10, 2018 3:18 pm
Image


Is the transformer could be ac or dc. Can you check?


Basically you can connect and opto-isolator across the bell terminals and connect the output to a gpio. Connect it like a push button.

Choose a series resistor for the opto LED to suit the bell voltage.


If ac then the LED will pulse, if cd it will go on solid. You can handle the difference in code.


You will need to find the ratings for the transformer. If it has a couple of watts spare over and above what the bell needs you could use a rectifier (if ac) and regulator to convert to 5V dc to be suitable for the Pi.


Consider that after you get it working. Use a recommended 5V PSU to run the Pi to start with.
Thats great info, I'll get going and research everything. Much appreciated

DaxTrajero
Posts: 5
Joined: Fri Aug 10, 2018 10:59 am

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 3:45 pm

Thanks for all the info

As a future project, I wonder if its worth removing the chime box altogether...

Wire the doorbell button to the PI

Let the PI talk to something like an ECHO DOT to produce a chime?

User avatar
rpdom
Posts: 12658
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 5:43 pm

My doorbell uses a Pi. The long leads from the button are connected to the 5v from the pi and a resistor to drive the input of an opto-isolator. One side of the output stage of the opto is connected via a resistor to 3.3V and a GPIO. The other side is connected to ground. When the button is pressed it turns on the opto and that pulls the GPIO low. The reason for the opto is to filter out any interference that the long leads may pick up. The opto-isolator is a lot less sensitive than a GPIO.

The software polls the GPIO about ten times a second. If it detects the GPIO has gone low, it waits another 0.1 seconds and checks again, then again (for debouncing). If it is still low it triggers the playback of a sound file and then waits until the GPIO goes high again before returning to the polling loop.

Sound is played using the aplay command. The sound file is in wav format.

Audio output is done via the standard analogue audio jack linked to a small amplifier module being powered from the Pi's USB and a small speaker.
The triggering is done by broadcasting a message around my home network ("DINGDONG" :lol:) which is received by another program that does the actual playback. They just happen to be on the same Pi. They don't have to be. I can run the playback program on any Pi (or Linux PC) on my network and it will play a sound. I can be out in my garage and the Pi that monitors the temperature in there and the garden will let me know that someone has rung the doorbell.

PiGraham
Posts: 3320
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 6:49 pm

rpdom wrote:
Fri Aug 10, 2018 5:43 pm
The reason for the opto is to filter out any interference that the long leads may pick up. The opto-isolator is a lot less sensitive than a GPIO.
It will also protect the Pi from any high voltage spikes that can be produced by electromagnetic bells.

Sounds like a nice setup you have there.

DaxTrajero
Posts: 5
Joined: Fri Aug 10, 2018 10:59 am

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 9:22 pm

rpdom wrote:
Fri Aug 10, 2018 5:43 pm
My doorbell uses a Pi. The long leads from the button are connected to the 5v from the pi and a resistor to drive the input of an opto-isolator. One side of the output stage of the opto is connected via a resistor to 3.3V and a GPIO. The other side is connected to ground. When the button is pressed it turns on the opto and that pulls the GPIO low. The reason for the opto is to filter out any interference that the long leads may pick up. The opto-isolator is a lot less sensitive than a GPIO.

The software polls the GPIO about ten times a second. If it detects the GPIO has gone low, it waits another 0.1 seconds and checks again, then again (for debouncing). If it is still low it triggers the playback of a sound file and then waits until the GPIO goes high again before returning to the polling loop.

Sound is played using the aplay command. The sound file is in wav format.

Audio output is done via the standard analogue audio jack linked to a small amplifier module being powered from the Pi's USB and a small speaker.
The triggering is done by broadcasting a message around my home network ("DINGDONG" :lol:) which is received by another program that does the actual playback. They just happen to be on the same Pi. They don't have to be. I can run the playback program on any Pi (or Linux PC) on my network and it will play a sound. I can be out in my garage and the Pi that monitors the temperature in there and the garden will let me know that someone has rung the doorbell.
thank you for that info - yes, I've been learning about Opto-Isolators. Fascinating stuff for a PI newbie and electronics newbie like me.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: How to detect an old style wired doorbell only - nothing else

Fri Aug 10, 2018 9:41 pm

If you doesn't want to modified the old style doorbell. Than the following schematic could be something for you.
Image

You could use one of those. It's up to you :) You connect the left side (J1 or J2) to the same connection as your bell.
If you connect it in this way. You pi is fully galvanic isolated from the your doorbell and you don't need the 5V from you pi. The Vcc is connected to the 3.3V rail.

PiGraham
Posts: 3320
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to detect an old style wired doorbell only - nothing else

Sat Aug 11, 2018 8:41 am

Useful circuits Brandon92.
It isn't essential to rectify ac or filter 50/100Hz since it is possible to handle a pulse train in software. So you could leave out D1 to D4 and C3 and C2.
The opto will turn on every other half cycle and if there are any no pulses in 20ms the bell is not pressed.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: How to detect an old style wired doorbell only - nothing else

Sat Aug 11, 2018 9:16 am

PiGraham wrote:
Sat Aug 11, 2018 8:41 am
Useful circuits Brandon92.
It isn't essential to rectify ac or filter 50/100Hz since it is possible to handle a pulse train in software. So you could leave out D1 to D4 and C3 and C2.
The opto will turn on every other half cycle and if there are any no pulses in 20ms the bell is not pressed.
That's is also a possibility. If you know how to do that in software :).
But, you need to at a diode in opposite direction of the led of the optocouple. Otherwise the led is damaged, because the reverse voltage is to high (for the 4n25 it is 5v).

User avatar
DougieLawson
Posts: 33352
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: How to detect an old style wired doorbell only - nothing else

Sat Aug 11, 2018 1:42 pm

DaxTrajero wrote:
Fri Aug 10, 2018 3:45 pm
Thanks for all the info

As a future project, I wonder if its worth removing the chime box altogether...

Wire the doorbell button to the PI

Let the PI talk to something like an ECHO DOT to produce a chime?
A bell push with resistor wired to a GPIO can give you a signal when the caller rings.

Another GPIO wired to a relay can switch the 12V AC transformer and the bell.

That gives you a chance to have an IOT doorbell.

You don't need a Raspberry for that, use a Wemos. Fire messages at the Wemos by subscribing it to a topic with MQTT. Get the the bell push to publish on another MQTT topic. The Raspberry runs the MQTT broker.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

btidey
Posts: 1571
Joined: Sun Feb 17, 2013 6:51 pm

Re: How to detect an old style wired doorbell only - nothing else

Sun Aug 12, 2018 10:17 am

I have an instructable on interfacing into an old style doorbell unit.

https://www.instructables.com/id/Door-B ... re-Sensor/

This uses a ESP8266 (ESP-12F) unit.

All is contained within the chime unit and it is powered by the bell transformer power. It reports over wifi.

The software as published with this sends out notifications to a phone, and logs into a raspberry easyIot server. It also supports temperature meausurement, but could be easily adapted to needs.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: How to detect an old style wired doorbell only - nothing else

Sun Aug 12, 2018 12:33 pm

btidey wrote:
Sun Aug 12, 2018 10:17 am
I have an instructable on interfacing into an old style doorbell unit.

https://www.instructables.com/id/Door-B ... re-Sensor/

This uses a ESP8266 (ESP-12F) unit.

All is contained within the chime unit and it is powered by the bell transformer power. It reports over wifi.

The software as published with this sends out notifications to a phone, and logs into a raspberry easyIot server. It also supports temperature meausurement, but could be easily adapted to needs.
Did you know that you are providing approximately -0.8V to the input of your ESP8266 ;) . Instead of this:
A resistor / zener diode clips this so a 0 - 3.3V 50 Hz pulse is fed into a GPIO pin.
However, I find you code interesting and I need to take a closer look at it.

btidey
Posts: 1571
Joined: Sun Feb 17, 2013 6:51 pm

Re: How to detect an old style wired doorbell only - nothing else

Mon Aug 13, 2018 7:47 am

Brandon92 wrote:
Sun Aug 12, 2018 12:33 pm

Did you know that you are providing approximately -0.8V to the input of your ESP8266 ;) . Instead of this:
A resistor / zener diode clips this so a 0 - 3.3V 50 Hz pulse is fed into a GPIO pin.
However, I find you code interesting and I need to take a closer look at it.
Yes. That is true. It was loose wording in the instructable. The current is limited though and does not cause the ESP GPIO any harm. One could increase the series resistance and / or put a schottky in parallel to lower this further.

PiGraham
Posts: 3320
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to detect an old style wired doorbell only - nothing else

Mon Aug 13, 2018 8:15 am

btidey wrote:
Mon Aug 13, 2018 7:47 am
Brandon92 wrote:
Sun Aug 12, 2018 12:33 pm

Did you know that you are providing approximately -0.8V to the input of your ESP8266 ;) . Instead of this:
A resistor / zener diode clips this so a 0 - 3.3V 50 Hz pulse is fed into a GPIO pin.
However, I find you code interesting and I need to take a closer look at it.
Yes. That is true. It was loose wording in the instructable. The current is limited though and does not cause the ESP GPIO any harm. One could increase the series resistance and / or put a schottky in parallel to lower this further.
You could put series diode in line to the ESP pin.

Personally I'd use the 10V ac to drive an opto.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: How to detect an old style wired doorbell only - nothing else

Mon Aug 13, 2018 9:04 am

btidey wrote: Yes. That is true. It was loose wording in the instructable. The current is limited though and does not cause the ESP GPIO any harm. One could increase the series resistance and / or put a schottky in parallel to lower this further.
Okay, If I read the datasheet correctly? the minimum voltage is -0.3. But, I don't know at what input current the ESP gpio will be damaged. And the ESP will have probably a protection diode at his input, as the one you stated. But this could be a discussion at his self :roll:
PiGraham wrote: Personally I'd use the 10V ac to drive an opto.

I would do the same. If the zener diode get damaged / broken, you don't blow up you (expensive) controller.

btidey
Posts: 1571
Joined: Sun Feb 17, 2013 6:51 pm

Re: How to detect an old style wired doorbell only - nothing else

Mon Aug 13, 2018 9:53 pm

Brandon92 wrote:
Mon Aug 13, 2018 9:04 am
PiGraham wrote: Personally I'd use the 10V ac to drive an opto.

I would do the same. If the zener diode get damaged / broken, you don't blow up you (expensive) controller.
Using an opto is a good method. I used the zener method as it was to hand, simple and with the resistor limiting any over-current. Zeners are very reliable components. I have had this running continuously now for over 2 years.

I obviously don't want to blow up the controller but describing it as expensive is strange. UKP 1.50.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: How to detect an old style wired doorbell only - nothing else

Mon Aug 13, 2018 10:02 pm

btidey wrote:
Mon Aug 13, 2018 9:53 pm
Using an opto is a good method. I used the zener method as it was to hand, simple and with the resistor limiting any over-current. Zeners are very reliable components. I have had this running continuously now for over 2 years.

I obviously don't want to blow up the controller but describing it as expensive is strange. UKP 1.50.
Okay, that is good to hear that's it working for so long now. And those kind of controllers are indeed not expansive. But, if you blow up the raspberry pi 3b+ (or a production unit), that's a little bit to much, in compared with the cost of a zener vs optocouple.

Return to “Beginners”

Who is online

Users browsing this forum: Google [Bot] and 31 guests