How I Feed My Cats with Linux

Give your Linux box the power to control real-world events with an inexpensive microcontroller from Parallax, a Python program and some serial port magic.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

very cool cat feeder!

Anonymous's picture

Nice! I bet similar projects could likewise be done with an arduino kit as well...

Would work for goldfish, dogs, etc as well...

I am curious about the two bowl issue.. And what about fresh water via remote? :)

Read from serial port

msdark's picture

(First sorry for my english... i speak spanish xD)

Hi!!! nice work... this post help me a lot to figure out some things...

but.. i need help.. if you can..
I'm working with a basic stamp to read a sensor (a potentiometer).. with python i create a GUI (glade) and add some action buttons.. with one button i send a comand through serial port to "activate" the basic stamp.

The basic stamp read the potentiometer and show (through command line using DEBUG) the result values of the operations.. but i want to send this result through serial port to read it with python to show it in the GUI, but i can't read...

I use SEROUT in the basic stamp code to send the result through port but when i test it with a littel python script i have a error: "OSError: [Errno 11] Resource temporarily unavailable" so i can't read the result...

i use this in basic stamp:

SEROUT 16,84,[DEC3 adcBits ,LF]

and the python test code:

import serial
p = serial.Serial("/dev/bstamp")

But nothing happend... can you give me some idea?

Thanks in advance
Thanks a lot

PD: I'm using Linux obviusly xD

Another project

CJB's picture

Perhaps this comment comes a few years too late, but I want to do a project that is very similar to yours. I have a problem with a fat cat eating out of another cat's food dish. I want to put a sensor on the smaller cat's collar that opens an auto feeding dish when she gets near it. (I could also try to train her to do something that triggers her dish to open). Coincidentally, I purchased the BASIC stamp controller kit you mentioned and am in the process of learning about it. I'm not a computer programmer. I'm going to have to read your report several times to really understand what you did.
Might you have some tips for me? Do you think I could purchase the motor, sensor, and other equipment I'd need to create my special food bowl from Parrallax? I operate a PC with Windows, and could hook up a computer to the bowl, or just the stamp controller. This sounds like a fun learning challenge for me, but I might be in over my head. Any advice you have would be appreciated!

Nice project!

Sqwishy's picture

Wow thats pretty cool. And i'm jealous of you. I'm really new to this whole microprocessor thingy so can you explain stuff to me :D
The main chipy thing is a basic stamp 2 from parallex right?
Did you write python code and somehow run it on the basic stamp chip or convert it to basic code first or what?
Is there an easy way for me to write python code and somehow send commands or something to a basic stamp 2 chip? like do i hafta get a converter prog?
and do i hafta run linux. i have a gentoo/windows dual boot at home but at school (where i need to work on the chipy stuff) all their compy's use windowz


Anonymous's picture

I respect you and very much wish you peace Lets talk about... I was send mail off


Anonymous's picture

This is exactly the kind of thing that I have just started working on. But instead of a cat feeder, it's just a web-interface to flush a toilet. Sounds silly, I know -- and it is!

It might be a guy thing, it might be a hacker thing, but I find being able to flush a toilet remotely to be funny. Especially if someone is using it or in the shower (and you told them that they've been in there for an hour and it is now your turn).

Anyway, I just need to find a servo with enough strength to lift the lid, after that, it's all good. (I've actually already wired the toilet area up, so now all I have to do is get everything working.)

This is exactly the kind of s

OhMyAchingGut's picture

This is exactly the kind of stuff i live reading in LJ. I never in a million years would have thought of this...and its probably a good project to dip my feet into the world of microcontrollers.

I'm going to go put that renewal check in the mail. Keep up the good work guys :)

Great! Now Where's the WebCam?

Anonymous's picture

Fantastic article ... and definitely a cute web site ... but I'm a skeptic ... Where's the webcam to show the action of the cat feeder and to be able to actually SEE the kitty getting the treat?


RaH's picture

My wife loves cats, we also have two, she also has used a computer the last 10 years and is just now beginning to realize you can use it for more than just word processing. I am going to show her this article to prove that theres more than one way to feed a cat. Excellent job on the feeder. This seems like a good project to do with my daughter to introduce her to programming and electronics. Thank you for taking time to write it up and sharing it.

that's cool... you should def

Anonymous's picture

that's cool... you should definitely show your daughter.
I'll be starting CS grad school in a few months, but when I was a kid, the men in the family never bothered to teach any of the girls how to work with computers. And actually, my degree is in math... that article was still only barely legible to me...


NSK's picture

That's an awesome article, please write more like this! Very good job.


Lachek's picture

