Things You'll Need
Instructions
Mount a momentary contact switch with normally-closed contacts at the location at which the moving part of your device must stop. The moving device must touch the pushbutton knob and depress it. You can use a microswitch or a pushbutton switch.
Wire the switch contacts in series with the motor and its associated circuity. The circuit can be AC or DC, and if using DC, there is no need to be concerned about polarity at the switch contacts, since these switches are not polarity-sensitive.
Connect the two limit switch contacts to other circuity, rather than in series with the motor if you have an application where the motor's direction needs to be reversed once the limit switch has been activated. This will require the use of a DC motor, where a reversal of polarity on the motor's connections will cause the armature to rotate in the opposite direction.