These are great to limit movement and detect moving device in a small area. Very compact. 5V 

Easy install, single screw to mount and premade header cable to attach to your electronics. 

Mini Break Sensor/Limit Switch

C$12.00Price