How to Choose a Magnetic Cylinder Switch
How to Choose a Magnetic Cylinder Switch: Position Sensing Explained at Once

How to Choose a Magnetic Cylinder Switch: Position Sensing Explained at Once
Whether a cylinder has actually reached position cannot be judged by eye — you need a magnetic switch to sense piston position. It is the most common position sensor in pneumatic automation. Selection looks simple, but two-wire versus three-wire, PNP versus NPN, and mounting position each hide a detail that, if you get it wrong, causes false triggering or no detection at all.
1. The Principle: Hall Effect vs Reed
A magnetic switch mounts on the outside of the cylinder barrel and senses the position of the magnet ring on the piston to judge whether the piston has arrived. There are two common types: reed (a dry-reed contact, mechanical, low cost, with life limited by the number of switching operations) and Hall effect (a solid-state element, contactless, long-lived, fast to respond). For high cycle rates, choose Hall effect.
2. Two-Wire vs Three-Wire, PNP vs NPN
| Item | Description | Watch out for |
| Two-wire | Two conductors, wired in series in the circuit | Simple wiring; watch leakage current and polarity |
| Three-wire | Supply + signal + common | NPN and PNP must be distinguished and matched to the PLC |
| NPN / PNP | Output level convention | NPN switches low, PNP switches high; must match the controller input type |
Before wiring, confirm whether the controller input is NPN or PNP — choose the wrong one and the signal cannot be read at all. Two-wire versions carry leakage current, which matters when driving small loads.
3. Matching the Cylinder Magnet and Mounting Position
The switch must match the cylinder’s piston magnet: a standard cylinder without a magnet ring cannot take a magnetic switch at all. Mounting position sets the sensing point — fix the switch with a mounting band or in the barrel groove, stroke the cylinder to the target position, then fine-tune the switch until the signal triggers reliably. Keep it away from strong magnetic fields and heavy currents to prevent false triggering.
Field Notes: Three Lessons from the Line
- Forcing a magnetic switch onto a standard cylinder — with no magnet ring on the piston it will never sense anything. Confirm the cylinder is magnetic first.
- NPN/PNP wired the wrong way round — the PLC reads nothing. Check the controller’s input type before wiring.
- Switch not locked down — it drifts under running vibration and the end-of-stroke signal comes and goes. Tighten it and re-check after installation.
Conclusion
Four points decide the selection: Hall or reed (life), two-wire or three-wire (wiring), NPN or PNP (controller), and whether the cylinder has a magnet ring (precondition). Align all four and position sensing is reliable.
Suggested Illustrations
- A magnetic switch mounted on the barrel, sensing the piston magnet ring.
- Wiring diagrams for two-wire and three-wire (NPN/PNP) versions.
- Fine adjustment of the switch along the mounting groove.
The above content was compiled by the LEANYEE pneumatic technical team from hands-on commissioning experience, for reference by industry peers.
Technical Disclaimer
The fitting selection, thread types, and technical parameters discussed in this article are based on applicable international standards, including ISO 4414 (Pneumatic Fluid Power — General Rules and Safety Requirements), ISO 8573 (compressed air quality), ISO 6358 (flow characteristics), and relevant thread standards such as ISO 7-1, ISO 228-1, and ANSI/ASME B1.20.1, together with publicly available technical information from international manufacturers such as SMC, Festo, and Parker.
This article is intended for general technical reference only. Actual performance may be affected by cylinder bore size, load, operating pressure, temperature, piping layout, and other application-specific factors.
On-site testing and commissioning are recommended where necessary. Always refer to the product documentation and technical parameters confirmed by the manufacturer for the specific product being used.
LEANYEE Technical Team



