Arduino Controlled Window for Cat
Intro: Arduino Controlled Window for Cat
I am submitting this instructable to the Arduino challenge. Please remember to vote!
My neighbor had a little problem with his cat. It want's to go out and back inside too frequently. Usually he opens just his kitchen window and let's the cat in/out. Usually the cat stays only short periods outside and want's soon to come back inside. And then again out and back in. Okay, he could just let the window open, but here in Finland it can be easily -30 C (-22 F) in winter, so this is not a good solution.
We decided to build a microcontroller to the window to open and close the window automatically. Arduino controls a strong servo motor, which moves the window. It has three proximity sensors to sense where the is cat is.
My neighbor had a little problem with his cat. It want's to go out and back inside too frequently. Usually he opens just his kitchen window and let's the cat in/out. Usually the cat stays only short periods outside and want's soon to come back inside. And then again out and back in. Okay, he could just let the window open, but here in Finland it can be easily -30 C (-22 F) in winter, so this is not a good solution.
We decided to build a microcontroller to the window to open and close the window automatically. Arduino controls a strong servo motor, which moves the window. It has three proximity sensors to sense where the is cat is.
STEP 1: Parts List
Main parts:
1 pc suitable power adaptor to juice the Arduino (input voltage 7-12V dc)
1 pc Arduino microcontroller (or equivalent *duino)
1 pc strong servo motor to move the window. I used Towerpro MG995 Metal Servo with Gears (10kg Torque).
3 pc Pololu 1134 carrier board with Sharp GP2Y0D810Z0F Digital distance sensor 10 cm
1 pc "Third hand" to hold the sensors
1 pc cat (operator)
Misc. parts:
some wire
suitable casing
small window hinge
some metal parts to fix the servo to the window frame, screws, etc
Tools etc:
Solder & soldering iron
Computer & usb cable to program the Arduino
1 pc suitable power adaptor to juice the Arduino (input voltage 7-12V dc)
1 pc Arduino microcontroller (or equivalent *duino)
1 pc strong servo motor to move the window. I used Towerpro MG995 Metal Servo with Gears (10kg Torque).
3 pc Pololu 1134 carrier board with Sharp GP2Y0D810Z0F Digital distance sensor 10 cm
1 pc "Third hand" to hold the sensors
1 pc cat (operator)
Misc. parts:
some wire
suitable casing
small window hinge
some metal parts to fix the servo to the window frame, screws, etc
Tools etc:
Solder & soldering iron
Computer & usb cable to program the Arduino
STEP 2: Mechanics
We made a holder for servo and attached it to frame. Then we fixed a small window hinge to the window itself.
We made adjustable arm from copper rod. Don't fix the servo arm with screw until you have first driven the servo to zero (closed) position with the control program. The good thing in this is that the mechanics are easily adjustable.
We chose Towerpro servo with metal gears to get long life for the installation. It does move the window easily enough but it can not slice the cat (nor anything else). The closing speed is set to very slow.
There are dfx files of the servo bracket and actuator arm included.
We made adjustable arm from copper rod. Don't fix the servo arm with screw until you have first driven the servo to zero (closed) position with the control program. The good thing in this is that the mechanics are easily adjustable.
We chose Towerpro servo with metal gears to get long life for the installation. It does move the window easily enough but it can not slice the cat (nor anything else). The closing speed is set to very slow.
There are dfx files of the servo bracket and actuator arm included.
STEP 3: Sensor Placement
We placed three sensors, two between the windows (works well through the glass) and one at the opening window, so the window doesn't close if the cat just looks outside. The good thing that in these Pololu boards are tiny SMD-leds. You see directly when the sensor is detecting an object.
STEP 4: Control Center
The box with Arduino is located conveniently below the windowsill. There is no power switch. You just connect or disconnect the power connector.
STEP 5: The Program
Here is the program. It is written on 1.0 Arduino software, so you need at least it (or newer).
The program is pretty well documented. We added delays for detection, because the window opened itself occasionally.
The program defaults that the window is closed at the beginning. If not, it closes it first. Please check that the servo movements are okay before fixing the servo arm!
The program is pretty well documented. We added delays for detection, because the window opened itself occasionally.
The program defaults that the window is closed at the beginning. If not, it closes it first. Please check that the servo movements are okay before fixing the servo arm!
STEP 6: Connections
Arduino board powers up all the sensors and the servo motor with +5v and GND.
Sensors are connected to following Arduino pins:
Pin 2 - Inside looking sensor
Pin 4 - Sensor located in the window opening
Pin 6 - Sensor looking outside
Pin 10 - Servo motors control wire
Pin 13 - Led that is on when the window is on move.
We have thought also to include temperature sensors both inside and outside. This would be a convenient way to get intelligent ventilation in summer... ...possibilities are limitless!
Sensors are connected to following Arduino pins:
Pin 2 - Inside looking sensor
Pin 4 - Sensor located in the window opening
Pin 6 - Sensor looking outside
Pin 10 - Servo motors control wire
Pin 13 - Led that is on when the window is on move.
We have thought also to include temperature sensors both inside and outside. This would be a convenient way to get intelligent ventilation in summer... ...possibilities are limitless!
STEP 7: Happy User
The cat has to get used to the automatic window. It is a process of learning also for the cat. It went twice BEHIND the window when the window started to open. It was very confused when the window swiped it off the sill and into the snow!
20 Comments
MagnusG11 6 years ago
Sorry for reviving an old thread, but I'm currently trying to copy-paste the project here now for our own cat (first time with Arduino, wee!). It strikes me that this is in fact the only thread I've found on the web about such a DIY cat-window.
To the point: Where did you find brackets and copper-rod? Did you carve it out yourself with tools? The closest I'm getting is "eye bolt" or "turnbuckle" on eBay or at my local hardware store. Do you have some tips?
- cheers from frozen Norway!
saastamo 6 years ago
The copper rod is self made. First made threads to the other end an then made servo connector with saw. You could use sonething like this instead: https://www.google.fi/search?q=pitk%C3%A4+mutteri&...
Servo bracket is only reused from something scrap which was lying around. Can easily be replaced with something like this: https://www.google.fi/search?q=kulmarauta&rlz=1C1J...
saastamo 8 years ago
The original cat window has been working continuously for 4 years! There has been some minor tweaking in the code (opening/closing speed of the window, better proximity sensor for outside because of sunlight), but basically "it works like the WC in a train" (finnish proverb meaning very simple and reliable design:).
Current proximity sensor looking outside is similar to this:
http://www.dx.com/p/diy-ir-infrared-distance-measu...
Also, there is now only 2 sensors in use, because the one looking inside caused too many "wrong alarms": when someone walked beside the window, it detected the movement.
nodoubtman 9 years ago
congrats! how did you do the servo arm?
thank you!
marC:)
saastamo 9 years ago
Servo arm was made from brass rod. The window side was drilled and thread made with threading tool. The other end was sawn and attached to servo plastic arm with a pin. This configuration has been working now for 3 years. Only one mains transformed was lost in a thunderstorm, no other problems. The window has run many thousands of opening and closing cycles.
joecabezas 11 years ago
can you post a video working?
CatTrampoline 12 years ago
What happens when a varmit shows up at the window? I guess they don't have raccoons or possums in Finland, but what about neighbor cats & magpies?
saastamo 12 years ago
If needed, it could be arranged that the cat cas a RFID tag and then the window opens only when right RFID is around. In our case this was not an issue. Good point, though.
drewgrey 12 years ago
CatTrampoline 12 years ago
AntoineMeillet 12 years ago
A video would be great !
10er512 12 years ago
I'm new with this arduino thing.
saastamo 12 years ago
https://www.instructables.com/id/DIY-Arduino-or-The-DIY-Duino/
WWC 12 years ago
sofiadragon1979 12 years ago
saastamo 12 years ago
sofiadragon1979 12 years ago
rimar2000 12 years ago
Awesome project!
saastamo 12 years ago
PeckLauros 12 years ago