ScatCat

Matt Brennan
4 min readFeb 25, 2015

--

scratch scratch scratch.

Every morning, a paw at the door. 5AM. Before my wife or I can even hit snooze.

scratch scratch scratch.

meeoeow.

Yes, the cat was fed just 7 hours ago. No, he isn’t giving up if we just play dead.

I do love my cat. I got Wiggy in college, and have lived with him for more years than I have with any human besides my parents. And my tendency to stay up late in college and grad school probably didn’t help his sleep schedule (though, honestly, cats just sleep when they want to anyway).

But I was about to lose my mind. Lying half awake, I imagined how great it would be if I could get him to be quiet without going away. Automatic feeder? Pretty challenging with wet food. Remote control spray bottle? That’s silly, you couldn’t… It would have to be battery operated, those don’t…exist?

A few hours after rising to feed the beast, I started googling. Sure enough, I discovered the Nerf Thunderstorm. A battery-powered squirt gun, which I wouldn’t be the first to automate. The rest was all details.

Hardware

I also took advantage of the RadioShack going-out-of-business sale to get a little hobby kit with a breadboard, resistors, LEDs, and other components that I’ve been without for so long they were about to take my Electrical Engineering degree away. I used some of it for debugging, but the only pieces that remained were a few wires.

Raspberry Pi to Relay Board
Battery Pack Wiring

The relay board didn’t come with much instruction besides a schematic. While this video was helpful, the instructions didn’t quite work out. The relay specs say it requires 5V to engage, though several users have found 3.3V to work fine. Unfortunately, hooking it up as suggested, I found that only ~2.5V were going across the relay magnet. The solution: +5V to VCC, a GPIO to IN1, and a jumper between the relay’s VCC and JD-VCC. Look, ma, no ground!

To connect the squirt gun, I originally wanted to tear it apart and hotwire the trigger switch directly, but I decided it was easier to leave intact and only mess with the accessible battery pack. The gun also seemed a bit too powerful for squirting my small cat at short range (see, I do care!) so I decided to drop the voltage by wiring out one of the batteries. Electrical tape went over its ends, and wires took its place. The other ends of the wire connected to the normal-open points of the relay.

Software

Yo Config
Yo Button

I had to be able to trigger this thing half-awake. I decided to create a Yo account. Yo allows you to configure a call-back URL, which includes a username parameter for the person who Yo’d at the account. Yo logs stats through bit.ly, to track how often I pull the trigger. Best of all, I could add a 1x1 widget to my Android home screen to send the Yo.

A simple CherryPy web server (code) runs on the Raspberry Pi to receive the Yo callback. It checks the username parameter, and triggers the GPIO for 1/2 second.

Yo also logs stats through bit.ly, to track how often I pull the trigger.

Profit

Our bedroom door is on the far right. It’s a bit to hard to hit the Yo button and capture video at the same time, so for this video I just had my computer wait 15 seconds and curl the callback URL.

In the end I probably lost more sleep building this thing than it’ll ever save me. But at least my Raspberry Pi isn’t just sitting around anymore!

--

--