Using a Raspberry Pi, a Raspberry Pi camera, and an RPi GSM HAT board, the Elektor Lab team built a smart doorbell that captures a picture of a visitor the moment they press the button. The image is instantly sent via MMS to a smartphone, enabling you to see who’s at your door in real time.

The system also lets you call your doorbell. The GSM module answers automatically. After a ring, you can talk to a visitor through the built-in microphone and speaker. Additionally, you can send an SMS with a password to trigger an electric door opener. For extra security, the system verifies the sender’s mobile number to ensure the command originates from your smartphone.

The Circuit

Refer to the nearby diagram. At the heart of the circuit is an M95 GSM module MOD1 with antenna and SIM-card holder SIM1. The resistors (R15-R17), the diode array (D7), and the capacitors (C19-C22) serve as noise suppression and ESD protection for the SIM card interface.
The major parts in this circuit
The major parts in this circuit are the M95 GSM module and the SIM card holder.
“The same is true for capacitors C6 through C17 and D3 through D6 for the microphone input and the audio amplifier output of the M95, respectively,” noted Elektor engineer Luc Lemmens. “The M95 is connected to the Raspberry Pi (K5) via its USART, all communications are done using AT commands. Voltage divider R6/R7 adapts the TxD signal to the 3.3 V rated digital input level of the Raspberry Pi.”
 
The circuit board is mounted using standoffs
The circuit board is mounted using standoffs.

Doorbell Control

To control the doorbell, you must install the Python libraries in order to run the Python script. This can be found on the download page for the article as MMSautoSend.py. At the top of the script, there is a block of constant definitions:
 
  • ThisNumber: the mobile number of the SIM card for the M95
  • ThatNumber: the number of the smartphone to which the MMS-message is to be sent
  • Settings for using the MMS service of the provider of the SIM card for the GSM-module, specifically: APN: Access Point Name
  • MMSC: Multimedia Messaging Service Center
  • MMSproxy: Multimedia Messaging Service proxy server
  • MMSport: Multimedia Messaging Service port number

Installation and Setup

Lemmens recommended that the most ideal approach is to mount only the doorbell push button, camera, mic, and speaker outside and keep the remainder of the electronics inside.

“In the script, there are a few parameters to configure the camera, where specifically the orientation and brightness may have to be changed depending on the environment in which the camera will be installed,” he noted. “The resolution only affects the quality of the photo, keep this as low as possible so the size of the JPEG that is to be sent — and with that the time it takes to be transmitted — is within reasonable limits. While experimenting with these settings, it will be best if you turn off the sending of MMS messages in the script and only view the image file (test1.jpg) that is stored on the RPi to judge the quality.”
 
DIY smart doorbell
Smart doorbell: communicate with a visitor using your smartphone.

The Smart Doorbell Project

The original article, “Door Spy Using Raspberry Pi,’” appeared in Elektor November/December 2016. You can read the article for free during the two-week period following the publication of this post. If you start working on design of your own, please share your progress on the Elektor Labs platform!
Editor's Note: This article first appeared in a 2016 edition of Elektor. Given the project’s age, some components might not be available. However, we believe the circuit will make you smile and inspire you to start a creative project in the near future.

Subscribe
Tag alert: Subscribe to the tag Circuits & Circuit Design and you will receive an e-mail as soon as a new item about it is published on our website!