Inductive Sensor in 24 V machine?
The inductive sensors work better when you apply a higher voltage than 5&nbsp;V. Usually they are rated for 6-36&nbsp;V, but please do check.

To prevent frying your board when connecting the sensor to (12 or) 24 Volts you could optically isolate the 5&nbsp;V and the (12 or) 24&nbsp;V circuit with an OptoCoupler module:

Image of an optocoupler module


This module uses an optical switch based on the output of the sensor and should be correctly connected:

Image of connecting an optocoupler module to the sensor and to the board
Please note that the image uses a capacitive sensor rather than a inductive sensor, both are connected similarly


Note that there are many sorts of sensors, a few are listed here. Generally speaking, the larger the diameter of the sensor, the larger the detection distance to the bed. Note that these work well with metal beds (Iron/steel better than Aluminium), but will not work for glass (capacitive sensors work on glass but are prone to drift by moisture in the air, a touch sensor may then be a better alternative).