A touch sensor is a device that detects and records physical contact or proximity, often used to enable user interaction with electronic devices. It operates by converting the touch input into an electrical signal, which can then be interpreted by a device's software to perform specific actions.