[Mark West] and his wife had a problem, they’d been getting unwanted guests in their garden. Mark’s solution was to come up with a motion activated security camera system that emails him when a human moves in the garden. That’s right, only a human. And to make things more interesting from a technical standpoint, he does much of the processing in the cloud. He sends the cloud a photo with something moving in it, and he’s sent an email only if it has a human in it.
[Mark]’s first iteration, described very well on his website, involved putting together all off-the-shelf components including a Raspberry Pi Zero, the Pi NoIR camera and the ZeroView Camera Mount that let him easily mount it all on the inside of his window looking out to the garden. He used Motion to examine the camera’s images and look for any frames with movement. His code sent him an email with a photo every time motion was detected. The problem was that on some days he got email alerts with as many as 50 false positives: moving shadows, the neighbor’s cat, even rain on the window.
That lead him to his next iteration, checking for humans in the photos. For that he chose to pass the photos on to the Amazon Web Services (AWS) Rekognition online tool to check for humans.
But that left a decision. He could either send the images with motion in them to Rekognition, get back the result, and then send an email to himself about those that contained humans, or he could just send the images off to the cloud, let the cloud talk to Rekognition, and have the cloud send him the email. He chose to let the cloud do it so that the Pi Zero and the cloud components would be more decoupled, making changes to either one easier.
There isn’t room here to go through all the details of how he did it on the cloud and so we’ll leave that to [Mark’s] detailed write-up. But suffice it to say that it makes for a very interesting read. Most interesting is that it’s possible. It means that hacks with processor-constrained microcontrollers can not only do sophisticated AI tasks using online services but can also offload some of the intermediate tasks as well.
But what if you want to detect more than just motion? [Armagan C.] also uses a Raspberry Pi camera but adds thermal, LPG and CO2 sensors. Of if it’s just the cats that are the problem then how about a PIR sensor for detection and an automatic garden hose for deterrence?