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

How to create wireless doorbell

Fri Jan 03, 2014 3:05 pm

I'm trying to design a wireless doorbell system with the RPi using C++ for my senior design project. I plan to include the RPi camera and my smartphone in this project as well using Wi-Fi.

To do this, should I use two (2) RPi's or would a better approach be to use one (1) RPi and modify a store-bought wireless doorbell system?

I'm using C++ because I have a limited knowledge of Python. This is very urgent, so any and all help will be greatly appreciated. Thanks!

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to create wireless doorbell

Mon Jan 06, 2014 10:33 pm

Hi,
Phenom55 wrote:all help will be greatly appreciated.
My first reaction: it is total overkill to use RasPi in your scenario...

However... if you cannot think of anything else for your project, then you could add some features - for example, to make few snapshots when the doorbell is triggered and save these pictures. If nobody is at home (see below), then the pictures could be immediately sent on predefined email(s), else they could be just stored internally for a couple of weeks, for example.

So, you'd need one RasPi (connected to your home network) with a camera/webcam, a pushbutton and a buzzer (it is nice that the visitor hears "feedback"). If the buzzer noise is not enough also for you, then you could write an app for your smartphone to receive this signal (with picture). Else RasPi sends mentioned email notification when the mobile phone is not preset in the home network.
I think that this scenario adds some meat on bones and this could then be labelled as a project...


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

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

Re: How to create wireless doorbell

Sun Jan 19, 2014 4:47 am

I guess I probably should have explained the project in better detail.

What I want to have happen is when the doorbell is pressed it will send a notification to the android device. At that point the homeowner can either choose to ignore it or open and app that can activate the camera and a strip of LESs.

I can't figure out how to access individual GPIO pins from the buttons on the app so I think I may set up a webserver and add a widget in the app to load the webpage.

Another problem I'm having is the push notifications. I only have c++ knowledge so I'm trying to figure out an easy way to do it.

Please message me if you have any advice. Thanx!

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to create wireless doorbell

Sun Jan 19, 2014 2:48 pm

Hi,

My selection would be sockets.
Webserver-related solution is not optimal for cases when you expect quick reaciton initiated from any side (doorbel notificaton from RasPi and LEDs/cam control from Android) without overhead. I'm not saying that it is not possilbe to implement this on various ways, including via web server, but I see sockets usage here.

Network sockets are not something new, this is a set of mature techniques. Consequently, you can find a huge amount of related information and examples.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: How to create wireless doorbell

Mon Jan 20, 2014 1:00 am

Hi,

If the Pi camera is to be aimed at the door, then you must have a Pi at the door, so it makes sense for the Pi to be connected to the door bell push, and to transmit the data to either another Pi, or direct to a wireless network.

A Pi+Camera will require a permanent power supply - it won't run on batteries for a useful length of time.
This means (at least to me :) ) that you have lost the benefit of a store-bought wireless door bell system.

Perhaps you can explain what your plan is for the Camera.

Regards

anita2R

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 2:36 am

FLYFISH TECHNOLOGIES wrote:Hi,

My selection would be sockets.
Webserver-related solution is not optimal for cases when you expect quick reaciton initiated from any side (doorbel notificaton from RasPi and LEDs/cam control from Android) without overhead. I'm not saying that it is not possilbe to implement this on various ways, including via web server, but I see sockets usage here.

Network sockets are not something new, this is a set of mature techniques. Consequently, you can find a huge amount of related information and examples.


Best wishes, Ivan Zilic.
If I use network sockets, how would I go about controlling the RPi with buttons on my Android app? I'd like to have it so that if the doorbell is pressed (connected to an input pin) it will send a notification to my phone. I'd also like to be able to press a button on my phone and turn a set of LEDs on (connected to output pin). I'm not sure how to specify which I/O pin I'd like to use with sockets. Thanks!

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 2:43 am

anita2r wrote:Hi,

If the Pi camera is to be aimed at the door, then you must have a Pi at the door, so it makes sense for the Pi to be connected to the door bell push, and to transmit the data to either another Pi, or direct to a wireless network.

A Pi+Camera will require a permanent power supply - it won't run on batteries for a useful length of time.
This means (at least to me :) ) that you have lost the benefit of a store-bought wireless door bell system.

Perhaps you can explain what your plan is for the Camera.

Regards

anita2R
I'm not really concerned with having a permanent power supply. It's for my senior project at school, so once I demonstrate that it does what it's supposed to do I'll be satisfied.

I'm planning on having the camera and RPi inside an enclosure next to the door. I mentioned a store-bought wireless doorbell because I want to intercept the circuitry on the PCB and connect it to my RPi so that when the doorbell is pressed I can get the typical doorbell sound as well as an input signal to the RPi. This will prevent me from having to add another RPi to the project or having to involve radio signals.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: How to create wireless doorbell

Mon Jan 20, 2014 4:51 am

