personal-site/content/Fake Dog.md
2022-07-01 23:50:03 -07:00

2.7 KiB

Title: Fake Dog for Home Security Date: 2022-06-27 Category: Creations Summary: Fake dog barking for home security while on vacation. Short: 7

I set up a fake dog that barks if my surveillance cameras are triggered while I'm out of town on vacation. It's a pair of computer speakers plugged into a Raspberry Pi, which is an inexpensive single-board computer. One speaker faces the front door and the other faces the side door.

When the front door camera is triggered my surveillance camera system sends a message to the Raspberry Pi. A simple program plays an audio clip of a big dog barking through the side speaker and then the front speaker. The change in speakers simulates a dog moving towards the front door. The opposite happens if the side door camera is triggered.

You can find the source code on my Gitea.

!fake-dog.jpg

Technical Details

My surveillance cameras sit on a separate network without internet access and their RTSP streams are consumed by the Blue Iris NVR software running on a dedicated Windows box. When an object is detected moving through a defined area for certain cameras, Blue Iris is configured to send an MQTT message to the iot/cameras topic via the Mosquitto broker running on my media server.

A Python script kept alive by Supervisor runs on the Raspberry Pi and listens to the topic using the asyncio-mqtt module. It receives and tries to decode a json message like {"serial": "SE-N-ZoneB"}. If the camera's serial is found in a dict at the top of the script, the corresponding audio file is played using Pygame. Controlling which speaker barks is done by muting the left or right channel in the stereo audio file.

!fake-dog2.png

Efficacy

So is it worth it? According to former burglars, barking dogs and security cameras are some of the best deterrents to home invasions. The dog sounds kind of fake to me, but I know it isn't real. I'm hoping that a rushing burglar won't spend time pondering if the barking is from an elaborate speaker setup and will just move on to a different house.

Is it needed in my neighbourhood? I think so. I already caught a prowler who went in my backyard and checked my garage door handle to see if it was locked. He then broke into my neighbour's truck and garage after. If you know this guy, shoot me an email:

!fake-dog3.jpg

The extra peace of mind while I'm away is worth the evening it took to set up. It was very easy to make because I reused the code I wrote for Protospace's PA system doorbell that you can find on GitHub. It operates similarly by playing an audio file based on which 433 MHz doorbell is pressed.