Project showcase
Virtual Peephole

Virtual Peephole © GPL3+

Spy on cameras around the world.

  • 11,490 views
  • 8 comments
  • 32 respects

Components and supplies

Necessary tools and machines

About this project

Virtual peephole demo

There are an estimated 770 million surveillance cameras around the world. Some of them still have their default password, making them easily accessible, by anyone who has an internet connection.

This virtual peephole is a device to watch some of those unsecured cameras. Each time the peephole is opened, a different camera is shown.

This project was made with a Raspberry Pi (with a small screen) and an Arduino Micro. The Raspberry Pi is connected to internet and displays a website, that shows one random camera feed.

There is a light sensor inside the peephole, to detect if it is open or closed. Whenever the peephole is closed, a signal is sent to the Raspberry Pi (via the Arduino Micro), and the website switches to another camera feed.

The camera data I used for this project was scraped from Insecam, a website that registers over 73,000 unsecured cameras.

Work in progress (1/2)
Work in progress (2/2)

Code

Light variation detection + Keyboard signal Arduino
This code detects a light variation in the photocell and sends out a keyboard signal.
long previousMillis = 0;
long calibrationtime = 5000;
long startMillis = 0;
int sensorMin = 1024;
int sensorMax = 0;
int average = 0;
int threshold = 5;
bool lastState = true;
bool isClosed = true;

#include "Keyboard.h"

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("setup");
  Keyboard.begin();
  startMillis = millis();
}

void loop() {
  unsigned long currentMillis = millis();
  int sensorValue = analogRead(A0);
  //Serial.println(sensorValue);

  if(currentMillis-startMillis < calibrationtime) {
    // save the last time you blinked the LED 
    // print out the value you read:
    int elapsedtime = currentMillis - startMillis;
    Serial.println(elapsedtime);
    Serial.println(sensorMin);
    Serial.println(sensorMax);
    if(sensorValue < sensorMin){
      sensorMin = sensorValue;
      average = (sensorMin + sensorMax )/2;
    }
    if(sensorValue > sensorMax){
      sensorMax = sensorValue;
      average = (sensorMin + sensorMax )/2;
    }
    delay(100); 
  }
  else{
    if(sensorValue > average + threshold){
      isClosed = false;
      if(lastState != isClosed){
        }
    }
    else{
      isClosed = true;
      if(lastState != isClosed){
        Keyboard.print(" ");
        }
    }
    lastState = isClosed;
    delay(100);
   }
 
  //stabilize the reading in the first 3 seconds
  //then, detect a variation in the stabilization. 
  //also provide a reset button just in case.
  
}
Virtual Peephole website source code
This is the website that is displayed in the virtual peephole. Use the spacebar to navigate through webcams.

Schematics

Photocell diagram
This is a simple photocell diagram.
insecam_VDr7XfXF6m.fzz
Photocell diagram
Capture decran 2020 02 07 a 10 33 04 tqjgbafah9

Comments

Similar projects you might like

AmeQuest

Project showcase by Doc Martens and user7773027744

  • 2,365 views
  • 0 comments
  • 6 respects

SmartQ Notification with Azure IOT Hub and Virtual Shields

Project showcase by vincent wong

  • 2,439 views
  • 0 comments
  • 6 respects

Globe Trotter

Project showcase by carolinebuttet

  • 10,771 views
  • 12 comments
  • 54 respects

Indoor Golf Setup Using Arduino and Pi: Virtual Moving Floor

Project in progress by High Voltages

  • 3,423 views
  • 6 comments
  • 19 respects

Android Things Word Clock

Project tutorial by Daniele Bonaldo

  • 26,429 views
  • 8 comments
  • 137 respects

USBcycle: Ride Through Your Virtual World!

Project showcase by Tazling

  • 14,536 views
  • 23 comments
  • 24 respects
Add projectSign up / Login