A sensor is a device that detects some type of event or change in its environment, and responds by reporting or sending that information to an operator or another device.
The input detected by the sensor can be just about any environmental stimuli, including light, heat, motion, moisture, pressure, and more. The sensor detects and measures the change, and transmits that data through some output signal. A sensor that measures temperature, for example, can output that data as voltage signal readable by another device like a display or control component.
Sensors are available in a wide variety of shapes and sizes, with different designs and technologies used to detect specific, individual inputs. Sensitivity and accuracy also vary device to device.