Sensor Wiring Diagram
This is a free printable sensor diagram: download the diagram as SVG or open it and print to paper or PDF.
A reference for wiring proximity sensors, PIR sensors, and analogue transducers to PLC inputs and control circuits, including 2-wire, 3-wire, and 4-wire sensor configurations.
Sensors are the input devices that allow a control system — whether a PLC, relay circuit, or microcontroller — to detect physical world conditions such as object presence, temperature, pressure, light level, and motion. Correct sensor wiring is critical: an incorrectly wired sensor provides no signal, a permanently active signal, or erratic input behaviour that is difficult to distinguish from a real process condition.
Sensors are classified by their output type and their wiring configuration. The output type can be discrete (digital on/off), which includes proximity sensors, limit switches, and PIR motion sensors; or analogue (variable signal), which includes temperature transmitters, pressure sensors, and flow meters.
For discrete digital sensors, the most important distinction is between NPN and PNP output types, which determines how the sensor connects to the control input:
A PNP sensor (sourcing output) sources current from its output terminal — when active, the output terminal goes high (+Vcc), providing current to the input. PNP sensors connect to sourcing input modules (also called current-sinking inputs from the module's perspective).
An NPN sensor (sinking output) sinks current through its output terminal — when active, the output terminal pulls toward 0V, sinking current from the input. NPN sensors connect to sinking input modules.
Sensor wiring configurations are described by their wire count. A 2-wire sensor has only a supply wire and a return wire — the sensor is wired in series with the load (like a switch). A 3-wire sensor has a supply (+), a return (0V), and a separate output wire — this is the most common industrial configuration. A 4-wire sensor has supply, return, and two separate output wires (NO output and NC output on the same device).
For analogue sensors, the 4–20 mA current loop is the industrial standard. A 4 mA signal represents the minimum measured value (e.g., 0 bar pressure); 20 mA represents the maximum (e.g., 10 bar). The current loop is immune to voltage drop in the wiring — signal accuracy does not degrade with cable length, which makes it ideal for sensors located far from the control panel. Two-wire transmitters derive their operating power from the loop current itself.
How to wire sensor diagram
- Identify the sensor type and output configuration Locate the sensor's product label or datasheet. Identify: the output type (PNP or NPN for discrete sensors; 4–20 mA, 0–10V, or other for analogue sensors), the supply voltage (typically 10–30V DC for industrial sensors), and the wire count (2-wire, 3-wire, or 4-wire). Also identify whether the output is normally open (NO) or normally closed (NC) in the de-actuated state.
- Verify input module compatibility For discrete sensors: confirm whether the PLC or relay input is sinking (NPN-compatible, COM to +24V) or sourcing (PNP-compatible, COM to 0V). PNP sensors connect to sourcing inputs; NPN sensors to sinking inputs. For analogue sensors: verify the input module supports the signal type (4–20 mA current, 0–10V voltage, or specific sensor type).
- Connect the sensor supply voltage Connect the sensor's brown wire (+Vcc) to the 24VDC positive rail. Connect the blue wire (0V return) to the 24VDC negative/0V rail. Use the same 24VDC supply that powers the I/O module to avoid ground loops. Measure supply voltage at the sensor with the cable fully routed — voltage should be within the sensor's operating range (typically 18–30V DC for industrial sensors with 24V nominal supply).
- Connect the output signal wire For a PNP 3-wire sensor: connect the black output wire to the PLC's sourcing digital input terminal. When the sensor is active, current flows from the sensor output (+24V) into the input terminal. For an NPN 3-wire sensor: connect the black output wire to the PLC's sinking digital input terminal. When active, current flows from the input terminal through the sensor output to 0V. For 4–20 mA analogue sensors: connect the output to the AI channel's IN+ terminal; the return connects to IN–.
- Test the sensor output before connecting to the control system With the sensor powered, use a multimeter in DC voltage mode to measure the output wire voltage relative to 0V. A PNP output should read near +24V when active and near 0V when inactive. An NPN output should read near 0V when active and near +24V when inactive. For 4–20 mA sensors, use a milliamp meter in series to verify the output current varies from approximately 4 mA at minimum to 20 mA at maximum measured condition.
- Adjust sensing range and verify function in the system For proximity sensors with adjustable range, set the sensing distance to approximately 70% of the maximum detection range — this provides a stable switching point without chattering near the boundary. For PIR motion sensors, adjust sensitivity and time-out settings per the application. Verify each sensor activates the correct PLC input by monitoring the I/O status in the programming software while actuating each sensor.
Specifications
| Industrial sensor supply voltage (typical) | 10–30V DC (IEC 60947-5-2 standard range) |
|---|---|
| Standard analogue signal (current loop) | 4–20 mA (live zero = 4 mA; full scale = 20 mA) |
| Standard analogue signal (voltage) | 0–10V DC or 1–5V DC |
| PNP output voltage when active | Vcc minus voltage drop (typically Vcc – 2V maximum) |
| NPN output voltage when active | Near 0V (typically < 2V) |
| Sensor output current rating (typical 3-wire) | 100 mA maximum continuous output current |
| 4–20 mA transmitter loop supply voltage (typical) | 24V DC; minimum loop voltage at transmitter: 12V DC |
Safety warnings
- Always de-energise the control panel and verify dead at the terminal blocks before connecting or disconnecting sensor wiring inside the panel. While 24V DC sensor circuits are low voltage, PLC panels also contain mains supply voltages — do not work in an energised panel.
- Verify sensor supply polarity before connection. Reverse polarity connection destroys most electronic sensors instantly. Most sensors have built-in reverse polarity protection, but do not rely on this — always verify with a multimeter before connection.
- Sensor wiring must comply with applicable electrical and EMC standards — IEC 60947-5-2 (proximity switches), IEC 61326-1 (equipment for measurement and control electromagnetic compatibility), and the relevant installation code for the application.
- In hazardous area applications (explosive atmospheres), only use sensors certified for the applicable zone classification (ATEX, IECEx, or NEC Class/Division). Standard sensors must not be used in classified hazardous locations.
- For 4–20 mA current loops powering safety-critical measurements, use appropriately rated safety transmitters and verify the loop signal against a calibrated reference instrument before relying on the signal for control decisions.
Tools needed
- Digital multimeter (DC voltage and milliamp current measurement)
- Milliamp calibrator / loop simulator (for 4–20 mA commissioning)
- Non-contact voltage tester
- M12 connector crimping tool (for field-wireable connectors)
- Wire stripper (suitable for small cross-section sensor cables)
- Ferrule crimping tool (for stranded sensor cable terminations)
- Oscilloscope (optional, for examining sensor output noise or chattering)
Common mistakes
- Connecting a PNP sensor to an NPN-compatible (sinking) input module or an NPN sensor to a PNP-compatible (sourcing) input — input either never activates or is permanently active.
- Using an unshielded cable in electrically noisy environments (near variable frequency drives, contactors, or large motors) — causes false triggering on proximity sensor or analogue signal noise.
- Connecting the 4–20 mA transmitter output in a voltage-input analogue module without a shunt resistor — the module expects a voltage; without the resistor the current has no return path and the reading is incorrect.
- Powering multiple sensors from the same 24V supply branch without individual fusing — a short circuit on one sensor cable takes out all sensors on the branch.
- Setting the sensing range at the maximum detection distance — slight variations in target position, temperature drift, or power supply variation cause the sensor to chatter at the boundary. Set to 70% of maximum range.
- Not verifying sensor function before integrating into the control program — a sensor wired to the wrong PLC address address causes the wrong program function to activate.
Troubleshooting
- Proximity sensor LED illuminates when target is present but PLC input does not activate
- Cause: Sensor output type (PNP/NPN) does not match the input module type, or the output wire is not connected to the input terminal Fix: Check the sensor label for NPN or PNP designation and compare to the PLC input module type. Measure voltage on the sensor's black output wire relative to 0V — PNP: should read approximately +24V when active. If voltage is correct at the wire but the input does not activate, trace the connection from the sensor cable to the actual input terminal.
- 4–20 mA analogue input reads a fixed value regardless of process change
- Cause: Loop is open-circuit (sensor not powered or wiring broken), or input is reading a fixed offset from noise Fix: Break the loop and insert a milliamp meter in series to directly measure loop current. Vary the process condition (or simulate with a milliamp calibrator). If the meter reads correct current but the PLC still reads fixed, the problem is in the module configuration or wiring between the field terminal and the module. Verify the cable termination at the AI channel terminals.
- PIR motion sensor triggers randomly without any movement in the detection zone
- Cause: Sensor is detecting radiated heat from nearby sources (lighting, HVAC vents, sunlight through windows) rather than human motion Fix: Relocate or reorient the sensor away from heat sources and direct sunlight. Reduce sensitivity if the sensor has an adjustable setting. Verify the detection zone does not include areas with intermittent heat sources (e.g., air conditioning vents that cycle on and off).
Frequently asked questions
What is the difference between a PNP and NPN sensor output?
A PNP sensor (sourcing output) drives its output to +Vcc when active, sourcing current to the connected input. An NPN sensor (sinking output) drives its output to 0V when active, sinking current from the connected input. The sensor type must match the input module type — PNP sensors to sourcing inputs, NPN to sinking inputs. Mismatching either leaves the input permanently active or never active.
How do I identify the wires on a 3-wire proximity sensor?
Standard 3-wire sensor colour coding is: brown (+Vcc supply), blue (0V return), and black (output signal). This is per IEC 60947-5-2 (proximity switch standard). Some manufacturers use a fourth wire (white) for a second output. Always verify against the sensor's datasheet — non-standard colour conventions exist, particularly in sensors not manufactured to IEC standards.
What is a 4–20 mA current loop sensor?
A 4–20 mA current loop is the standard industrial analogue signal. The sensor (transmitter) varies the current drawn from the loop in proportion to the measured variable — 4 mA at minimum range, 20 mA at full range. The 4 mA live-zero allows differentiation between a zero-value reading and a broken wire (which reads 0 mA). It is immune to voltage drop and cable resistance, making it reliable over long distances.
Why does my proximity sensor output stay active even when no target is present?
A permanently active output usually indicates an NPN sensor connected to a sourcing input (or PNP to a sinking input). Check the sensor type on its label and match it to the input module type. Alternatively, the sensor may be wired in reverse polarity, or the sensing range may be set so close that a nearby surface is always within detection distance.
What is the maximum cable length for a 4–20 mA sensor?
A 4–20 mA current loop can tolerate significant cable resistance — the maximum cable length is determined by the total loop resistance the transmitter can drive. Most industrial transmitters can drive a total loop resistance of 250–1000 Ω. With 0.5 mm² cable (about 36 Ω per 1000 m round trip), a 250 Ω loop resistance budget allows several hundred metres of cable.
Related diagrams
- 2 wire crank sensor wiring diagram
- 2 wire speed sensor wiring diagram
- 2 wire temp sensor coolant temperature sensor wiring diagram
- 2 wire temp sensor wiring diagram
- 3 wire cam sensor wiring diagram
- 3 wire crank sensor wiring diagram