We want to detect when your cat is gets in the bed and when she leaves the bed.
The cheapest way to do so is with a momentary switch. Most switches you can pick up at an electronics supply store are much too small; we'll need to increase the surface area of the switch and make sure that the weight of the cat bed itself does not actuate the switch.
Here's a quick way to do so:
- Solder two stranded wires onto the terminals of your momentary switch. Allow enough wire length to reach from the cat bed to wherever you plan to stash your computer.
- Cut a strip of foamcore (12"x2" maybe), score it in the middle, then fold in half at the hinge. The upper half will be your lever. Cut a switch-sized hole in the bottom part. Hot glue the switch in, then glue a supporting piece of foamcore underneath to give more support to the switch.
- To add some spring force to the lever that keeps it open normally, cut some short pieces of "Foamies" foam strip, or some other springy material, and glue into open end between lever and base.
Then slide the switch underneath your cat bed. The switch should not be actuated by the weight of the bed alone, but should be actuated whenever you apply light pressure with your hand in various parts of the bed.Alternatives
- Tom Igoe shows how to detect a cat using Force Sensitive Resistors mounted between two plates of thin plywood in his book Making Things Talk.