Project showcase
Virtual Peephole

Virtual Peephole © GPL3+

Spy on cameras around the world.

  • 7,725 views
  • 2 comments
  • 21 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.
  
}

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 user7773027744 and Doc Martens

  • 2,416 views
  • 0 comments
  • 6 respects

SmartQ Notification with Azure IOT Hub and Virtual Shields

Project showcase by vincent wong

  • 1,846 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,464 views
  • 6 comments
  • 19 respects

Android Things Word Clock

Project tutorial by Daniele Bonaldo

  • 26,512 views
  • 8 comments
  • 137 respects

USBcycle: Ride Through Your Virtual World!

Project showcase by Tazling

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