Very, very cool project...
Now, what I really want to see (and I'm only half serious :) is biometric support - a simple pawprint reader to dispense and ration food differently depending on which cat is requesting to be fed. It would greatly assist me in keeping my one overweight cat on a diet, while ensuring that my other cat gets the nutrition she needs...


Kev's picture

if you had a passive sensor, it could be used to determine who is near the feeder. I though of this after seeing a dog door that was operated by a 'key' on the dogs collor.

Biometrics?! Or just a scale

Anonymous's picture

Biometrics?! Or just a scale or rf collar.


Anonymous's picture

The last thing these cats need is more treats. From the photo it obvious they're quite overweight (just like the majority of cats in the U.S.) just like the majority of people in the U.S.

Talk to your vet and he will (more democratically) tell you the same thing.

I think you mean diplomatical

Jason's picture

I think you mean diplomatically ...

jealous much?

Anonymous's picture

jealous much?


Anonymous's picture



Dave's picture

You know technically that the USA is a 4th world country, right?

Nice Project!

Sascha M.'s picture

really nice project!
Would be nice to see more of such projects.

>^.^< -(miauu)

Your article is going to hit

Anonymous's picture

Your article is going to hit Slashdot. You may want to get rid of the "feed my cat" link....

Too late! Cotton and Tulip

Anonymous's picture

Too late!

Cotton and Tulip thank the Slashdot community at large


Big Daddy's picture

Cotton and Tulip? Next cats you get name them something cool, like Tool and Flames.


BrownEyedGirl's picture

Do you have any statistics on how often Tulip and Cotton get fed? What times of day seem to be popular? Do they sometimes get fed when you're at home? Just curious.

Added to Crazy Hacks.

Uwe Hermann's picture

This is a very very cool project, congratulations. I have taken the freedom to add it to my Crazy Hacks wiki, I hope you don't mind. Feel free to correct the entry, in case I have gotten anything wrong.


Other ways to interface computers to external mechanisms

Michael Shiloh's picture

Another way to interface motors and sensors to your computer is the Teleo System by MakingThings

Disclosure: I work for them

Teleo is popular in the electronic music and kinetic sculpture world, but it seems like a natural for programmers who would like to do things like your cat feeder. It's a series of modules that interface to a wide variety of sensors and actuators, and a simple C API.

I don't want this to look like an advertisement so I'll stop here, but I invite anyone interested to visit our website ( or to email me directly.

Michael Shiloh

Ouch... the prices.

tuco's picture

I was interested until I saw an older model mini ITX mobo + 128MB CF + IDE CF reader selling for $859 bucks! If you purchaced those items seperately anywhere else, it would cost, what, $180. Can I assume the rest of product line is appropriately marked up as well?

Another way to feed a cat

Mark's picture

Thanks Chris for putting the effort into writing this article. I have often wondered about extending the reach of my computer into the world I live in.

While looking around on the subject of microcontrollers I found an excellent device for direct serial to servo control.

If you are always going to drive your cat feeder from your PC this is a very simple solution.

I am going to get a board for myself to play with :)

Check out
At only $44US a pop too!! (postage is a bummer for OS residents)

Mark Doukidis

Good article

kanzure's picture

Good article, thanks. : )
Makes me want to feed my own cat for a change.

Is there any chance for more future linux toy projects of these likes?

Too much???

Anonymous's picture

Cotton and Tulip have been fed 8164 times. I sincerely hope the machine was taken offline, or they will end up with two dead cats smelling like smelly fish treads.

go away

Anonymous's picture

go away

Go away to where

Anonymous's picture


Shouldn't the author use Parallel Port instead

Ting's picture

Isn't an interface with some electronic via Parallel port a much cheaper solution?

Why wast money on PLC controller? Take the shortest route!!! :-)

Why not just take an embedded

Ueli's picture

Why not just take an embedded webserver instead of using a whole computer only to feed some cats...

Likely because he already had

OhMyAchingGut's picture

Likely because he already had the PC lying there, because an old PC is cheaper than an embedded board, and can be used to do more than just this one job quite easily.

That said, an embedded board would be a sexier solution. Probably some opportunity there for someone with some initiative and $$$ to put together a slick commercial device.


templar's picture

I is quite evident that this individual has never read the Quran nor studied its history and evolution. When people proclaim peace, peace, it is time to watch for war.

What does one thing have to do with another?

Anonymous's picture

It's a cat feeder ... wft does that have to do with 9/11?

Someone slap that dude with a fish!

obvious really.

REdjohn's picture

In a "post 9-11" world there has never been more need for a cool way to remotely feed our cats using our computers, weblinks, pic controllers and human inspiration. If I cant log in and feed my cats from my cell-phone and some radioshack parts, then the terrorists have won!

Seriously though, great project. I feel the need to build a usb cat feeder. With the pic stuff, usb would give you that 5v+ instead of the serial 12v. Nevermind, must buy cat food.