Video call with a Raspberry Pi and Google Duo
Use Google Duo and a Raspberry Pi to build a video doorbell for your home so you can always be there to answer your door, even when you’re not actually there to answer your door.
“Martin Mander builds a good build,” I reply to Liz Upton as she shares this project, Martin’s latest one, with me on Slack. We’re pretty familiar with his work here at Raspberry Pi! Previously, we’ve shared his Google AIY retrofit intercom, upcycled 1970s TV with built-in Raspberry Pi TV HAT, and Batinator. We love the extra step that Martin always takes to ensure the final result of each project is clean-cut and gorgeous-looking, with not even a hint of hot glue in sight.
Raspberry Pi video doorbell
“I’ve always fancied making a video doorbell using a Raspberry Pi,” explains Martin in the introduction to his project on Hackster.io. “[B]ut until recently I couldn’t find an easy way to make video calls that would both work in a project and be straightforward for others to recreate.”
By ‘recently’, he means February of this year, when Google released their Duo video chat application for web browsers.
With a Raspberry Pi 3B+ and a webcam in hand, Martin tested the new release, and lo and behold, he was able to video-call his wife with relative ease via Chromium, Raspbian‘s default browser.
“The webcam I tested had a built-in microphone, and even on the first thrown-together test call, the quality was great. This was a very exciting moment, unlocking the potential of the video doorbell project as well as many other possibilities.”
By accident, Martin also discovered that you can run Google Duo out of the browser, even on the Raspberry Pi. This allowed him to strip away all the unnecessary “Chromium furniture”.
But, if this was to be a video doorbell, how was he to tell the Raspberry Pi to call his mobile phone when the doorbell was activated?
“If Duo were a full app, then command line options might be available, for example to launch the app and immediately call a specific contact. In the absence of this (for now?) I needed to find a way to automatically start a call with a GPIO button press.”
To accomplish this, Martin decided to use PyUserInput, a community-built cross-platform module for Python. “The idea was to set up a script to wait for a button press, then move the mouse to the Contacts textbox, type the name of the contact, press Enter and click Video Call“, Martin explains. And after some trial and error — and calls to the wrong person — his project was a working success.
To complete the build, Martin fitted the doorbell components into a 1980s intercom (see his previous intercom build), wired them through to a base unit inside the home, and then housed it all within an old Sony cassette player.
The final result? A functional video doorbell that is both gorgeous and practical. You can find out more about the project on the Hackster.io project page.
4 comments
Dr Brian Ray
Interesting! I find that examining why the author has made a particular design decision, fascinating. In this case, why use a webcam rather than the Rasp Pi’s own camera? Has it better resolution or low light ability. Is it more immune to sunlight damage? Is it because the author had the webcam in his junk box?
I suggest that most “makers” would be inspired by the ideas which are presented rather than following a BoM (which many maker’s publish on a variety of sites on the Web). This is plea for more discussion of the background to the design decisions. Thanks.
Kiro Velkovski
I suspect that it’s easier to use the microphone from the USB camera :)
François Roland
I canrun duo on chromium browser, but “install duo” is not available in chromium nenu between FIND and MORE TOOLS
what could be the problem?
Lee Melbourne
What does “run Google Duo out of the browser” mean?
I have tried a similar approach using Jitsi, but the time it takes to open Chrome each time on the RPi was annoyingly long. So being able to kick it off without all the Chrome overhead is important.