Sensors can have many different types of outputs. The possible outputs of a sensors detemine in which applications the sensor can be used. Vice versa, the same can be said: the type of application detemines which sensor you need.
In this article we discuss the different possible outputs. how these work and for which use cases these can be applied.
Digital vs. Analog
First, we make a distinction between two types of outputs: an analog and a digital output. A sensor with a digital output signals a logical value. In other words: Yes or No, 0 or 1, True or False, Valid or Invalid . A digital output is very well-suited to indicate the presence of an object (at a certain distance) or detecting whether a set limit value has been reached. Does the sensor "see" the object or not? Is the value reached or not? During a detection or non-detection the logical value changes from a 0 to a 1, or vice versa! Examples of digital (switching) outputs are PNP/NPN, relay, solid state relay and PushPull.
A sensor with an analog output is capable of giving a signal that is continuously partallel to the measured value. An analog signal is a signal that can register values without intervals. Think of a constantly fluctuating temperature in an outdoor location, such as the conveyor belts in the production of steel beams: the analog output changes parallel en mostly linear with the change of the measurement of the sensor. Another example is the change of a distance from 0 to 1.000 cm or a temperature drops from 200°C to 20°C. Examples of analog outputs are 0-10 Vdc, 4-20 mA, 0-5 Vdc or 0-20 mA.
Types of digital outputs: PNP or NPN
Sensors with a PNP or NPN switching contact make use of a transistor output. The type of transistor output determines whether the sensor switches PNP or NPN. Sensors with a PNP or NPN switching output are equipped with at least three wires; A " + " (Pin 1 / brown wire), a " – " (Pin 3 / blue wire) and a switching wire (Pin 4 / black wire).
PNP switching output

NPN switching output

PushPull switching output

Solid State Relay (SSR) output

Normally Open, Normally Closed or Antivalent output
All sensors with a digital switching contact, whether it is a PNP/NPN, solid state or PushPull contact have the ability to switch Normally Open (NO) or Normally Closed (NC). In some cases the sensors only switch NO or NC. If a sensor is capable of switching NO as well as NC it is called antivalent.
Normally Open (NO) switching output

Normally Closed (NC) switching output

Antivalent switching output

4-20 mA current output

The signal starts at 4 mA instead of 0 mA because, contrary to a 0-10 Vdc output, to be able to make a distinction between a 0 signal and a malfunctioning. Another advantage of using 4-20 mA is that the signal is unaffected by voltage losses in the wiring and is insusceptible to electrical noise.
Advantages:
Fail safe by starting at 4 mA
Insusceptible to voltage losses
Unaffected by electrical noise
Disadvantages:
Sometimes pricier
0-10 V voltage output

Types of sensor outputs that work with voltage are more sensitive for electrical noise and are not well-fit for long distance transfers. Because the signal starts at 0V it is harder to detect a malfunction then with a current output. A voltage output is in some cases cheaper to produce, which explains the higher price for an analog sensor with a 4-20 mA output instead of a 0-10V one.
Advantages:
Available on most sensors, controllers and PLCs
Cheap to produce
‘Straight forward’ signal processing
Disadvantages:
Sensitive to electrical noise
Affected by voltage losses
Not fail safe, starts at 0 V