OSE Use Case
- OSE currently uses the LJ18A3-8-Z/BY-5V sensor. Sourcing - 
- This allows for a longer sensing distance, which is useful for larger machines (1 meter bed and larger)
Inductive sensors are used to sense the Z height on 3D printers. They detect metal.
For Marlin with RAMPS - use one that is driven with 5V, as opposed to 12V, as RAMPS cannot handle 12V without using additional components (voltage divider with two resistors).
Part numbers look like LJ18A3-8-Z/BY-5V for the 2018 D3D with LCD screen - where we use the 8 mm distance sensing to facilitate the sensor not hitting the print bed.
- 5V is the critical part - 5V input - so can be powered from the RAMPS board directly
- LJ18 - the 18 refers to the diameter of the sensor in mm (actually, M18 external threading)
- -8- refers to the distance of sensing in mm
- Z refers to DC (vs. AC)
- B refers to normally open (vs. normally closed)
- Y refers to PNP (vs. NPN)
Tom's Guide 1
- Mentions 12v sensor with voltage divider. Video description sources the 5V sensor
Tom's Guide 2
- Comparison - essentially, all distance sensing inductive sensors are quite good.
- From Aliexpress -
- 3 Wire Polarity: NPN Detection
- Voltage: DC 5V
- Ouput Status: Normally Open
- Part number: LJ18A3-8-Z/BX
- See part numbers and what they mean at Aliexpress - 
The BX vs. BY is NPN vs. PNP (both normally open) - wiring is different!
How to wire LJ18A3-8-Z/BX vs. Z/BY?
- For normally open, Z_MIN_ENDSTOP_INVERTING in configuration.h of Marlin should be set to false? See 
- NPN vs PNP - 
- See D3D BOM for sourcing.
- See D3D Height Controller for design
5V vs. 6-36V
As already mentioned, pick the 5V version of the sensor if it is available to you. The 6-36V version can be a drop-in replacement by powering it with 5V. However, the sensor will be less sensitive. This approach has been tested to work with printers built in Ghent at January 2020 STEAM Camp.
However, there is one source that has done extensive testing and claims that driving 6-36V versions of sensors with 5V only succeeded for an 8mm-distance capacitative sensor, so no inductive sensor worked out :
#2 You can just run a standard 6 to 36V probe from 5V Ok, this one is actually easy to test. Out of all the 6 to 36V probes, none worked on 5V except the 8mm capacitive one. And even then, it was much less sensitive than on 12V and only triggered against metal parts, while with the higher supply voltage and a voltage divider on the output, it reliably also triggered against printed parts and had a larger trigger distance than on 5V.
PNP: Voltage Divider
The "proper" approach seems to drive the (PNP) sensor within the correct voltage range (6-36V) and to use a voltage divider circuit (eg., 15K and 10K for 12V) so that the pin that reads the sensor voltage gets no more than 5V (12 * 10/25 = 4.8). Schematics for 12V  
NPN: Two voltage sources (UNTESTED)
A PNP sensor (3 wires) takes
- an input voltage that drives the sensor (any voltage between 6-36V). A typical setup would use 24V from the RAMPS board.
- 5V thru a pull-up resistor (eg. 10K). A typical setup would use 5V from the Arduino.
- common ground (for 5V and 6-36V)
Schematic with 12V and 5V