The controller receives an ON/OFF state after the sensor applies its threshold and hysteresis.
Analog vs Digital Sensors: Choose the Signal Your PLC Can Use
The sensing principle tells you how a device detects the process. The output tells you what information reaches the controller. Separating those two decisions prevents wrong PLC cards, unstable readings, missed pulses, and unnecessary integration work.
Use a digital or discrete output when the PLC needs a state such as present, home, or level reached. Use an analog output when it needs the measured value itself. Use IO-Link when process data, parameters, identification, and diagnostics justify a communication architecture.
Application image: xsz sensor
The controller receives a voltage or current that must be scaled into engineering units.
A master exchanges process data, parameters, identification, events, and available diagnostics.
Start with the control question
Do not begin with a signal name. Write what the PLC must know or decide. That sentence usually reveals whether the machine needs one state, a continuous value, or a richer digital data connection.
"Is the part present?"
Choose a discrete output when one reliable state is enough for the logic.
Verify: sensing margin, PNP/NPN, NO/NC, response time, input filter, and failure behavior."What is the actual level?"
Choose an analog output when control, trending, or quality decisions need the measured magnitude.
Verify: range, 0–10 V or 4–20 mA, load, scaling, accuracy, response, and noise control."What is the value and device status?"
Consider IO-Link when parameters, identification, process data, events, and diagnostics will be used.
Verify: master, port, IODD, process-data mapping, cycle time, replacement, and maintenance workflow."Analog" and "digital" describe the information interface, not the sensing principle.
An inductive, photoelectric, ultrasonic, pressure, temperature, magnetic, or position sensor may be sold with a switching output, an analog output, a communication interface, or more than one option. Always check the exact part number and data sheet.
A discrete sensor makes a local decision: the internal signal crosses a threshold, and the output changes state. The PLC receives a bit. An analog sensor preserves a variable: its output changes across a stated electrical span that represents distance, pressure, level, temperature, position, force, or another quantity. The PLC receives a raw value and converts it to engineering units.
Neither is automatically more accurate. A digital switch may make a repeatable threshold decision without revealing the measured magnitude. An analog sensor may provide fine resolution while the complete measurement still includes sensor error, installation effects, temperature drift, wiring error, input-module error, and scaling configuration.
One process can produce two very different PLC signals.
The diagrams show information shape, not a universal voltage level or timing specification. The real thresholds, span direction, output state, update rate, and electrical limits remain model-specific.
The PLC receives a state
The sensor applies a switching threshold. The output is either inactive or active, even though the physical condition may be changing continuously.
Best fit: presence, end position, threshold alarm, count, or a defined machine state.The PLC receives a changing value
The electrical signal varies with the measured quantity. The controller scales the raw input and can create multiple alarms, trends, or control actions.
Best fit: level, pressure, position, distance, temperature, force, flow, or another magnitude.Five terms buyers often combine into one incorrect question
Each term answers a different design decision. Keeping them separate makes product comparisons and supplier quotes much clearer.
PNP and NPN must form a complete current path with the PLC.
On common three-wire DC sensors, a PNP output generally sources positive current when active. It is paired with an input circuit that accepts that current and returns it to 0 V. An NPN output generally sinks current toward 0 V and is paired with an input circuit that supplies current to the field device.
Input groups, common terminals, module wiring, voltage, current, and connector pinout decide compatibility. Some input cards are configurable, but that does not remove the need to read the exact diagram.
References: OMRON PNP/NPN sensor FAQ and AutomationDirect sinking and sourcing wiring basics.
0–10 V and 4–20 mA solve the same measurement task with different loop conditions
Neither interface is universally better. Compare the complete sensor, cable, supply, input module, grounding, burden, response, diagnostic behavior, and maintenance practice.
0–10 V: simple when the reference and wiring are controlled
A voltage-output sensor drives a receiving input with a specified impedance. The signal is easy to understand, but the measurement depends on a suitable common/reference arrangement and can be affected by loading, conductor resistance, ground-potential differences, and coupled noise.
4–20 mA: robust when the loop has enough voltage headroom
The transmitter regulates loop current within its specified operating limits. Four milliamps represents the normal lower endpoint, creating a live zero that may help the receiving system distinguish a valid low-range value from a zero-current open loop.
| Interface | What reaches the input | Useful fit | Checks before ordering |
|---|---|---|---|
| 0–10 V | Voltage changes across the stated measurement span. | Compatible voltage-input systems with controlled reference, loading, and cable environment. | Check input impedance, common/reference, grounding, shielding, range, and output load. |
| 4–20 mA | Loop current changes from the live lower endpoint to full scale. | Many industrial runs where current signaling, loop powering, or live-zero behavior is useful. | Check supply, compliance, total burden, active/passive loop arrangement, isolation, and fault interpretation. |
| 0–20 mA | Current changes from zero to full scale. | Systems specifically configured for this range. | Check whether a 0 mA process value can be distinguished from an open loop in the control philosophy. |
| 1–5 V | Voltage uses a nonzero lower endpoint. | Compatible voltage inputs or systems deriving voltage from a current loop through a precision resistor. | Check whether the signal is native or converted, plus impedance, grounding, scaling, and total error. |
Technical reference: NI 4–20 mA current-loop fundamentals. For xsz sensor applications, compare 0–10 V and 4–20 mA analog proximity outputs.
A good sensor can still produce a bad PLC value.
Many apparent sensor failures begin at the interface. Diagnose the full acquisition chain before replacing the sensing head.
- Wrong analog range, digital input common, or PNP/NPN pairing
- Insufficient 4–20 mA loop voltage after all burden is included
- Floating reference, ground-potential difference, or unsuitable isolation
- Signal cable routed beside drives, motors, contactors, or high-energy conductors
- Shield and grounding applied by habit instead of the equipment instructions
- Filtering that hides a real dynamic requirement or delays a fast event
Continue with sensor cable shielding for AC and DC installations and the PLC sensor-input wiring guide.
Convert the raw electrical input before making a process decision.
Scaling maps the configured input reading to engineering units. Some PLC modules perform this conversion internally. Others expose current, voltage, or integer counts that the program must scale.
The formula assumes a linear relationship over the configured span. It does not remove transmitter tolerance, installation error, input-module accuracy, temperature effects, calibration status, or filtering delay.
Value = EngLow + ((Raw - RawLow) / (RawHigh - RawLow)) × (EngHigh - EngLow)
Raw can be mA, V, or configured PLC counts. Use the exact module representation.
The usable result belongs to the complete measurement chain
Resolution, repeatability, accuracy, and response time answer different questions. Build the acceptance test around the machine decision.
IO-Link is not the same thing as one ON/OFF wire.
IEC 61131-9 defines the single-drop digital communication interface commonly known as IO-Link. It extends traditional digital I/O toward a point-to-point link that can exchange complex data in both directions.
An IO-Link device connects to an IO-Link master. The master connects onward to the controller or higher-level network. The available process data, parameters, device identification, events, diagnostics, timing, port behavior, and replacement workflow depend on the device, master, IODD, and integration.
References: IEC 61131-9:2022 and the IO-Link System Description.
Choose from the machine question, not from a favorite interface.
These scenarios are starting points. The final output still depends on the real target, process, speed, environment, PLC hardware, diagnostic philosophy, and acceptance test.
The reject logic needs only a reliable event at the correct time.
Control, batching, trending, and multiple alarms need the actual level.
One state and one measured position may need separate signals or a suitable combined device.
Recipes, identification, events, and replacement data must be integrated and used.
Verify the raw signal before trusting the HMI value.
A short, controlled commissioning record makes later troubleshooting much faster and separates sensor behavior from wiring, input, and programming faults.
Sensor, cable, connector, PLC input, master, barrier, isolator, and power supply.
Pinout, common terminals, polarity, loop type, shielding, grounding, and load.
Digital state, mA, V, counts, IO-Link process data, and diagnostic status.
Use a representative target, reference value, simulator, or process condition where permitted.
Maximum speed, shortest pulse, process ramp, noise sources, and restart behavior.
Raw value, scaled value, supply, target/process condition, parameters, and acceptance result.
Move from the machine decision to a verifiable interface
This sequence keeps output type from driving the application definition and gives suppliers enough information to quote the right variant.
Detect each cap, measure level from 0 to 2 m, or report value and device health.
State, continuous value, or process data plus parameters and diagnostics.
Target, medium, range, background, speed, temperature, contamination, mounting, and washdown.
Exact PLC or master, channel type, common, range, isolation, power, load, and timing.
Open circuit, short circuit, power loss, out-of-range, communication loss, and replacement.
Raw signal, scaled value, real speed/noise, diagnostics, limits, and restart procedure.
For broader model selection, use the automation sensor basics guide and verify every quoted field with the sensor data-sheet guide.
The symptom often reveals which layer is wrong.
Capture the raw sensor output, PLC input, scaled value, supply, target/process state, and timing together. Avoid changing several parameters before recording the fault.
| Observed symptom | Likely mechanism | Confirmation check | Corrective direction |
|---|---|---|---|
| Digital input always OFF | Wrong PNP/NPN pairing, input common, supply, NO/NC assumption, broken output conductor, or load limit. | Measure sensor supply and output state, then compare the exact sensor and input-module diagrams. | Correct the circuit and PLC logic; verify voltage, input current, and output-current limit. |
| Digital input flickers | Low sensing margin, vibration, target variation, optical contamination, noise, or unsuitable hysteresis/filtering. | Observe the sensor indicator and raw PLC input while changing gap, alignment, speed, and motion. | Improve target and mounting conditions before adding filtering that may hide the process problem. |
| 4–20 mA stays near an endpoint | Real process endpoint, wrong range, loop-power or burden problem, wiring fault, or transmitter diagnostic state. | Compare measured loop current, sensor indication, supply across the transmitter, and channel configuration. | Resolve configuration, power, burden, or process issues using the exact manuals. |
| Analog value is noisy | EMI coupling, grounding/shield error, ground loop, wrong reference, poor connection, unsuitable filter, or real process variation. | Separate raw input behavior from the scaled display and test against a controlled condition. | Correct installation and input configuration before masking the behavior with software filtering. |
| Value is stable but wrong | Incorrect zero/span, wrong scaling endpoints, installation effect, loading, unit mismatch, or sensor/input accuracy. | Apply a known reference or simulator where permitted and compare raw, configured, and displayed values. | Correct scaling or installation; recalibrate where allowed; choose a range that fits the useful process span. |
| IO-Link communicates but data is wrong | IODD mapping, byte order, unit, scaling, parameters, quality/status interpretation, or replacement settings. | Review master diagnostics, IODD, process-data layout, parameters, and a controlled reference condition. | Map documented data and status, control parameter changes, and test device replacement behavior. |
“Analog sensor” or “digital sensor” is not a complete specification.
Ask for the exact output format, range, wiring style, electrical limits, connection, response behavior, data sheet, and acceptance evidence for the proposed part number.
For supplier-level questions, continue with the industrial sensor supplier selection guide.
Presence, count, distance, level, pressure, position, force, temperature, speed, or quality decision.
Material, size, surface, color, medium, range, background, approach, operating span, and mounting.
PNP/NPN, NO/NC, 0–10 V, 4–20 mA, IO-Link, exact PLC/card/master, desired units, and fault treatment.
Maximum event rate, target length and gap, response, latency, PLC filter, scan, high-speed input, or IO-Link cycle need.
Supply, cable length and route, input burden/load, common, grounding, shielding, isolation, connector, and available ports.
Temperature, vibration, ingress, chemicals, approvals, housing, reference target/value, pass limits, sample quantity, and documents.
Does the proposed signal fit your control hardware and machine decision?
Share the target or process, required information, exact PLC or I/O part number, supply, cable route, environment, timing, and failure behavior. xsz sensor can help identify the output and validation details to confirm before sampling.
Request a compatibility review- State, measurement, or diagnostic information required
- Target, medium, range, geometry, and speed
- PNP/NPN, NO/NC, voltage, current, or IO-Link preference
- Exact PLC input card or IO-Link master
- Cable route, supply, load, shielding, and connector
- Environment, response, fault behavior, and acceptance test
Related sensor output and wiring resources
Use these pages to move from signal choice to a complete, orderable, and testable sensor configuration.
Analog vs digital sensor questions
Is an analog sensor more accurate than a digital sensor?
Not necessarily. Analog and digital describe the output information, not a universal accuracy ranking. Compare the specifications that matter to the task, including accuracy, repeatability, hysteresis, resolution, response, temperature behavior, installation effects, and the complete PLC input chain.
When should I use a digital sensor?
Use a digital or discrete output when the controller needs one state, such as object present, target reached, clamp closed, level switch made, or threshold alarm. Verify sensing margin, PNP/NPN compatibility, NO/NC logic, response time, input filtering, load limits, and failure behavior.
When should I use an analog sensor?
Use an analog output when the PLC needs the measured magnitude for control, multiple alarms, trending, batching, position, quality, or process monitoring. Match the exact electrical range to the input module and define scaling, error, response, cable, grounding, load, and fault behavior.
Is 4–20 mA better than 0–10 V?
Neither is universally better. A correctly designed 4–20 mA loop is often useful in industrial installations because current signaling and a 4 mA live zero can support robust transmission and fault distinction. A 0–10 V interface can be simple and appropriate with compatible inputs and controlled reference, loading, and wiring. Use the exact manuals and a complete loop review.
Are PNP and NPN analog or digital?
PNP and NPN normally describe common DC transistor switching outputs and are therefore usually part of a discrete-output wiring decision. PNP generally sources current and NPN generally sinks current. They do not describe analog accuracy, measurement range, or sensing technology.
Can a sensor provide both switching and measured values?
Yes, some models offer a discrete output plus an analog output, multiple switching outputs, or digital communication carrying a measured value and status. Select the exact variant and confirm how each value reaches, scales, and maps into the controller.
Does IO-Link replace analog sensors?
IO-Link can carry process values digitally through an IO-Link master in suitable architectures. It does not remove the underlying measurement requirements or automatically simplify the project. The device, master, IODD, PLC mapping, timing, parameter control, replacement, and maintenance workflow must support the design.
Why does an analog value jump when the process is steady?
First compare the raw electrical input with the scaled value. Possible causes include real process movement, EMI, routing, shield or ground problems, a floating reference, poor connections, inadequate 4–20 mA loop voltage, wrong input range, unsuitable filtering, or a sensor installation issue. Correct the interface before hiding the symptom in software.
Primary sources used for this guide
- IEC 61131-9:2022 — single-drop digital communication interface for small sensors and actuators.
- IO-Link System Description — masters, devices, process data, parameters, identification, and diagnostics.
- NI 4–20 mA Current Loop Fundamentals — live zero, loop components, current transmission, and system design.
- OMRON PNP/NPN Sensor Output FAQ — common sensor transistor-output distinction.
- AutomationDirect Sinking and Sourcing Wiring Basics — complementary sensor and PLC input paths.
- Rockwell Automation Analog Input Calibration — examples of voltage and current input ranges.
- Siemens Input/Output Connection Examples — digital and analog sensor connection, shielding, and ground-loop cautions.