Limit switch

A limit switch with a roller-lever operator; this is installed on a gate on a canal lock, and indicates the position of a gate to a control system
A limit switch mounted on a moving part of a bridge

In electrical engineering, a limit switch is a switch operated by the motion of a machine part or the presence of an object. A limit switch can be used for controlling machinery as part of a control system, as a safety interlock, or as a counter enumerating objects passing a point.