This switches the lights on when you enter the room and turns them off when you exit. It is made using a nxt mindstorms kit. The video shows the lights switching on and off when I enter and exit. It can tell when someone walks in because it has an ultrasonic sensor. The program is the last file.
Step 1: Building the Mechanism
It is basically just a reciprocating mechanism. It is very simple and it is taped to the wall. Also the way that the bar keeps from falling is a piece of backwards tape, taped over by a piece of frontwards tape.
The ultrasonic sensor is mounted to the nxt brick.
If enough people show interest in this project I will probably make a lego digital designer file (that's kind of like cadd but for legos)