Using the inductive type sensor IFR10-82-01 produced by Baumer Electric, can be built very simple proximity sensor, using some electronic components.
Sensor used in the circuit, IC1 converts proximity of an object in a current decrease through the sensor. In the absence of an object, the current is about 4 mA, when the object is at a distance of 4 mm from the sensor current is only 1 mA.
Sensor current is converted to voltage by R1. This voltage is applied to the noninverting input of the Schmitt trigger IC2.
When the object is inside the boundary proximity sensor, 5 mm, R3 voltage is higher than the R1, IC2's output becomes logic 1.
R3 voltage depends on the voltage, but for the supply voltages specified in the scheme, it is always greater than the minimum voltage drop on R1, and always less than the maximum voltage drop on R1.