Magnetic sensors are one of those components that quietly do their job in the background. No drama. No flashing display. No big mechanical movement. They simply detect a magnetic field and send a signal when the right condition is met.
Simple idea, actually.
But the technology behind them is more interesting than it first looks. Magnetic sensors are used in automation, machinery, pneumatic cylinders, level detection, position monitoring, and many other industrial applications where a reliable non-contact signal is needed. And that last part matters a lot: non-contact. No physical touching, no worn-out mechanical switch, no little lever getting bent after a few months in a dirty machine.
In many factories, that is already a win.
What Is a Magnetic Sensor?

A magnetic sensor is a device designed to detect the presence of a magnetic field. Usually, this magnetic field comes from a permanent magnet. When the magnet moves close enough to the sensing area, the sensor detects it and changes its output state.
In most industrial applications, the output is digital. That means the sensor usually works like a simple on/off device.
Magnet present? Output switches.
Magnet gone? Output changes back.
Of course, the internal electronics are doing more than that, but from the control system’s point of view, it often looks like a normal switching signal going to a PLC input, relay module, controller, or machine safety system.
The big advantage is that magnetic sensors can detect a magnet without needing direct contact. This makes them very useful where mechanical contact would be unreliable, unsafe, or just annoying to maintain.
How Magnetoresistive Sensors Work
One common technology used in magnetic proximity sensors is the magnetoresistive element.
This element is made from a special material that reacts to magnetic fields. When a magnetic field is present, the electrical resistance of the material changes. The sensor electronics then evaluate this change and convert it into a usable output signal.
In normal words: the sensor “feels” the magnetic field and then gives the machine a signal.
Magnetoresistive technology is known for being very sensitive. In many cases, it can detect weaker magnetic fields than a traditional Hall-effect sensor. This allows the sensor to work over a longer sensing distance, depending on the magnet strength, installation position, and the material between the magnet and the sensor.
That can be very useful in real applications. Because, let’s be honest, machines are rarely perfect. Sometimes the sensor cannot be mounted exactly where you want it. Sometimes there is a plastic wall, a stainless-steel barrier, a tank wall, or some awkward bracket in the way. A more sensitive sensor gives you a bit more breathing room.
Not magic. But helpful.
Omnipolar Detection: North or South Pole
Another useful feature of many magnetoresistive proximity switches is that they are omnipolar.
This means they can detect both the north pole and the south pole of a permanent magnet.
Why is that good?
Because installation becomes easier. The sensor does not always need the magnet to be installed in one specific orientation. In many applications, especially during machine building or maintenance, that saves time and reduces silly mistakes. And yes, those silly mistakes happen more often than people like to admit.
With omnipolar detection, the sensor reacts to the magnetic field regardless of whether the north or south pole faces the sensing element.
Detecting Through Non-Ferromagnetic Materials
One of the most practical advantages of magnetic sensors is their ability to detect magnetic fields through non-ferromagnetic materials.
Non-ferromagnetic materials include many plastics, aluminum, stainless steel, glass, and some other non-magnetic barriers. The sensor does not need direct visual contact with the magnet. It only needs the magnetic field to reach it strongly enough.
This is very useful when the sensor or magnet must be protected from the process environment.
For example, imagine a tank where the sensor cannot be placed inside because of liquid, pressure, dirt, chemicals, or hygiene requirements. Instead of putting the sensor directly into the tank, a magnet can be placed on one side and the sensor on the outside. If the tank wall is made from a suitable non-ferromagnetic material, the magnetic field can pass through it and still be detected.
That is where magnetic sensing becomes really handy.
No holes. No mechanical linkage. No exposed switch inside the process.
Just a magnet, a sensor, and a signal.
Detection Through Tank Walls
Tank wall detection is a common example where magnetic sensors make life easier.
In level monitoring systems, a float with an integrated magnet may move up and down with the liquid level. A magnetic sensor mounted outside the tank detects the magnet position through the tank wall. When the float reaches a certain level, the sensor switches.
This type of setup is often used where the electronics need to stay isolated from the liquid. It can also reduce the risk of leaks because the tank wall does not need to be opened for the sensor itself.
The same principle can be used in many other protected installations. Any time the sensor and magnet need to be separated by a non-magnetic wall, magnetic detection can be a good solution.
There is one important detail, though. The wall material matters. Magnetic fields can pass through many non-ferromagnetic materials, but ferromagnetic materials like standard steel can disturb or block the magnetic field. So, before choosing this type of solution, the material, distance, magnet strength, and sensor sensitivity should all be checked.
Not after installation. Before. Saves nerves.
What Are Magnetic Cylinder Sensors?
Magnetic cylinder sensors are sensors used to detect the position of a piston inside a pneumatic or hydraulic cylinder.
Inside many cylinders, the piston contains a permanent magnet. As the piston moves back and forth, the magnet moves with it. A cylinder sensor mounted on the outside of the cylinder detects this magnetic field when the piston reaches the sensor position.
This allows the control system to know where the cylinder is.
For example:
- Cylinder extended
- Cylinder retracted
- Cylinder in an intermediate position
In automation, that feedback is extremely important. A machine often needs to know that one movement has finished before starting the next one. Without reliable position feedback, the sequence can fail, parts can crash, or the machine can simply stop with an error.
And usually, it stops at the worst possible time. That’s the law of machines, apparently.
How Cylinder Sensors Are Mounted
Most modern pneumatic cylinders have slots designed for sensor mounting. The sensor is placed into the slot and secured in the correct position. Once the sensor is fixed, it detects the piston magnet when the piston reaches that point.
For cylinders without integrated slots, sensors can usually be mounted with clamps, brackets, or special adapters. These accessories allow cylinder sensors to be used on round cylinders, tie-rod cylinders, profile cylinders, compact cylinders, and many other common cylinder types.
The sensor position can normally be adjusted during setup. This is important because the switching point must match the real piston position required by the machine process.
A common example is an end-position signal. The sensor is adjusted so it switches when the piston is fully extended or fully retracted. In some applications, an additional sensor may be used to detect a middle position.
Why Use Magnetic Cylinder Sensors?
Cylinder sensors are popular because they are compact, simple, and reliable when installed correctly.
They do not need to touch the piston. They do not need a mechanical arm. They do not require a complicated measuring system for basic end-position detection. The piston magnet passes near the sensor, the sensor switches, and the controller receives the information.
Clean and practical.
Another benefit is that the sensor is mounted outside the cylinder body. This makes replacement and adjustment much easier compared with internal position detection systems. If a sensor fails or needs repositioning, it can usually be accessed without opening the cylinder.
That is a big maintenance advantage.
Common Applications
Magnetic and cylinder sensors are used in many areas of industrial automation. Some common examples include:
- Pneumatic cylinder end-position detection
- Hydraulic cylinder position feedback
- Tank level detection with magnetic floats
- Door and cover position monitoring
- Object position detection using permanent magnets
- Packaging machines
- Assembly machines
- Material handling systems
- Pick-and-place equipment
- Process automation systems
In short, anywhere a magnet can move and a sensor can detect it, this type of technology may be useful.
Things to Consider During Installation
Magnetic sensors are simple, but they still need proper installation.
The sensing distance must be suitable for the magnet being used. A weak magnet, large air gap, or thick barrier can reduce detection reliability. The sensor also has to be aligned correctly with the magnetic field. Sometimes moving the sensor just a few millimeters makes the difference between a stable signal and a frustrating intermittent fault.
Cable routing matters too. Sensor cables should be protected from mechanical damage and, where possible, kept away from strong electrical noise sources such as motor cables, contactors, and frequency drives.
Another thing: check the output type before connecting it.
Many industrial magnetic sensors are available with PNP, NPN, normally open, normally closed, or even more specific output versions. Connecting the wrong type to a PLC input can lead to confusion during troubleshooting. The sensor may be perfectly fine, but the input never reacts because the wiring logic is wrong.
Classic headache.
Final Thoughts
Magnetic sensors and magnetic cylinder sensors are widely used because they solve a very common problem: detecting position without mechanical contact.
A magnet creates the field. The sensor detects it. The control system gets a clean signal.
That is the basic idea.
Magnetoresistive sensors are especially useful where higher sensitivity and longer sensing distances are needed. They can detect weak magnetic fields, often through non-ferromagnetic materials, and many versions can react to both north and south poles of a magnet.
Cylinder sensors apply the same principle to pneumatic and hydraulic cylinders. The piston carries a magnet, the sensor sits outside the cylinder, and the machine knows when the piston has reached the required position.
It’s not the fanciest technology in automation, but it is one of those things that keeps machines moving properly. Quietly. Reliably. And when it fails, everyone suddenly remembers how important that tiny sensor was.
