Component guide · Intermediate · 3 min read
Inductive and Capacitive Proximity Sensors (NPN, PNP)
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
An inductive proximity sensor detects metal without touching it, using a magnetic field from a coil in its tip. A capacitive sensor also detects plastic, wood and liquids. Industrial types such as the LJ12A3 run on 6 to 36 V and have three wires: brown (+), blue (0 V) and black (signal). NPN types pull the signal to 0 V when triggered, which is the easiest to read with a microcontroller.
Key specs at a glance
- Supply
- Commonly 6 to 36 VDC (check the label)
- Wires
- Brown = +V, Blue = 0 V, Black = output
- Output types
- NPN or PNP, normally open or normally closed
- Sensing distance
- A few mm, e.g. 4 mm for an M12 inductive sensor on steel
- Targets
- Inductive: metals. Capacitive: most materials, adjustable sensitivity
- Uses
- CNC homing, conveyor counting, bed levelling probes, level detection
How they work
An inductive sensor drives a coil at high frequency. When metal comes close, eddy currents in the metal damp the oscillation and the electronics switch the output. Steel triggers at the full rated distance; aluminium and copper trigger much closer, often at less than half the distance.
A capacitive sensor measures changes in capacitance at its face, so it reacts to almost anything, including liquid through a plastic tank wall. A screw on the back sets the sensitivity.
Both have no moving parts, so they outlast mechanical limit switches in dirty or high-cycle machines.
NPN vs PNP and reading them safely
the black wire connects to 0 V when triggered and floats otherwise. Connect black to an input with a pull-up to your logic voltage. Because the output only sinks, a 5 V or 3.3 V pull-up is safe even when the sensor runs on 12 V, provided the grounds are shared. Many sensors already pull up internally to their supply voltage, so check the output with a multimeter first; if it shows 12 V when idle, add a divider or an optocoupler.
the black wire goes to +V (for example 12 or 24 V) when triggered. Never connect it straight to a microcontroller: use a voltage divider, an optocoupler or a level-shifting transistor.
NO means the output is active when a target is present; NC means it is active when nothing is there.
Using one as a 3D printer bed probe
An inductive probe can replace a Z endstop on printers with a steel bed or steel sheet. Wire the NPN version with an optocoupler or a diode-and-pull-up circuit suited to your board, set the offset in firmware, and remember it will not see glass; it senses the metal underneath, so the trigger point changes with bed thickness. See bed levelling.
Try it: Voltage divider calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Connecting a PNP output directly to a 3.3 V or 5 V pin.
- Assuming the rated distance applies to aluminium.
- Not sharing ground between the sensor supply and the microcontroller.
- Running a 6 to 36 V sensor from 5 V and getting no output.
- Expecting an inductive probe to sense a glass bed.
Frequently asked questions
What do the brown, blue and black wires mean?
Brown is the positive supply, blue is 0 V and black is the switched output.
Should I buy NPN or PNP for Arduino?
NPN is easier, because it pulls the input to ground and works with a pull-up to your logic voltage.
Can an inductive sensor run on 5 V?
Most industrial types need at least 6 V and many work best at 12 V. Some have 5 V versions.
Why does my sensor only detect steel up close?
Non-ferrous metals and thin targets reduce the sensing distance; check the correction factors in the datasheet.
What is a capacitive proximity sensor used for?
Detecting liquid level through a tank wall, grain in a hopper, or non-metal parts on a conveyor.
Parts for this guide
Calculators
Terms in this guide
Keep learning
Sources
- Omron E2E inductive sensor technical guide
- LJ12A3-4-Z/BX inductive sensor datasheet
- IEC 60947-5-2 proximity switch conventions
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.



