A sensor is a device that detects physical changes or events in an environment and converts them into a signal.