A sensor is a device that detects a physical quantity — temperature, light, motion, pressure, gas — and converts it into an electrical signal a computer can read.1
Overview
Sensors are the input side of nearly every embedded device. Some output a raw analog voltage that a microcontroller digitizes with its ADC; many modern sensors include their own electronics and present a clean digital reading over I²C or SPI, or as a simple GPIO signal. Common examples include thermistors, accelerometers and gyroscopes, photodiodes, microphones, and pressure and gas sensors.
Where it fits
Sensors give an embedded system awareness of the physical world; paired with network connectivity they are the data source behind the Internet of Things. The microcontroller reads the sensor, decides what to do, and drives an output — closing the loop between sensing and action. A weather station node reporting temperature and humidity over a radio link is a textbook sensor-plus-MCU device.