When someone couldn't keep their dog out of their cat's litter box, they invented this automatic pet door.
The door was made with arduino and keeps the dog out with a lightweight door that closes when the dog steps on a sensor. The cat is able to easily bypass these sensors by stepping over them, while the dog isn't able to do this.
From YouTube: "Free science project instructions! Parts list, circuit diagram, and code: Science Buddies"
See also: Understanding code libraries for Arduino programming