A sensor is a type of transducer whose purpose is to detect events or changes in its environment, and then provide a corresponding output. Sensors may provide various types of output, but typically use electrical or optical signals.