komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

how to trigger raspi by the doorbell

Mon Jun 26, 2017 11:19 pm

hi folks
i've made a script that capture a picture from the raspi camera when the gpio 4 turns to HIGH and then send me a mail with that picture as an attachment and i would love to use it with the doorbell at the gate of my house.
i don't know how to connect the actual bell button with the gpio of the raspberry (by the way i m using a raspberry pi zero w for that)... so... i guess there are 2 ways:
mechanical or electrical.
1. i can put a second small button behind the main bell button to be pushed together with that. quite difficult to do but i can try.
2. i can work with the wire of the doorbell (i guess it's a 12v) to make the current switch my gpio... but how? i need a sensor that turn HIGH when a current flows.



any ideas?
thanks

HardwareJon
Posts: 18
Joined: Sat Nov 22, 2014 7:34 pm

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 3:02 am

Hi,

There are a myriad of possibilities. However I think the easiest is to get a 12VAC relay and connect it in parallel with the door chime. Then use the contact(s) to trigger a gpio line.

I'm assuming your doorbell is 11 VAC like many. If not you would have to select the appropriate relay coil voltage.

I did a quick search in Digikey. They have a relay with a 12VAC coil for ~$7

Good luck

Jon


komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 8:09 am

maybe it would be more easy if i find some kind of really flat contact switch to put beneath the bell button

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 8:39 am

Hi komarek,

You can use or make a wireless doorbell by using an arduino and 2x hc12. One for the arduino and one for the rpi.

You can buy a wireless doorbell set and modify/connect the receiver with a gpio pin.
A de scription is available in the cloud. Use google to find it.

See http://thejumps.co.uk/2013/01/27/tweeting-doorbell/ for an idea.
Success with your project!
Ferdinand

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

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 9:03 am

If you have a conventional wired doorbell then check out https://www.instructables.com/id/Door-B ... re-Sensor/

Powering of the processing, detection etc is all integrated inside current enclosure. It detects a doorbell press, sends a notification via IFTTT and triggers a snap of my Pi powered Doorcam which I can remotely access.

Although this uses a ESP8266 module to do the processing it would be very easy to adapt the method to a Pi Zero W.

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

maybe i didn't explain very well

Tue Jun 27, 2017 9:46 am

i have a typical standard doorbell already installed.... what i m trying to do is to add the wireless controlled rpi to send me a picture from the front door when the doorbell is pressed.
and i actually i already did it all
the only part i need to make is the SWITCH of the process.... i mean to connect the bell pressure with tthe Rpi gpio so the script can begin

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 10:04 am

You can measure the current or voltage of the doorbell.

Measure the voltage accross the doorbell, use diodes to rectify it and use an optocoupler 4N33 to activate a gpio pin. If you press the doorbell to voltage is 0 v. If the doorbell is released the voltage is x V dc or ac.

A current sensor/resistor is also possible. When your press the bell a current is flowing and you can measure it. Is the doorbell swicth open no current has been detected.
Success with your project!
Ferdinand

HardwareJon
Posts: 18
Joined: Sat Nov 22, 2014 7:34 pm

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 3:15 pm

Hi komarek,

Yes such a relay would work. Did you check if you have an 11VAC doorbell system?

Good luck

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Tue Jun 27, 2017 9:21 pm

yes
my doorbell works with 12VAC

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

Re: how to trigger raspi by the doorbell

Wed Jun 28, 2017 10:56 am

As shown in the instructable schematic mentioned you can detect this with just a resistor / zener diode. That gives a 3.3V clipped 50/60 Hz square wave. This can be used to trigger interrupts on a GPIO pin and the software can filter this to give one activation per door bell push.

There is also plenty of power available in the 12V AC feed to recify, buck convert to 5V and power the pi.

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Thu Jun 29, 2017 1:22 pm

you know i've been searching all day but i cant find a 12VAC to 5V step down rectifier converter

pcmanbob
Posts: 6960
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: how to trigger raspi by the doorbell

Thu Jun 29, 2017 4:27 pm

Hi.

These are the only ones I could find several listings on ebay. http://www.ebay.co.uk/itm/L7805-AC-DC-D ... xy9dVTlWqb

not very powerful only 1A and not very efficient will produce a lot of heat.

you might be better of building a simple bridge rectifier circuit and then use one of these. http://www.ebay.co.uk/itm/Dual-USB-Outp ... SwnK9ZVNQy
or one of these ( but you will need to set this types output voltage before use using a meter.) http://www.ebay.co.uk/itm/LM2596-DC-DC- ... SwB-1YsGO2
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Thu Jun 29, 2017 4:32 pm

you're great

thank you

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Thu Jun 29, 2017 7:44 pm

I suppose your chime transformer is installed in your adjunction box (gas/power closet). So you may install a multiple socket in the box. 1 socket for your chime and 1 for a rpi power supply. Now it is very easy to make a board with a optical isolator/resistors/diodes or just a relay and connect it to one of the gpio pins of your pi.

You can also extend your chime wiring in existing power to tubes your room, but be very careful.
Success with your project!
Ferdinand

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 8:12 am

ok cool
but
is it not a problem the intensity of current i am driving to the Rpi gpio?

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 8:49 am

Read this post of jmgdesign for an idea:

http://www.avrfreaks.net/forum/sense-do ... ng-pressed
The current flowing in the gpio port is very low, it is about 500 micro Amps.

Instead of an opto-isolator you may use a relay proposed by HardwareJon.

Make a diagram and post it here.
Success with your project!
Ferdinand

User avatar
davidcoton
Posts: 4153
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 8:59 am

komarek wrote:is it not a problem the intensity of current i am driving to the Rpi gpio?
No, the GPIO current is almost zero. Use a 1K resistor in series with the GPIO input to make sure and add some safety (see below).

It is possible (but very unlikely, particularly with a Pi Zero W) that the 11VAC bell supply will not provide enough current to power the Pi (connected as in pcmanbob's post; via rectifier, capacitor, and switched mode voltage converter)
pcmanbob wrote: building a simple bridge rectifier circuit and then use one of these.
http://www.ebay.co.uk/itm/Dual-USB-Outp ... SwnK9ZVNQy
There is also a small risk that the Pi will crash when the bell is operated.

I would want to use a relay for the trigger input, rather than a diode, capacitor, and voltage divider. Remember that the voltage applied to the GPIO MUST NOT exceed 3V3 or go negative, if it does your Pi may be damaged.
Signature retired

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 9:15 am

davidcoton wrote: I would want to use a relay for the trigger input, rather than a diode, capacitor, and voltage divider. Remember that the voltage applied to the GPIO MUST NOT exceed 3V3 or go negative, if it does your Pi may be damaged.
this is what i meant:
i will try to send a signal with 2.5/3 V to the gpio (using a diode and a voltage divider circuit), but the current intensity will be the same as the bell... you're sure that this current won't be too high for the gpio so that there's a risk to damage the rpi?

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 10:39 am

komarek: what is max. the voltage across the cathode of your diode and ground/common?
Success with your project!
Ferdinand

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 10:48 am

Ferdinand wrote:komarek: what is max. the voltage across the cathode of your diode and ground/common?
sorry
but i didn't get the question

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 11:20 am

I am referring to your post of 11:15 am
i will try to send a signal with 2.5/3 V to the gpio (using a diode and a voltage divider circuit), but the current intensity will be the same as the bell... you're sure that this current won't be too high for the gpio so that there's a risk to damage the rpi?

I think this is your circuit

Code: Select all

..............a.diode.c............R1...........R2
chime contact 1 ---| >|-------/\/\/\/\/\----/\/\/\/\/\--- chime contact 2
............................A............C.............B
a is anode of the diode and c is the cathode
C is connection to a gpio pin.

What maximum voltage do you expect across A and B and can you calculate the resistors.

As you can see your circuit is in parallel with your chime. The current through the diode and chime are not the same.

I would not advise to make this circuit, because I am a worst case designer.
Success with your project!
Ferdinand

komarek
Posts: 146
Joined: Fri Mar 31, 2017 1:19 am

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 12:00 pm

yes... the circuit would look something like this one.
the voltage between A and B i guess it will be the 12V of the chime

User avatar
davidcoton
Posts: 4153
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 12:47 pm

komarek wrote:
davidcoton wrote: I would want to use a relay for the trigger input, rather than a diode, capacitor, and voltage divider. Remember that the voltage applied to the GPIO MUST NOT exceed 3V3 or go negative, if it does your Pi may be damaged.
this is what i meant:
i will try to send a signal with 2.5/3 V to the gpio (using a diode and a voltage divider circuit), but the current intensity will be the same as the bell... you're sure that this current won't be too high for the gpio so that there's a risk to damage the rpi?
No, the bell current MUST NOT try to flow through the GPIO (it won't, but the voltage will kill the Pi).
Your detection circuit MUST be in parallel with the bell and MUST ensure that the signal to the GPIO is 0V (bell off) or 3V3DC (bell on). You will also need a ground reference between bell and Pi.
If you do not understand what this is about, and the circuit design necessary to achieve it, STOP NOW and do not experiment. You are very likely to damage your Pi.

Using a relay will make the connection a lot safer (as long as you understand how it works and connect it correctly).

Whichever way you choose, make a diagram (there is good free software available for this) and post it here to be checked out before you experiment.
Signature retired

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: how to trigger raspi by the doorbell

Fri Jun 30, 2017 1:04 pm

A voltage of a transformer without load is ~ 15 V RMS. 12 V full load.
That means a top voltage of 15 V * 1.4 ~21 V max. You can measure this with a scope. The voltage across A and B is 21 V minus the voltage drop of your diode. If R2 is 1K ohm than R1 must be 6K ohm.
The voltage on C is ~ 3 V.

This is the case when a transformer is unloaded or a defective chime.

If the chime rings the voltage on C varies from ~3 V to ~2.5. Use a scope to watch to measure the pattern of your voltage/signal.

Your gpio pin is not yet protected, so you have to use zener diodes or just a couple of diodes to protect your gpio pin from overvoltage in case of defective parts.

That why I advise you to use opto isolators other forum members will use a relay. Of course you have to protect you isolator with diodes too.
The collector of isolator must have a resistor of 1 K ohm connected to 3.3 V. The collector must be connected to a gpio pin. See my previous post (pdf file) for a starting point.

And davidcoton is right about a diagram.
Success with your project!
Ferdinand

Return to “General discussion”