Porch Pirate

Made a hella simple PIR triggered camera with a pi0 after our dinnerly was taken on Monday. Using a fisheye unofficial cheap pi cam & PIR sensor from the local jaycar. Hoping to have it deployed Sunday night for the next one.

WIP code:

from picamera import PiCamera
from time import sleep
import RPi.GPIO as GPIO
import datetime


GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

camera = PiCamera()

camera.rotation = 90
camera.preview_fullscreen = False
camera.preview_window = (400, 0, 640, 480)

def take_photo():
    camera.capture('/home/pi/Desktop/SecurityCam/frontdoor_%s.jpg' % dtg)
    print('A photo has been taken at %s' % dtg)
    sleep (0.5)

while True:
    dtg = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
    if GPIO.input(4):
    if GPIO.input(21):

I’d like to be able to add two things, make the two position switch be monitored by the OS to run the python script to “turn on” the working camera; and
Somehow send the files off the pi to either my running PC or cloud. Got as far as being able to see my Microsoft One Drive from the pi, but can’t send any files there yet, so at least the pi is inside, so even if they smash the camera, there’ll still be pics on the SD card.


Hi, thanks for sharing your project. Can’t see the clear picture of your camera. Earlier, from this article I came to know that there are a couple of camera PCBs to choose from. Which one did you choose for this project? Is it The Raspberry Pi Camera Module v2?

No I used an Amazon cheap one in case it gets smashed. You could use any though, I use the official ones on my octoprint & octoklipper setups to monitor 3d printers.

1 Like

Hi Bridget,

I’m not sure what the best way to upload from your Pi to One Drive is so hopefully someone else will know and be able to jump in, but I had to ask after seeing the name of your project. Is it safe to assume you’ve been following Mark Rober’s war on package thieves?


Of course! Although his are staged, mine are not. I did get pics of the delivery guy though, and no stolen Dinnerly. Needs more tweaks though, .

Frustrating to power portable pis though, I ended up throwing an anker powerbank at it last night, which has more storage and current than all of the pi specific powerpacks and converters. Hanging out for a company to make something better than the Adafruit powerboost 1000c (or this dodgy one I got from jaycar which can’t charge and power at the same time).


Thanks, Could you connect your camera in the same manner that we connect the official Raspberry pi camera? Or any modification was needed?

1 Like

Same CSI cable

1 Like

Hey Bridget,

It’s worth mentioning, if you need the very best in portable Pi technology, check out the whopping feature list on the PiJuice:

Had no idea Rober’s videos were staged! I recently had my car totalled by a driver who fled the scene, I may just replicate your project for things like that.


Hundred bucks though, if I ever manage to make a functioning droid I’d whack something like that in it. Trying to not spend all my money on components.

I’m hitting up core electronics and AliExpress pretty regularly lately.

Is that an HC-SR510?

1 Like

Looks the same from a quick search, walked to Jaycar to get one to make sure I could build it in time to deploy for the next delivery, theirs is xc4444.

Used it twice now, have pics of it being delivered and haven’t lost one yet.

Still would like to improve it to run the program from a physical switch, and automatically transfer the files.