A switch operated by the motion of a machine part or the presence of an object. When a moving component hits the actuator arm or roller on the switch, it opens or closes an electrical circuit. They are heavily relied upon to stop motors before mechanisms crash into their physical end stops, or to confirm a guard door is closed before a machine can start.
Heard on the job
The gantry crashed into the end frame because the limit switch got packed with grease and stuck closed.