Hi,
I'm not really concerned with having a permanent power supply. It's for my senior project at school, so once I demonstrate that it does what it's supposed to do I'll be satisfied.
I am not happy with helping with something that 'does what it's supposed to do' when it isn't really 'fit for purpose'.
Why not plan to build something that would really work.

That aside, and I do like working on solutions\;
I'm planning on having the camera and RPi inside an enclosure next to the door. I mentioned a store-bought wireless doorbell because I want to intercept the circuitry on the PCB and connect it to my RPi so that when the doorbell is pressed I can get the typical doorbell sound as well as an input signal to the RPi. This will prevent me from having to add another RPi to the project or having to involve radio signals.
If the Pi is going to be next to the door what is the reason for having a wireless doorbell - surely not just for the sound of a bell.
The connection from the doorbell button to the Pi is a simple issue when the two devices are close together.
Making a sound from the Pi is also not a difficult issue.

So
will prevent me from having to add another RPi to the project or having to involve radio signals
does not make sense. You say that the Pi is next to the door, so no reason for another Pi or a radio signal - it's a directly wired connection. Wherever your Pi is, you either need a wired Ethernet connection from it to the internet or a WiFi connection to the internet so that you can communicate with the android device.

Does your plan involve using a wireless router - if so there is no need for a second Pi. The one near the door can connect directly to the router - either by a WiFi connection (a usb WiFi dongle on the Pi) or by Ethernet.

Regards

anita2R

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 5:29 am

anita2r wrote: If the Pi is going to be next to the door what is the reason for having a wireless doorbell - surely not just for the sound of a bell.
The connection from the doorbell button to the Pi is a simple issue when the two devices are close together.
Making a sound from the Pi is also not a difficult issue.
The project is to be built on top of a wireless doorbell system. I basically want to add a surveillance system on top of a doorbell system, and since the webcam will stream video wirelessly to my phone, my teacher mentioned I should try to make the entire project wireless.

When the bell is pressed two things will happen: (1) the doorbell chime will sound and (2) a signal will be sent to my Android phone letting the user know that someone is at the door (in case the homeowner is in a place within the home where the doorbell cannot be heard). At that point the homeowner can open an app that controls the camera outside the door and a strip of LEDs to improve visibility. I'm putting the camera, RPi and doorbell button all in the same enclosure for the sake of portability (taking the project to/from school). It's all going to be wirelessly connected through my home router.

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 11:24 am

Take a look at WEBIOPI

You don't need a wireless doorbell, since the Pi, with WiFi connection to smartphone is a wireless solution.
You could keep the wireless doorbell as a backup, so that a bell rings when your smartphone is off or not in range.

There is nothing wrong with main powered doorbells. Battery systems are easier to install, and a Pi's ~2W consumption (Model B) isn't ideal for a 'green' solution (standby power <1W is preferred), but it won't cost much to run. Take a look at this topic.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: How to create wireless doorbell

Mon Jan 20, 2014 1:26 pm

Hi,

To make the project look realistic, have two enclosures:
One for the doorbell button and wireless transmitter, and
a second one housing the doorbell receiver and the Pi with camera, usb WiFi and two gpios in use - one to monitor the doorbell receiver and the other to control a transistor to power the LED strip.

Regards

anita2R

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 3:16 pm

PiGraham wrote:Take a look at WEBIOPI

You don't need a wireless doorbell, since the Pi, with WiFi connection to smartphone is a wireless solution.
You could keep the wireless doorbell as a backup, so that a bell rings when your smartphone is off or not in range.

There is nothing wrong with main powered doorbells. Battery systems are easier to install, and a Pi's ~2W consumption (Model B) isn't ideal for a 'green' solution (standby power <1W is preferred), but it won't cost much to run. Take a look at this topic.
PiGraham,

I'll take a look at WebIOPi when I get some free time. If I create an app with a button to activate the lights, a button to activate the camera, and make it so that I receive a push notification when the doorbell is pressed would WebIOPi allow me to meet these requirements. I'd like to be able to control individual GPIO pins from the app, but I'm not sure how to do so with sockets.

Also, my instructors are not overly concerned with the Pi's power consumption so I figured the most important thing for me right now is to get it working and worry about performance later. I do think a wired doorbell would have been better, but my instructor asked me to keep everything wireless.

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 3:17 pm

anita2r wrote:Hi,

To make the project look realistic, have two enclosures:
One for the doorbell button and wireless transmitter, and
a second one housing the doorbell receiver and the Pi with camera, usb WiFi and two gpios in use - one to monitor the doorbell receiver and the other to control a transistor to power the LED strip.

Regards

anita2R
The doorbell receiver would be inside the house. I don't see why I'd want the Pi and camera inside the same enclosure as the receiver.

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 3:27 pm

Phenom55 wrote: PiGraham,

