How to interface with my cat door?

Hi all,

I'm very new to Arduino, but I'm having fun learning! Anyway, I'm trying to figure out what I need, and how I can control my cat door with my Arduino. You can probably tell in the photo that it just slides up and down.

It normally comes out if you slide it up all the way - I just have it slid up most of the way to show how it works. So a requirement is that it would have to come up to a very specific position and go down to a specific poistion.

I have no clue of what kind of hardware (mechanically and electronically) I could use to accomplish this. Any help (more details the better too) would be greatly appreciated.

If the door is light, a servo with a long arm attached to the door with a piece fo string may be able to raise and lower it.

Two words: dial cord.

Look at the mechanism radios used to have to move a mechanical pointer back and forth across the dial as you turned the tuning knob.

Since you've already modified the door for the cat entry, you should be able to modify it to add a motor and pulley mechanism to do the opening/closing.

Get a fairly powerful surplus DC hobby motor, like this one:

Attach to the shaft a piece of 1/8 inch threaded rod; to do so you might use a threaded coupler nut of the same size as the rob, and epoxy it (I would use JBWeld, personally) to the shaft of the motor. At the top edge of the kitty door, epoxy another nut sized to fit the threaded rod perpendicular to the door. Once everything is cured (wait 24 hours for maximum epoxy strength), thread the rod thru the nut on the door, and position the motor above (so the motor and shaft are vertical); mount the motor to the door using a couple of appropriately sized pipe clamps (you may need shimming between the clamp and the motor if you can't get just the right size of clamp; use a piece of bicycle inner-tubing wrapped around the motor to get it to fit).

So - now you have a linear actuator which can open and close the kitty door at a fast (but not insane) speed. It is compact and very simple to build. It can be easily controlled by the Arduino via an h-bridge (relay, transistor, motor control IC, whatever) attached to a couple of digital i/o pins. Examples abound for how to control a DC motor in this manner, so I won't belabor the point.

You will then need limit switches at each extreme end of travel (open and closed); for best results with lower maintenance, use a couple of opto-interrupters wired to another couple of digital i/o pins on the Arduino (you'll need one at the top and one at the bottom ends of travel for the door). Something like these surplus switches:

http://www.allelectronics.com/make-a-store/item/OSU-58/OPTO-INTERRUPTER-SWITCH/1.html

Alternatively (but less reliable, plus you'll need to add de-bouncing code), you could use a couple of micro-switches, like these:

Now you can write the code to check the status of the switches (optical or mechanical), to determine when the door is at the limits of its travel.

Lastly, you'll want to hook up a third optical interruptor across the path of the door, so you can monitor if kitty is coming thru, and stop the motor activity if it is moving the door downward (maybe reverse it to move it back up). This can be done via an IR LED hooked up to yet another pin on the Arduino, like this one:

http://www.allelectronics.com/make-a-store/item/ILED-8/T-1-3/4-INFRARED-LED-EMITTER/-/1.html

...and a photo-transistor, like this one:

...placed directly opposite of the LED. Wire a regular LED in parallel with the IR LED (or use a cheap web-cam with no IR filter) to be able to monitor the activity of the IR LED. Put a small piece of dark tubing around both the LED and the photo-transistor, to keep stray light from causing issues. Place these about halfway up the opening in the door way, in such a manner that the door itself doesn't block the light path (you may need to position the LED and photo-transistor on the opposite side of the door).

You'll probably want some kind of IR detector on each side of the door to detect kitty, something like these could work:

http://www.goldmine-elec-products.com/prodinfo.asp?number=G4567

That's the basic mechanical and electronic side of it; all that's left is programming...

:slight_smile:

I also think a servo with a long extention arm and a direct string to the top of the sliding door would be the simplest solution. You can be servos with higher torque ratings that this might require.

Lefty

The problem with using a single string might be that the door doesn't slide easily in the "tracks"; some doggy/kitty doors are like this so you can leave it open easily. If it is possible to adjust the friction in such a manner, then such a solution could probably work (might have to add a bit of weight to the door if it isn't heavy enough).

The problem with using a single string might be that the door doesn't slide easily in the "tracks"

But there's a simple solution for that problem...

Sorry. Couldn't resist. :smiley:

Well no matter what you/we come up with, the million dollar question is will the cat trust it. ;D

Lefty

I like cr0sh's idea except for one small thing - it might give the system too much torque. If it's too great and the cat was to dawdle in coming through the hole perhaps it's raining and Mr Tiddles isn't sure if he want's to go out..... well then you have a very slow moving kitty guillotine.

Edit - just noticed that cr0sh had listed a safety to stop this. Still would be hesitant about having a mechanical system that could snip the cat in two. Perhaps replace the sliding flap with a sheet of rubber?

Wow, thanks everyone for all of your comments and suggestions.

I'm actually a little overwhelmed here...maybe more now than before, but that's a good thing I think. :wink:

I have specific questions for some of you now.

zoomkat - judging by cr0sh's reply to your suggestion, it sounds like you're suggesting that the servo/arm/string will basically just raise it, and when allowed, the weight of the door itself can lower itself? I think that the cat door would fall/close down on it's own if positioned correctly. I was able to make it stay for the picture only from carefully positioning it a certain way. I do like the simplicity of this, but still am having a hard time trying to imagine how everything would go together to make this work.

Ran Talbott - I think I know what you're talking about as far as the old radios. Although, as with the previous suggestion, I'm having a hard time picturing the specifics and how they would all come together.

cr0sh - My goodness! I feel like I should go with yours just for the shear detail even if it does feel like it's still over my head. I appreciate all the details that you provided. I am definitely going to re-read your post several times to see if I can figure it out better. However, I'm not sure if I could actually successfully do all of that.

Richard Crowley - Your magnetic 'latch' sounds interesting. However, it sounds like it wouldn't keep a raccoon out, though, right? (That's the whole reason I've started looking into this project actually) Speaking of RFID, where did you get that photo? That might be an interesting 'trigger' I might want to use. Also, one of my cat's do have an RFID chip embedded in it, and I've been wanting to get the other one done too.

And while still on the subject of RFID...are there certain specifications/kinds/protocols of RFID readers/tags? I think I heard that that the chips that get embedded in the US use a certain kind of RFID chip, and aren't compatible with RFID stuff overseas. So I figure that you have to match the proper types with each other for everything to communicate. So I'd want to make sure that I would be buying the right kind of hardware to talk to my cat's microchip and/or rfid 'dongle' if I used those.

And I appreciate the other comments mentioning safety (I do not want to kill my cat obviously) and whether they will like/trust it and actually use it. I've got a lot to ponder about. I would just buy one of these cool cat doors, but they're not available here in the U.S. yet.

Thanks everyone!

If you wanted to be extra safe using my kitty guillitine idea, you could monitor the current across the motor via a shunt resistor to monitor the voltage; if the current gets too large, stop and reverse the motor. Finally, rather than JBWelding the shaft to the threaded rod via a coupler, you could instead use a piece of rubber hose or a spring around both pieces, so that if the torque got too large, it would slip. All four of these devices used together (IR switches, optical interruptors, current sensing shunt, and compliant clutching) should make the system very safe for kitty...

I do like the RF ID tag idea, too, Richard - add that in to the system, so your cat and only your cat can come in (but keep all the other sensors in place as well)...

:slight_smile:

i have to agree with daveg360. Having a door slide down in such a way could be dangerous to the cat. If his neck gets caught as the door slides down, even if there is little pressure from the servo, the cat may panic and start thrashing around with his head caught on the door.

I would suggest giving more thought to the way the door opens. a swing door with a magnetic lock may be a better idea. The magnet simply stabilizes the door, then you can use a rod to actually lock it.

good luck!

good luck!

And wish good luck for the cat also. :wink:

I bet you only get one chance at getting it right, as I think cats have long memories. :wink:

Lefty

I think there might be a way to recycle an old CDrom drive to do this. They have a motor and gearing to open the tray, which has little microswitches to stop the motor at either end of the travel. So if you are prepared to have the innards of a CDrom drive decorating the cat's threshold, this could be a very cheap way to do it.

Plenty of scope for trying to separate out just the essential bits of the drive and then interfacing that to an arduino - whether just the motor/gears/microswitches or the motor controller as well.

Looking more closely at the pix, looks like the door is is a basic clear plastic swinging door with a metal shield to secure the swinging door. I've had a swinging door in the carport storm door for many years. The cats are older now and don't hunt as much, so issues with live birds, mice, and rabbits being brought in is rare now. A simple servo operated gate latch made from popcicle sticks and hotglue would be easy for the swing door, but it might interfer with the metal sliding door.

I think the magnetic latch would stop a racoon. Just depends on the magnetic latch. I got a full size one intended to secure doors and that can't be budged by a person (about 30GBP on ebay). One thing to bear in mind is that they can be shocked open - this can be solved by having a degree of freedom in the sytem - so the striker plate mounted on a spring. Doubt a racoon would fling itself headlong at a seemingly closed door though.

They sell commercial systems that work by reading the RFID chip in the cats neck. My friend has one - it takes a fair bit of getting used to though as the tube that the cat crawls through is longer than a normal cat flap - I guess to give the system time to read the tag.

The idea of the flap with a magnet could also be reversed where a permanent magnet is mounted to the flap and the coil is behind a piece of metal. This way the magnet against the metal holds it shut, and it's opened by feeding the coil to repel the permanent magnet and push the flap away. This way, the coil wouldn't need to be energized except when the door is open, this could save power and make it realistic to run it off batteries.

With the "guillotine" style in the OP, a piece of string connected to a bobbin on the end of a motor would make a nice little winch to raise the door, where gravity could bring it back down. This would be simple enough with a hobby motor, or any small motor for that matter.

I like the RFID idea to keep other animals out, but if money is an issue (and it usually is, especially on projects you won't profit from), maybe even just an IR LED wired to a button battery tied to a collar could work. You could get a cheap keychain flashlight, swap the existing LED with an IR one, and mount it on the colar. Then when the cat approaches the door, a reciever detects it and activates the door. This wouldn't need any kind of special coding as long as there aren't any other cats in the neighborhood whose owners had the same idea. I highly doubt the likelyhood of a squirrel or raccoon wandering up out of the forest with an IR emitter.

I appreciate everyone's comments, ideas and suggestions. After thinking about it, and looking into different methods, I think I'm going to try and use this reader:

and put the 'keychain' style tags on my cats' collar from here:
http://www.seeedstudio.com/depot/125khz-rfid-tag-combo-5-pcs-p-194.html

I'm going to replace the floppy plastic flap and get rid of the metal 'guillitine', and insert my own hard piece of acrylic for the flap. Then I'm going to somehow use a servo I guess to move some kind of arm out of the way (unlocking the flap) when one of my cats comes near so they can go through.

I've never interfaced with RFID or servos, so this whole thing may take me a while, but I'll definitely report back when finished!

Thank you everyone again for all your great ideas!

I was also searching for something similar and have a spare Arduino here that's begging to be used!

As this has to pass the wife test, I was thinking of just getting a normal magnet operated kitty-flap and putting an RFID reader above the inside and the outside of the kitty-flap, encased in something to look tidy.

Will any of the RFID shields read under-the-skin animal RFID tags?

If so, then a simple electromagnet just inside the tunnel which I energise when kitty is detected should be enough to trigger the door unlock and allow kitty in / out. I guess that I'll just energise the electromagnet for x seconds and all will be good.

Sounds pretty simple but can anyone think of anything I may have forgotten?

Actually,

Just looking at the ready-built IR catflaps which I can get cheap as anything from Tesco @ 28 pounds!

I'll then rip it apart and work out how the bits work, hopefully finding some way to build on a porch at the entrance and exit to take the rfid reader!