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.
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
| Type | Wiring | Notes |
|---|---|---|
| Reed, 2-wire | in series with the PLC input | cheap; contacts wear and can stick; LED drops a few volts |
| Solid-state (magneto-resistive / Hall), 3-wire | brown +, blue −, black output; PNP or NPN | no moving parts, faster, longer life; preferred today |
Common faults
- Sensor never switches: cylinder has no magnetic piston, sensor in the wrong position, or a strong magnetic field nearby.
- Double switching: some sensors switch twice as the magnet passes; set the position carefully.
- Reed contact welded: inductive loads or a short circuit welded the reeds; always switch a PLC input, not a coil.
- Sensor slips: vibration moved it; mark the position and tighten properly.
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 →