A sensor is a device that converts a physical quantity, such as light, sound, heat, or pressure, into an electrical signal. Sensors are used in many everyday objects, such as thermostats, smoke detectors, and cameras.
There are two main types of sensors: those that measure absolute quantities and those that measure relative quantities. Absolute sensors measure the actual value of the quantity being measured. For example, a thermometer measures the temperature in degrees Celsius or Fahrenheit. Relative sensors measure changes in the quantity being measured. For example, a pressure sensor might output a voltage that is proportional to the change in pressure.
The accuracy of a sensor depends on its sensitivity and linearity. Sensitivity is the ability of a sensor to detect small changes in the quantity being measured. Linearity is the degree to which the output of a sensor varies linearly with changes in the quantity being measured. For example, if you were measuring water level with a float-type sensor , you would expect it to be very sensitive (able to detect small changes in water level) but not very linear (because the amount by which the float rises or falls will not change linearly with changes in water level).