Building An Ubuntu-Powered Cat Feeder Lee Holmes Background In preparation for a recent vacation, I wanted to find a way to keep my cats fed without asking my neighbours to visit twice a day. Both of my cats were previously stray, so leaving a gigantic pile of cat food was not an option. I had heard of other projects for a DIY cat feeder (one powered by the timer from an old VCR, for example,) but they were a little more complicated than I wanted to build. And, as an engineering challenge, I wanted to build it out of parts just lying around the house. Parts List 1 Big box of Pepsi 1 to 2 Thin phone books 1 Sturdy cardboard box 1 Elastic 5-6 Bamboo skewers 1 Sheet of cardboard 1 Bowl 1 Wireless-enabled computer 1 Very large box Build Instructions The DIY cat feeder centers around a simple concept: a gravity-fed hopper that releases dry cat food when its trap door opens. The main moving part in the cat feeder is a CDROM tray. On a set schedule (or manually,) the computer ejects the tray for a preset amount of time. As the tray ejects, it forces the hopper's trap door open (against the resistance of an elastic band,) which in turn releases food. Once the CDROM tray closes, the elastic band pulls the trap door closed again. Figures 1 and 2 illustrate the completed cat feeder.
Build the hopper To build the hopper, take a sturdy cardboard box and cut a trap door along one of its faces. Leave the door attached at its top, creating a natural hinge. Bend the flap over this hinge to slightly weaken the cardboard at that point. Use tape and bamboo sticks (or a strip of cardboard from the sheet,) to create and attach an arm to the bottom edge of the trap door. Ensure that this connection is strong, as the CDROM ultimately pushes against the far end of the arm. Make the arm 2 to 3 inches thick to guarantee that the CDROM will have no difficulty connecting with the end of the arm. Attach an elastic between the arm and hopper body. Give the elastic just enough tension to prevent cat food from naturally escaping due to gravity. Build the hopper mount The hopper mount positions the hopper at an angle that lets food flow freely through the trap door. It also positions the hopper arm at a height that allows the CDROM to connect with it. To build the hopper mount, start with a large box of Pepsi. Temporarily tilt the hopper forward at an angle that allows food to flow. Place thin phonebooks (or rolled up newspaper) in the space left between the hopper and Pepsi box. Remove the hopper, and attach the phonebooks or other stuffing material to the Pepsi box. Add the hopper to the top of the hopper mount again and attach it. One effective way is to tape the front of the hopper to the front of the Pepsi box, with another strip of tape along the back to hold the hopper upright. Build the food chute The food chute guides food from the hopper to the bowl. Use cardboard from the sheet of cardboard to build a chute that resembles the one given in Figures 1 and 2. Attach it just below the trap door of the hopper. Ensure that the chute defines a steep incline to the food bowl, so that food cannot collect along its path. Position the computer Position the computer beside the Pepsi box, and eject the CDROM tray several times. Ensure that the CDROM tray lines up with the hopper arm, and opens it by 1-2 inches when fully extended. If required, you can raise and lower either the hopper or computer with small risers (such as DVD cases, telephone books, etc.) The computer is ventilated by several openings at the bottom of the enclosure.
Install the software To install the software, copy feedcats.sh (given in the "Software Settings" section) to your home directory. If you haven't already, enable SSH access to this machine so that you can feed the cats on demand. To feed the cats on a schedule, add the crontab entry given in "Software Settings." Calibrate the feeder For a given hopper setup, two factors control how much food your cats receive: 1) How long the CDROM tray stays open 2) How wide the CDROM tray forces the hopper door You will probably find it easiest to simply settle on some values for factor #1, and adjust factor #2 until the feeder dispenses portions of the desired size. The feedcats.sh script given in "Software Settings" opens the CDROM tray twice, for 0.3 seconds per cycle. Opening the tray twice makes the dosing much more consistent. After settling on values for factor #1, simply move the computer closer or farther away from the hopper arm to change how wide the CDROM tray forces the hopper door. Once the feeder consistently doses cat food as you want, enclose it in a large cardboard box to prevent your cats from becoming curious. Cut a hole in the cardboard box, feed the chute through it, and place the cat bowl at the bottom of the chute. You may want to place some heavy items (such as more phone books) on top of the enclosure to prevent the cats from moving or playing with the neat stuff inside. Test the feeder In case it isn't clear, lives are at stake here! Make sure that your feeder runs smoothly for several weeks before actually relying on it. Once you do need it, have a friend check-in at least every few days. Ask them to check for any malfunctions, monitor food levels, and of course change the litter :) Software Settings The following script ejects the CDROM twice, for 0.3s per cycle. This helps guarantee a consistent feeding dose.
#! /bin/bash eject /dev/cdrom sleep 0.3s eject -t /dev/cdrom sleep 2s eject /dev/cdrom sleep 0.3s eject -t /dev/cdrom feedcats.sh The following crontab entry invokes feedcats.sh twice per day, at 7:00 am, and 5:45 pm: # minute hour day month weekday command 0 7 * * * /home/<user>/feedcats.sh 45 17 * * * /home/<user>/feedcats.sh Example crontab entries Here is a PowerShell script that does the same thing for Windows: $mediaplayer = New-Object -Com WMPlayer.OCX $mediaplayer.cdromcollection.item(0).eject() Start-Sleep -Milliseconds 300 $mediaplayer.cdromcollection.item(0).eject() Start-Sleep 1 $mediaplayer.cdromcollection.item(0).eject() Start-Sleep -Milliseconds 300 feedcats.ps1 And, commands to schedule it for the same feeding times: schtasks /create /tn "Feed Cats" /sc DAILY /st 07:00:00 ` /tr "powershell c:\users\<user>\feedcats.ps1" schtasks /create /tn "Feed Cats" /sc DAILY /st 17:45:00 ` /tr "powershell c:\users\<user>\feedcats.ps1" Example schtasks scheduling commands
Fig. 1: Cat feeder from the left
Fig. 2: Cat feeder from the right