Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Raspberry Pi-based digital door peekhole

By Nikhil Agnihotri September 12, 2021

Raspberry Pi based digital door peekhole

Demonstration of Raspberry Pi based digital door peekhole

A peephole, spyhole, or peekhole is a small opening through the door that allows viewing from inside to outside. Such door holes allow seeing outside the door without opening it. Usually, these door holes have a fisheye lens to have a wider look of the outside. In this project, we have developed a digital version of the peekhole with the help of a Raspberry Pi camera and a Raspberry Pi board. The first apparent advantage of a digital peekhole is that it can be easily concealed in a door design compared to conventional peekholes. Secondly, a camera-based peekhole gives a 180˚ view of the outside. A programmatically sophisticated version of the same peekhole can provide features like visitor identification (through face detection), logging unidentified visitors, and playing pre-recorded voice messages to specific visitors.

The device designed in this project uses a Raspberry Pi camera, Raspberry Pi board, a PIR sensor, and a small LCD screen with HDMI input. It can be easily integrated into any door and easily concealed in a door design. The prototype demonstrated here is developed on Raspberry Pi 3. This project’s commercial or hobby version can be developed using Raspberry Pi Zero to make the design compact. Once installed in a door design, the whole device can be powered with the help of a 5V 2A adaptor.

Components required

  1. Raspberry Pi 2/3/4 or Raspberry Pi Zero x1
  2. Raspberry Pi Camera x1
  3. Ribbon Cable for connecting Raspberry Pi camera x1
  4. PIR Sensor x1
  5. 5″ HDMI LCD
  6. Connecting wires/Jumper wires for testing prototype on a breadboard

Circuit connections
While testing the project, you can interface the Raspberry Pi with a desktop display. Connect a small HDMI LCD to the Raspberry Pi’s HDMI port. Connect the Raspberry Pi camera to the CSI port of the board.

Demonstration of Raspberry Pi-based Attaching Raspberry Pi camera to CSI port door peekhole

For interfacing the PIR sensor with Raspberry Pi, connect the input pin of the PIR sensor to any GPIO. Here board pin 7 is connected to the input pin of the PIR sensor. Connect the VCC and GND pins of the PIR sensor with the Raspberry Pi’s 3.3V out and ground pins.

PIR sensor

It should be noted that the sensitivity of the PIR sensor needs to be adjusted to get the proper digital input. The PIR sensor is calibrated to provide defined output during program testing.

Python code

How the project works
The Raspberry Pi camera and the PIR sensor are installed at the front of the door. The Raspberry Pi itself is installed at the rear of the door. The door has a small horizontal cut to pass through the ribbon cable of the Raspberry Pi camera. The entire circuit is powered at the rear of the door with the help of a power bank or DC adaptor. A 5-inch LCD is connected with the Raspberry Pi at the rear of the door.

The user can run the python script as the device is powered on and Raspberry Pi boots up. The python script can be made to launch on the startup automatically. As the python script runs, it starts a preview of the outside on the LCD. For testing the preview, Raspberry Pi can also be connected to a desktop display with HDMI input. The preview continues without interruption throughout the script execution. After launching a preview, the Raspberry Pi continuously checks for the digital signal from the PIR sensor. Here the PIR sensor is calibrated to give an output of digital HIGH as it detects any motion outside the door. As it detects any motion, the Raspberry Pi camera captures the outside image and stores it with a file name having an ascending number.

The code
The python script begins with importing PiCamera class from the PiCamera library and RPi.GPIO class from GPIO library. If the PiCamera library is not installed, it must be installed using pip or installed manually. Similarly, time class is imported from the sleep library. The GPIO is set to board numbering, and board pin 7 is assigned to input from the PIR sensor. Variables to hold image number, image name, and image URL are declared. The GPIO.setwarning() is set to false.

An object of camera class is instantiated using the Picamera() method. The PIR sensor pin is set as a digital input. The camera preview is started using the start_preview() method. A delay of 5 seconds is provided after starting the preview. This helps to stabilize the camera to ambient light and exposure.

An infinite loop is run to capture images of any movement outside the door. If the PIR sensor detects any motion, it gives an output of logical HIGH. If the output of the PIR sensor is HIGH, the image number is increased by 1 and is concatenated to string “image” in variable ‘imagename’.  The image name is appended to a file path in variable ‘pathname’. The image of the outside is captured with the updated file location using the capture() method. The new image name is logged to the console using the print() function. A delay of 5 seconds is provided after an image has been captured.

Demonstration
The following images and video are of the testing of the device using a desktop display. Note that how the device captures the image of the outside on detecting every movement.

Testing Raspberry Pi based digital door peekhole

Demonstration of Raspberry Pi based digital door peekhole

Demonstration video

You may also like:


  • What types of motors are used in electric vehicles?

  • Intruder detection with Raspberry Pi using camera

  • Raspberry Pi-based smart home security system

  • Top 11 applications of Raspberry Pi

  • EmonPi- a Raspberry Pi-based energy meter

  • Raspberry Pi Based Digital Frame

Filed Under: Electronic Projects, Microcontrollers, Raspberry pi, Sensors, Tutorials, Video
Tagged With: Raspberry Pi, raspberry pi 5 inch lcd, raspberry pi camera, raspberry pi digital door peekhole, Raspberry pi graphic lcd, raspberry pi PIR sensor, raspberry pi project, raspberry pi projects
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe