Foundations · Hardware

Sensors & Instrumentation

A PLC is blind without sensors — they're how the controller perceives the physical world. But there are dozens of types, and picking the wrong one wastes a commissioning day. This lesson is the practical field guide: what each sensor actually detects, how it wires in, and — through a "pick the right sensor" simulator — how a real engineer reasons from the application to the part number.

🧲 proximity👁️ photoelectric🌡️ temperature📊 4–20 mA loops
01 · Two kinds of signal

Discrete vs analog — the first fork

Every sensor produces one of two signals, and that decides which PLC input it lands on:

🔲 Discrete (digital) — yes/no

"Is the part there?" "Is the door closed?" One bit: ON or OFF. Proximity switches, photo-eyes and limit switches are discrete. They land on a digital input card.

📈 Analog — how much

"What temperature?" "How full?" A continuous value, usually a 4–20 mA current or 0–10 V. Pressure, level, temperature and flow transmitters are analog. They land on an analog input card and get scaled in code.

🧭 First question on every sensor: do I need a yes/no or a measurement? That alone halves your search and picks the input card.

02 · The picker

🎮 Pick the right sensor

Real selection is reasoning from the application: what's the target made of? How far away? Contact allowed? Work the scenarios below — each is a real situation. Pick the sensor a pro would spec, and learn why the others fail.

03 · The discrete family

Presence detectors, decoded

SensorDetectsBest forWatch out
Inductive proxMetal only, no contactDetecting metal parts, end-of-travel, gear teethShort range (~few mm); ignores non-metal
Capacitive proxAlmost anything (liquid, plastic, powder)Level through a tank wall, non-metal partsSensitive to dust/moisture; needs tuning
PhotoelectricAnything that blocks/reflects lightLonger range, fast counting, small partsShiny/clear targets fool reflective types
Limit switchPhysical contact / lever pushRugged end-stops, doors, dead-simple reliabilityMechanical wear; slower
UltrasonicDistance via sound echoClear liquids, distance regardless of colorFoam, steam, soft targets absorb sound

💡 Photoelectric has three modes: through-beam (emitter + receiver facing — longest range, most reliable), retroreflective (one unit + a reflector), and diffuse (one unit, bounces off the target itself — shortest, simplest).

04 · Measuring the world

Temperature & the 4–20 mA loop

Analog sensors turn a physical quantity into a current the PLC can read. Two things to truly understand: how temperature is sensed, and why the loop is 4–20 mA, not 0–20.

Thermocouple (TC) — two dissimilar metals make a tiny voltage proportional to temperature. Cheap, huge range (to 1000s °C), but low accuracy and needs cold-junction compensation. Types J, K, T differ by metals/range.

RTD (e.g. Pt100) — a resistance that rises predictably with temperature (100 Ω at 0 °C for Pt100). More accurate and stable than a TC, narrower range. Wire it 3- or 4-wire to cancel lead resistance.

Why 4–20 mA? The "live zero": 4 mA = 0% of range. If the wire breaks, current drops to 0 mA — which is below 4, so the PLC instantly knows it's a fault, not a real zero. A 0–20 mA loop can't tell "broken" from "empty."

2 / 3 / 4-wire transmitters — a 2-wire (loop-powered) device draws its power from the same 4–20 mA loop it signals on (simple, fewer wires). 4-wire has separate power and signal. Mis-wiring these is a common first-day mistake.

05 · Field kit

Sensor selection in eight lines

  1. First ask: discrete (yes/no) or analog (how much)?
  2. Metal target, no contact, short range → inductive prox.
  3. Non-metal / level through a wall → capacitive prox.
  4. Longer range, small/fast parts → photoelectric (through-beam = most reliable).
  5. Distance to a clear liquid → ultrasonic (avoid foam/steam).
  6. Wide temp range, cheap → thermocouple; accurate/stable → RTD.
  7. Analog signals ride a 4–20 mA loop — 4 mA = live zero, 0 mA = broken wire.
  8. Match 2/3/4-wire transmitter wiring to the input; RTDs go 3- or 4-wire.