Sensor
Definition
A device that detects something in the physical world — light, motion, temperature, pressure — and turns it into an electrical signal a computer can use.
Technical definition
A transducer that converts a physical quantity into a measurable electrical signal. Common types include photodiodes (light), MEMS accelerometers (acceleration), thermistors (temperature), and Hall-effect devices (magnetic fields).
Example
Your phone's accelerometer is a microscopic spring-mass system etched in silicon: when you tilt the phone, a tiny mass shifts, changing capacitance, and the chip reports the acceleration — which is how the screen knows to rotate.
A sensor does not 'understand' what it measures — it only converts one physical quantity into another, usually voltage. All the interpretation (is the phone face-up? how fast is the car?) happens in software reading the sensor's raw signal.