In the eye of the beholder
When we last left our handsome hero he was securing the perimeter using a PIR sensor and an Arduino. The rig was designed to raise an alarm via a piezo buzzer when the sensor detected movement. With the ability to easily place PIR sensors along the base's perimeter, it was good for telling you that someone (or something) was at the door, but not who (or what).
Unhappy with his lack of visibility outside the base (and because it was the next project in the book), he armed himself with the upgraded arsenal of a Raspberry Pi, Raspberry Squid, and USB webcam, and started working on Project 7: Monitor Zombies with a USB Webcam.
Bored with talking about himself in the third person, I got the chance to play with the latest version of Raspbian with this project, the one with the new Pixel theme. I’m not a fan of how it looks, but I was pleasantly surprised to see the default browser has changed to Chromium, and there seem to be a couple other minor improvements over previous iterations.
The idea behind the project is to monitor a webcam feed for changes between frames (something which might indicate movement) and use the Raspberry Squid (an RGB LED which has been pre-assembled with resistors and connectors to plug it directly into the GPIO ports on the Pi) to notify an operator by turning red.
If I’m honest, this project has left me a little underwhelmed.
For a start, I’ve not been able to get it working as intended. What I mean is, the Pi works, as does the webcam, the Raspberry Squid, and the python script which powers it all. The thing which doesn’t work is the ability for the webcam to provide consistent enough images for any real comparative purposes.
Even when pointed at a blank wall, there’s enough noise generated by the webcam that each image from the feed is different enough from the last that the script detects it as movement. I guess this is to be expected, as I am using a cheap webcam (the very same one as used in the book), I’m just disappointed that there’s no mention of anything like this being a possible issue, and I don’t like the idea that someone might get dishearted thinking they’re doing something wrong when the project doesn’t work as expected.
I’m also a little dubious of the requirement of the Raspberry Squid, a product which the author himself manufactures and sells. Maybe I’m seeing sinister intentions where there are none, and I can see the benefit of using something with the common interface provided by the Squid to make writing the python script easier (that, and full instructions on how to make your own Squid are provided for free on his site).
But this project doesn’t work as described, and I don’t imagine it has ever worked. I can also think of far better ways of notifying an operator of an incursion - what’s wrong with using the Piezo from the previous project? Or do away with the idea of detecting movement via the webcam (after all, we did that successfully in the last project) and instead focus on the benefits of a Pi as a desktop computer, and have a regular webcam feed sent to it?
I’ve read ahead to the following project, and this is very similar in scope, but instead shows you how to set up an internal, non-internet-connected, wifi network for use with wifi webcams set-up around the base. I’m not all that interested in building this right now, so instead I think I’ll skip ahead to Project 13, which combines the Arduino and Raspberry Pi projects previously built, and combines them into a control center. Now that sounds fun.