PLC Sim Lab
Industrial sensors

Reed switch and cylinder sensors

How does a PLC know a pneumatic cylinder has extended? Usually through a small sensor clipped into a slot on the cylinder body. It detects a magnet built into the piston, with no lever or bracket needed.

2 min read · Updated 2026-10-02

The reed switch

A reed switch is two thin ferromagnetic contacts sealed in a glass tube. When a magnetic field comes close, the reeds are magnetised, attract each other and close the circuit. Remove the field and they spring apart. No power is needed to operate it.

Cylinder position sensing

Most pneumatic cylinders are available with a magnetic piston: a ring magnet in the piston. A sensor mounted in the cylinder's T-slot or C-slot switches when the piston passes under it. Fit one at the retracted end and one at the extended end, and the PLC knows both positions.

Slide the sensor along the slot with air on and the cylinder at its end position until the LED lights, then move it a little further towards the end and tighten it.

Types of cylinder sensors

TypeWiringNotes
Reed, 2-wirein series with the PLC inputcheap; contacts wear and can stick; LED drops a few volts
Solid-state (magneto-resistive / Hall), 3-wirebrown +, blue −, black output; PNP or NPNno moving parts, faster, longer life; preferred today

Common faults

Using it in the program

A typical cycle: energise the solenoid valve to extend → wait for the "extended" sensor → start the next step. Add a timer as a watchdog: if the sensor is not reached within, say, 3 seconds, raise a "cylinder fault" alarm.

The PLC Sim Lab Playground has double-acting cylinders with built-in position sensors and an air supply you can wire up and program.

Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.

Open the Playground →Guided lessons →