Beowolf
Posts: 4
Joined: Thu Oct 18, 2012 1:21 pm

Doorbell --> pi --> phone

Thu Oct 18, 2012 1:51 pm

I've had my pi for a while, but not done anything with it other than xbmc. I thought it was time it did something vaguely clever, and so thought it could let me know when someone was at the door.

I can't hear when someone knocks if I'm outside or upstairs, so I thought a cheap wireless doorbell, the pi, and something to link it together would be a good project.

So far, I've got it working - I just get lots of false positives when the circuit triggers for no apparent reason. I can blow on the wires, and it'll trigger the pi to send me a message.

This is my circuit:
https://www.circuitlab.com/circuit/qcd3ff/bell/

Image

The 3.3v and ground are from the pi, and the wire labled 'pi' is GPIO 1 (pin 12)

The doorbell is normally powered by two 1.5v batteries. I've used the 3.3v and ground from the pi instead. For the signal I've taken a wire from it that is 0v when off, and 1.2v when the bell is rung.

This works. Ring the bell and the led lights, the pin goes low, and 5 seconds later my phone rings.

However, it'll also do that if I touch the wires leading to the doorbell. Or if I blow on them!

What's the cause of this? How do I fix it?

Sorry if that's all a bit wordy. I've tried to be clear, but this isn't my area of expertise!

(Tasker and AutoRemote on the phone handle the notifications - the pi just needs to run wget when the pin goes low)

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 2:19 pm

you could've just stuck a makey makey in there and waited for a 'key press' in a shell script and then trigger a text to your phone using a wget on a url as described at http://www.text4free.net/personaltool.php
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 2:27 pm

The transistor you are using is very high gain.
http://www.datasheetcatalog.org/datashe ... s/8854.pdf

