It's too funny not to share  
line decor
  HOME:WORK:  
line decor
   
 
HOW DOES IT WORK

There are two hobby R/C servos, a switch, a microcontroller, and a battery pack in this system. Servos requre a positive going pulse, between 1uS and 2uS in duration, about every 10mS. The duration of the pulse tells the Servo where to position its shaft.

I chose a Microchip 16F84A Microcontroller because that's what I had on hand. The code was written in the Microchip IDE.

We have an interrupt running in the microcontroller that is responsible for sending two pulses, one to each servo, every time it goes off. This happens automatically so adjusting the position of the servo is as simple as changing the value in a register.

If you look at the code you'll see the pretty simple logic. Startup, setup the servo's initial position, hang out waiting for the switch to be flipped, when the switch is flipped then open the door, wait for the door to actually open, deploy the 'turn off the switch' hand, wait for the hand to get to the switch and flip it, retract the hand, close the door, and wait for the switch to be flipped.

Can't get much simpler than this.

*** Update 4/24/08 - I got an email from Emmanuel pointing out that the battery stays on all the time and it would be better if a relay or transistor controlled the power to the device. He's right - I demo the box occasionally and just connect the battery when I'm showing it off. It would be better if I could leave the battery plugged in all the time. Thanks Emmanuel.