I'll take a look at WebIOPi when I get some free time. If I create an app with a button to activate the lights, a button to activate the camera, and make it so that I receive a push notification when the doorbell is pressed would WebIOPi allow me to meet these requirements. I'd like to be able to control individual GPIO pins from the app, but I'm not sure how to do so with sockets.
I think so.
Phenom55 wrote:Also, my instructors are not overly concerned with the Pi's power consumption so I figured the most important thing for me right now is to get it working and worry about performance later. I do think a wired doorbell would have been better, but my instructor asked me to keep everything wireless.
'Everything wireless'? I see no reason to go wireless from the bell push to the RasPi, since they must both be outside by the door.

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 3:38 pm

PiGraham wrote: 'Everything wireless'? I see no reason to go wireless from the bell push to the RasPi, since they must both be outside by the door.
Sorry. I should have clarified. I'm going to use intercept the circuitry from a store-bought wireless doorbell and add a wired connection to the Pi. That way I get the normal chime sound as well as an input signal to the PI.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: How to create wireless doorbell

Mon Jan 20, 2014 4:52 pm

Hi,

You said
The doorbell receiver would be inside the house. I don't see why I'd want the Pi and camera inside the same enclosure as the receiver.
Then you said
I'm going to use intercept the circuitry from a store-bought wireless doorbell and add a wired connection to the Pi.
So if the doorbell receiver is inside the house and the Pi/Camera are outside the house (and you said the Pi etc must be portable - to take to school),
how do you connect the doorbell receiver to the Pi.

I must be missing something here :? .

Are you planning on connecting the doorbell push button on the transmitter unit to the Pi by wire?

Regards

anita2R

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 4:57 pm

anita2r wrote:Are you planning on connecting the doorbell push button on the transmitter unit to the Pi by wire?
Yes that is exactly what I'm trying to do. I'm sorry I didn't make that clear before.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to create wireless doorbell

Mon Jan 20, 2014 5:26 pm

Hi,
Phenom55 wrote:If I use network sockets, how would I go about controlling the RPi with buttons on my Android app?
Socket is a "communication channel". You'd have your code on both sides and they are talking to each other via the socket. Therefore, your (C++) code on RasPi reacts on received command (packet, string, character - whatever you define) sent from your app on Android (where button click event has been triggered).
Phenom55 wrote:I'm not sure how to specify which I/O pin I'd like to use with sockets.
Let's say that your Android app has three butons. When first is touched, your Android app would sent character "1" (and "2" for second button, etc.) via the socket to your code running on RasPi (which is on the other side of the socket). When your code running on RasPi receives "1" via socket, it sets defined GPIO pin to a deserved state.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 5:33 pm

FLYFISH TECHNOLOGIES wrote: Let's say that your Android app has three butons. When first is touched, your Android app would sent character "1" (and "2" for second button, etc.) via the socket to your code running on RasPi (which is on the other side of the socket). When your code running on RasPi receives "1" via socket, it sets defined GPIO pin to a deserved state.
Thank you! I don't know why that was so hard for me to figure out. Do you know if there is a tutorial on the Internet of someone who has done something similar. I'm pretty confident I can figure it out on the Android side, but I'm not familiar enough with Python to set it up on my RPi.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to create wireless doorbell

Mon Jan 20, 2014 5:49 pm

Hi,
Phenom55 wrote:Do you know if there is a tutorial on the Internet of someone who has done something similar.
Google is your friend.
First hit for RasPi side: http://www.linuxhowtos.org/C_C++/socket.htm
First hit for Android side: http://examples.javacodegeeks.com/andro ... t-example/

Take just a server part for RasPi side and a client part for Android side.
Phenom55 wrote:but I'm not familiar enough with Python to set it up on my RPi.
Go with C++ (as mentioned in your initial message)...


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

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

Re: How to create wireless doorbell

Mon Jan 20, 2014 5:55 pm

Thank you again! I'll definitely give this a chance asap and let you know if I run into problems. You have no idea how much you have helped. :D

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

Re: How to create wireless doorbell

Mon Jan 27, 2014 10:49 pm

FLYFISH TECHNOLOGIES wrote: Take just a server part for RasPi side and a client part for Android side.
I'm having A LOT of trouble with this. I am using Mosync to create my app in C++. When you get a chance could you take a look and see if this will allow me to do what you have stated?

http://www.mosync.com/docs/sdk/cpp/guid ... index.html

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

Re: How to create wireless doorbell

Tue Oct 07, 2014 10:06 pm

hello im trying to do this project too could u find a solution?can u help me in details?

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

Re: How to create wireless doorbell

Thu Oct 09, 2014 3:34 am

srahmati wrote:hello im trying to do this project too could u find a solution?can u help me in details?
In my app I created I create a web view that automatically loaded webiopi. From there I could manipulate by input and output pins.

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

Re: How to create wireless doorbell

Thu Oct 09, 2014 7:53 pm

In my app I created I create a web view that automatically loaded webiopi. From there I could manipulate by input and output pins.[/quote]
Does the web includ image too?I mean with pressing the buttun do u send image too?I can't realize how do u notify Ur android?can u explain it?thanku

Return to “Other projects”