Typical hFE - 450. It might be sensitive enough to be tripped by radio 4. (Probably not, gross exaggeration but it's a high gain "signal transistor" I think )

What happens if you take the transistor Q1 out and just switch closed that part of the circuit manually?

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 3:33 pm

Have a read of this thread as well http://www.raspberrypi.org/phpBB3/viewt ... =37&t=9770

Some of it might be pertinent - especially the bit about having long wires (I assume you have long wires from your doorbell to the Pi)

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13009
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 3:43 pm

In your schematic if you do not push the button the base of the transistor in essence simply "floats", that is it's not connected to anything, and as the previous poster said the transistor has a current amplification of several hundred times, so even the tiniest current flowing into the base amplified causes a tiny current to flow through the LED, and for tiny currents the LED has a relatively high resistance, much more than the 470 ohm series resistance. Directly connecting 1V2 to the GPIO won't be registered as high, so taking out the transistor won't work.
The solution is to connect a resistor between the base and the ground, so that the tiniest current flow to ground instead of into the base of the transistor. This resistor forms a resistor divider with the 8K2 resistor, so it must be at least as large to divide to something less than by two (1.2 /2 = 0.6V) I would use 15K.
Then to get a real pullup so that the GPIO pin goes to 3V3 not 3V3 minus the LED voltage, tie another resistor from the GPIO to 3V3 (or over the LED will work as well).

Beowolf
Posts: 4
Joined: Thu Oct 18, 2012 1:21 pm

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 4:26 pm

SN: Do you mean a momentary switch wired directly into the pi? It would be simpler, but I don't want to run wires through a few rooms and a hole in the doorframe.

morphy_richards : You aren't far out when you say it would get tripped by radio 4! I tried running the signal from the bell directly to the pi first, but the voltage isn't enough to register on the pi as high or low.

What counts as long wires? The doorbell button is a wireless one. The switch part I've connected the pi to is the reciever. The wires are maybe 20 cm or so.

mahjongg: That's helped a lot. I didn't have a 15k resistor, so I've used two 10k in series. Is that close enough to 'at least twice as large'?

The LED in the circuit was only there so I could more easily see what's going on. I've taken it out.

I also remember reading that the pin below the 3v3 one was tied to it by a resistor, so is already pulled high. I'm now using that pin to read the doorbell press.

All together, it's more stable. I can no longer turn it on by blowing on it. However, I can still touch the ground wire to the bell or the signal from the bell and turn it on.

Is this a limitation of the transistor I'm using? It's all I have at the moment, but if there's a better one for the job...

Image

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13009
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Doorbell --> pi --> phone

Thu Oct 18, 2012 11:20 pm

Most transistors would have a HFE that is in the hundreds of times region, in fact the BC547 is more or less the standard transistor for such a job. Not sure why touching the ground wire is causing triggering, it suggest the ground connection is bad. The built in pullup for the UART in the PI are a bit weak, I would suggest using another 10K as a better pullup, to 3V3.
2X10K is a bit much, as slightly more than 8K2 would have been enough, so a single 10K from the base to GND should do the trick too. Also a 100nF capacitor over that 10K resistor would also help to make the circuit more stable.

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Doorbell --> pi --> phone

Fri Oct 19, 2012 7:52 pm

Beowolf wrote:SN: Do you mean a momentary switch wired directly into the pi? It would be simpler, but I don't want to run wires through a few rooms and a hole in the doorframe.
No just that its would solve your detection flakiness - the makeymakey just plugs in USB of PI and pretends to all intents and purposes to be a keyboard.

Oh and thanks for the AutoRemote / Tasker tip - paid my few quid and have both running on both my android devices now - time for some fun!
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

Beowolf
Posts: 4
Joined: Thu Oct 18, 2012 1:21 pm

Re: Doorbell --> pi --> phone

Sat Oct 20, 2012 11:29 am

I have no idea what's just happened.

The doorbell is now outputting 1.2 volts constantly, dropping to 0.6 when rung. 0.6 is enough for a low on the pi, so no electronics of any kind are now needed.

I can't have just made a poor reading earlier, as I've spent a few days with it 'working' as described above.

Totally flummoxed.

Not a waste of time though, as I know a bit more about transistors than I did, and I now know what a voltage divider is.

Still flummoxed though.

Thanks for the help.

Now to get tasker reliably upping the volume before playing the doorbell sound, and then dropping it back to the default after.

Phenom55
Posts: 43
Joined: Fri Jan 03, 2014 2:54 pm

Re: Doorbell --> pi --> phone

Sat Jan 18, 2014 11:27 pm

How were you able to send a signal to your phone when the doorbell was pressed? I am working on a similar project and I'm not sure if I should create an app using websockets (difficult) or using a web server like webiopi and accessing that web page from my phone,

txt3rob
Posts: 365
Joined: Sat Aug 11, 2012 3:45 pm
Contact: Website

Re: Doorbell --> pi --> phone

Mon Jan 20, 2014 9:19 am

if you need sms my pi offers it for free

Code: Select all

curl --data "to=077123456789&message=YOUR MESSAGE&hash=ENTERYOURHASH" http://www.smspi.co.uk/send/
just sign up get your hash and replace the bits above and then put it part as your script.
The Raspberry Pi Hell Guy - Random Ramblings to assist me and others.
http://raspberrypihell.blogspot.com
My Github - http:/www.github.com/random-robbie/
http://www.smspi.co.uk - send free uk sms via your raspberry pi from here

Phenom55
Posts: 43
Joined: Fri Jan 03, 2014 2:54 pm

Re: Doorbell --> pi --> phone

Mon Jan 20, 2014 3:26 pm

txt3rob wrote:if you need sms my pi offers it for free

Code: Select all

curl --data "to=077123456789&message=YOUR MESSAGE&hash=ENTERYOURHASH" http://www.smspi.co.uk/send/
just sign up get your hash and replace the bits above and then put it part as your script.
Sorry but I'm a noob at this. Could you explain this in greater detail, perhaps with a step-by-step instruction?

srahmati
Posts: 26
Joined: Sat Oct 04, 2014 6:40 pm

Re: Doorbell --> pi --> phone

Wed Oct 08, 2014 6:23 pm

Phenom55 wrote:How were you able to send a signal to your phone when the doorbell was pressed? I am working on a similar project and I'm not sure if I should create an app using websockets (difficult) or using a web server like webiopi and accessing that web page from my phone,
I have the same problem I want to know if u could do this project thanku

Phenom55
Posts: 43
Joined: Fri Jan 03, 2014 2:54 pm

Re: Doorbell --> pi --> phone

Thu Oct 09, 2014 3:31 am

srahmati wrote:
Phenom55 wrote:How were you able to send a signal to your phone when the doorbell was pressed? I am working on a similar project and I'm not sure if I should create an app using websockets (difficult) or using a web server like webiopi and accessing that web page from my phone,
I have the same problem I want to know if u could do this project thanku
I just used webiopi. It was very easy to set up and worked well on my home network.

srahmati
Posts: 26
Joined: Sat Oct 04, 2014 6:40 pm

Re: Doorbell --> pi --> phone

Thu Oct 09, 2014 7:38 pm

I just used webiopi. It was very easy to set up and worked well on my home network.[/quote]
And how u can notify Ur android?can u please note what exactly do with instructions?thank u so much

Return to “Automation, sensing and robotics”