IoT Surveillance Camera With Port Forwarding

Surveillance Camera

Programming Languages / Tools Used


I developed an IoT Surveillance Camera system using a Raspberry Pi, designed to provide efficient and accessible surveillance capabilities. This system features a motion-activated infrared camera that records 10-second videos upon detecting movement, ensuring continuous monitoring even in low-light conditions. Each video is automatically saved with the current date and time for easy retrieval. Additionally, the implementation of a web server enables remote access to the live camera feed, offering users the convenience of real-time monitoring from any location.

Features and Functionality

  • Motion Detection:

    • Utilizes a PIR sensor connected to the Raspberry Pi’s GPIO ports to detect motion.
    • Triggers video recording upon motion detection, ensuring efficient monitoring.
  • Infrared Camera Recording:

    • Takes a 10-second video using an infrared camera, allowing for surveillance in low-light conditions.
    • Captures clear footage regardless of the time of day.
  • Date and Time Stamping:

    • Saves recorded video files in a folder named with the current date and time.
    • Facilitates easy access and organization of surveillance footage.
  • Remote Access via Web Server:

    • Implements a web server to enable remote access to the live feed of the camera.
    • Allows users to monitor the surveillance area from any location with internet access.

How It Works

  • PIR Sensor:

    • Detects motion in the surveillance area.
    • Triggers the camera to start recording when motion is detected.
  • Infrared Camera:

    • Captures 10-second video recordings upon motion detection.
    • Provides clear footage, even in low-light conditions.
  • Raspberry Pi:

    • Acts as the central processing unit, interfacing with the PIR sensor and camera.
    • Saves recorded videos with the current date and time for easy access.
    • Hosts the web server for remote access to the live camera feed.

Once motion is detected from the PIR sensor within the set parameters, the infrared camera takes a 10-second video. This integration ensures that only relevant activity is recorded, optimizing storage and review efficiency. The PIR sensor’s precise motion detection triggers the infrared camera to capture a brief but informative video clip, providing clear evidence of any movement.

The user will see the message “Motion detected” as well as how many times it has been detected. After that, the video will be written and saved to the designated folder with the date and time of the detected motion. This is easier for the user to go back and find the video they are looking for.

Through the use of port forwarding, we can view a live feed of the Raspberry Pi camera remotely, significantly enhancing the accessibility and functionality of the surveillance system. Port forwarding allows external devices to connect to the Raspberry Pi’s web server over the internet, enabling users to monitor the live camera feed from any location. 

With the use of the infrared camera, we are able to capture videos even in low light situations, ensuring continuous and effective surveillance regardless of the time of day or lighting conditions. The infrared technology allows the camera to detect and record clear footage in environments with minimal or no visible light, providing a significant advantage over standard cameras.

Future Improvements

  • Integrate cloud storage options for extended storage capabilities and data backup.
  • Allow users to receive alerts and view footage directly from their smartphones.
  • Add user authentication and access control to the web server.



The development of the IoT Surveillance Camera project using a Raspberry Pi has been an enlightening experience, merging hardware and software to create a practical security solution. By leveraging a PIR sensor for motion detection and an infrared camera for clear video recording, the system ensures reliable surveillance even in low-light conditions. The implementation of a web server for remote access enhances the usability of the system, allowing for real-time monitoring from any location. Looking ahead, there are numerous opportunities for improvement, such as advanced motion detection, enhanced storage management, and mobile app integration. These enhancements will not only increase the functionality and reliability of the surveillance system but also ensure it meets the evolving needs of users in various security applications. This project has significantly contributed to my understanding of IoT technologies and their potential in real-world scenarios.

Copyright © 2024 | Anish Patel

Scroll to Top