Door bell with pi camera and motion detection

Hi, thanks for the interesting thread. I read most of it now :slight_smile: . I am planning on also building a raspberry pi doorbell.
I was reading about to two-way audio:

Maybe this would be an option?
https://www.linux-projects.org/uv4l/

This should in principle allow for in-browser calls to the raspi using webRTC. I have not tested it yet though. Did somebody use this already?

Found a good example of the design I want to achieve, with the camera behind the peephole. Will need to get the optics right for this approach. Luckily I have Zemax at work :slight_smile:

https://www.amazon.com/dp/B01JUKY89O/ref=olp_product_details?_encoding=UTF8&me=

The camera box is mounted on a metal o-ring. Full specs online

image

I am thinking of putting a pi camera with a speaker, mic and pushbutton in a box and mounting to the outside of the spyhole (remove the existing glass spy tube) , feeding a multicore cable from these through the hole and connecting to a PI on the inside of the door. That way I can feed power and CAT cable to the router direct.

The cable would traverse the door to the hinges and with a loop would allow the door to open / close without damaging/stressing the cable.

Thoughts…

In my case I want the front door to appear identical before and after installing the camera. The raspberry pi camera module is connected to its board using a standard connector. Therefore by putting the appropriate cable between the camera and board you could easily just have the tiny camera module on the outside, sitting within a purpose built mount. Re speakers these also could be on the inside, just crank up the volume

At the risk of adding more complexity to things, could this help with the audio side of things:

If I’m reading it correctly, one could connect a small low power speaker directly to it (something like https://www.modmypi.com/raspberry-pi/audio-dacampdigi/speakers-1049/speaker-3-diameter-8-ohm-1-watt or https://shop.pimoroni.com/products/speaker-pcb-mount) and have all the audio I/O you need. It even has a programmable button which presumably could be your bell button…

Edit: Actually, this speaker looks better for something outside:
https://uk.rs-online.com/mobile/p/family-id/7903984/

1 Like

Thats a nice product. Not considered adding audio myself but definitely would be a nice to have.
Cheers

This is exactly the case design I’ve been looking for. I can pass power through the wall but I need everything else on the outside. Are you going to share the case design for printing? please please :slight_smile:

Hi guys,

Wouldnt this be an option:

Awakingdemi 3.5 inch LCD Peephole Viewer

Remove the screen use the cameramodule?

If you could interface with the camera. Can’t tell from the picture what the ribbon is

i’m in a similar situation, wanting to integrate this camera into an mqtt one:

1 Like

Hi @robmarkcole / @meganoodle

Just wondered if you guys are still tinkering with your doorbell projects and if you have made any break through’s since your last updates?

I’ve start looking at options to build my own smart doorbell, I’m quite keen on the Ring doorbells in terms of functionality, but don’t fancy the cloud hosting fee. There are other off the shelf products, almost identical but backup to an SD card: Akaso Doorbell

What I would prefer is to be able to backup to an internal NAS storage, so I quite fancy having a go at build my own. Plus I have a couple of Pi Zero’s and Redbear wifi hats lying around and though it could be a good project.

What I’m looking to achieve is:

  • Button Press Doorbell (mqtt trigger sent to HASS)
  • Motion detection with ability to define a detection area (mqtt trigger sent to HASS)
  • Alert using push bullet with photo still (I already use this in HASS)
  • Face recognition (send still to HASS via MQTT)
  • 2 Way audio to android phone or browser
  • Stream video to phone or browser
  • Record video stream on NASS

I’ve ordered a night vision camera for my pi zero, but as far as everything else is concerned I haven’t really got any further, just researching possible options.

In terms of facial recognition, did you make any break through’s?

Did you try using HASs with OpenCV or other to manage the recognition processing?

TIA

Andy

Hi Andy @mcinnes01, you can see my development HA instance details here, and I’m working on image classification here. For facial recognition checkout the existing ‘identify’ components from dlib/microsoft. I am still waiting for the issue with pi cameras on HASSIO to be solved before I invest more time on the hardware side (I want a full HASSIO solution). However you sound interested enough to push the hardware side along some?
Cheers
Robin

Hi Andy
I havent made anymore progress with my project, our house is currently up for sale despite the desire to tinker some more I cant really make many more adjustments with the project so it is still pretty basic.

However, I have set up a raspberry pi zero in my porch window with motioneye , when it detects motion it triggers the porch motion sensor in my HASSIO which in turn notifies my phone via telegram with a picture.

I have also setup a nodemcu with a 433mzh reciever to detect my doorbell being pressed , which also triggers home assistant to send me a snapshot of the porch via telegram.

That is as much as I am able to do until we sell the house and move into a new canvas to play with.

If there is any aspect of my current setup you would like more information on please dont hesitate to ask.

2 Likes

Hi @meganoodle

I’ve also stumbled across motioneye in the last week and have it on a pi Zero, are you using motioneye directly or motioneyeos? I’ve currently got motioneyeos on the pi Zero, but it seems very unstable and requires a manual restart quite regularly.

Did you find any stability issues and are there any particular settings you managed to configure to improve it?

I managed to get motion events on the pi, and the video, the video didn’t seem to have particularly good frame rate despite various tweaks I tried.

I’m currently looking if I can run the pi zero as cam and have motioneyeos on a pi3 to take some load off the zero.

Thanks

Andy

Hi Andy
My pi zero’s use motioneye OS , they seem to run fairly stable.
the settings i use are as follows from the top:

General settings :
Advanced settings : ON

Settings under Network are obvious

Services:
All off

Video device:
Automatic brightness off
Brightness: 50%
Contrast: 50%
Saturation : 50%
Resolution: 640 x 480
Frame rate: 10

Text overlay:
I left as default

Video Streaming:
Frame Rate: 10
Quality : 50%

Expert settings:
Only two parameters I change are
Fast Network Camera : OFF
Camera LED: OFF

Still images:
All default except
capture mode: Motion triggered (One Picture)
preserve pictures : for 1 week

Movies:
Movie quality: 75%
Recording mode: Motion Triggered
Max Movie Length: 30 seconds
Preserve: for one week

Motion Detection:
Frame change threshold: 1.4%
auto noise detection: OFF
Noise Level : 12%
Light switch detection: Outside 0% : Inside 25%
despeckle filter: OFF

Motion Gap: 10
Captured Before: 0
Captured After: 100
minimum motion frames : 10

Mask : OFF

Show frame changes : ON (FPS goes down but I find it tolerable)
Create Debug Media Files: OFF

Motion Notifications:
Run a command: ON
Command:
curl -X POST -H “x-ha-access: #####” \ -H “Content-Type: application/json” \ -d ‘{“state”: “on”, “attributes”: {“friendly_name”: “frontcam”}}’ \ http://myaddress.duckdns.org:8123/api/states/binary_sensor.frontcam

Run an End Command: ON
Command: curl -X POST -H “x-ha-access: #####” \ -H “Content-Type: application/json” \ -d ‘{“state”: “off”, “attributes”: {“friendly_name”: “frontcam”}}’ \ http://myaddress.duckdns.org:8123/api/states/binary_sensor.frontcam

1 Like

Hi Andy,

I’m quite new to HA, but I have implemented a solution that matches your requirements.

My solution is based on the doorpi project and I have been using it for two months now.

I run a Raspberry Pi 3 with a piface add-on board for connecting the doorbell button, switch on/off audio, nextion 3,2 inch display and IR LEDs (for night view). The camera is a pi noir camera equipped with a fish eye lense.

Motion detection is done via the software solution “motion”, video streaming via mjpeg_streamer, the main doorpi software manages events and establishes the SIP call.

When motion is detected, the LED lighting of the button and the Nextion are being switched on for one minute.

If a visitor uses the button, a pushbullet message including a snapshot is being sent.

I experimented with Google Cloud Vision to detect parcel services, but this is not so easy. The response times are acceptable, but the results are not reliable. Additionally, you always have to think of the legal requirements depending on where you live.

My SIP server is a Fritzbox (built in support for SIP), my client is a Fritzfon C5, but can be any other SIP client. Should also work with Asterisk as SIP server.

All status updates are being sent to HA via MQTT.

I have also built in a convenience feature to play a standard message “Coming to the door” when I cannot answer the call on the Fritzfon. This message can be played using an Alexa routine anywhere in the house.

The main obstacles for production readiness were:

a) Making the doorpi weather proof (rain, heat, cold, insects(!))
b) Secure the home network (cut lan connection on sabotage detection)
c) Echo cancellation, this is a serious problem that you have to address in one way or another. I’m using pulseaudio, additionally I rely on the capabilities of the Fritzfon. Don’t underestimate that problem.

EDIT: I tuned the rpi 3 for low power consumption, switching off everything I do not need and using a fixed cpu clock of 600 MHz. That should also help with any potential heat problem. The idle power consumption is about 2 watts, when audio, IR LED and nextion are activated, it will go up to about 7 watts.

With the motion detection running all the time, the CPU utilization is about 15%. The still images of the last 3 visitors are accessible through the doorpi webserver.

2 Likes

may I know how?

1 Like

Hi! @meganoodle and @robmarkcole are you okay?

What is the current status of your doorbell projects with Raspberry Pi?

I’m currently playing with a similar project and I still haven’t managed to communicate through the cell phone and a speaker connected to the raspberry pi

I think there are a number of projects doing this with RPi, you could also check Hacksterio

you can follow this project:

when will be available, you can buy a cheap SIP doorbell (like Dahua, Hikvision or Akuvox ) and use it from a lovelace card
a few pros of a ready made doorbell vs DIY are:

  • echo cancelation

  • high grade Audio & Video with nightvision

  • cloud app for push notifications

  • integration with NVR/DVR for advanced deployment

  • weather proof solution for external installation

1 Like