CatBot animal feeder

By Andrew Gregory. Posted

If you like cats, and you want to be alerted whenever a cat wanders into your garden, then we have the project for you. CatBot is a notification system for stray cat sightings. It’s a brilliant example of a project that takes a minimal amount of hardware, adds open-source services, and just works.

CatBot is built using two Raspberry Pi boards: the first, a Raspberry Pi Zero, hosts a Raspberry Pi Camera Module 2 and a Flask server, which sends images to a Raspberry Pi 5 for processing. The Raspberry Pi 5 is a much more powerful machine, and so that’s where the clever stuff happens: it runs a computer vision model, which determines whether the cat-shaped collection of pixels is a cat. If it’s a cat, the Raspberry Pi 5 can send photos to Michael’s phone via a Twillo client (as an MMS message, sent to Michael’s phone number, not an email).

“I used Raspberry Pi because I was recently working with Raspberry Pi and cameras for another project, a digital sensor for a film camera,” says Michael. “Although there are definitely simpler solutions with cheaper microcontrollers, I find it valuable to start with techniques I know rather than going down rabbit holes of learning new tools. I used two separate boards because Raspberry Pi 5 is my home server and NAS, which I did not want to mount on the kitchen window.”

But there’s a catch: the food that Michael was leaving out for the cats was also attracting birds, for which cat food is potentially unhealthy, so he needed to find a way of identifying birds and scaring them away. He eventually settled on a minimal solution that just – only just – qualifies for the label of ‘robot’: an actuator (a Tower Pro micro servo) connected to a chopstick that taps on the window to scare the birds away. If Raspberry Pi 5 detects a bird, it sends a request to Raspberry Pi Zero to activate the servo.

Raspberry Pi Zero links to a Raspberry Pi 5, which does the heavy computation

“Defining ‘robot’ is hard to pin down and frequently leads to disagreement among roboticists,” says Michael. “I believe that a robot is any physical thing with sensors and actuators. While some definitions require autonomy, that excludes arguably robotic things like human-piloted mecha or heavy industrial equipment. Relaxing the requirement of autonomy frames robots as tools that complement rather than supplant our abilities, which I find valuable in the current hype wave of AI and ML.

“There are commercial products that do similar things, like the Bird Buddy or pet-oriented indoor security cameras. By the time that I could hack those to get the functionality I wanted, I might as well have started with open-source tools.”

The AI model correctly identifies cats, and sends pictures to Michael’s phone

“My favorite projects include Blossom, an open-source robot platform that I developed during my PhD, and the Leica MPi, a swappable digital sensor for a Leica film camera. I’m currently taking a sabbatical at the Recurse Center, a programming retreat in New York, where I am exploring alternative HCI hardware and brushing up on AIML for robotics.”

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.