A limit switch is a mechanical device used to detect the presence or absence of an object by using a physical contact. It can be used to detect the position of the object, and is typically used as a safety device to prevent overtravel and damage to machines. Limit switches are typically actuated by either physical contact (such as a plunger or lever) or a proximity sensor such as an infrared or ultrasonic sensor. They can be found in numerous applications, such as controlling machine movements, activating alarms, and controlling lighting.