<p>I have a Tevo Tornado Gold 24&nbsp;V. I want to use this LJ12 A3-4-Z/BX Inductive NPN NO 4&nbsp;mm with 6-36&nbsp;V operation current as a Z probe. I do not want to fry my machine by putting in 24&nbsp;V into the sensor input.</p>

<p>What do I have is a 12&nbsp;V, single channel optocoupler isolation module.</p>

<p>I want to know if this 12&nbsp;V optocoupler module can be used with a 24&nbsp;V power supply, or do I need another module in order to prevent me frying my sensor.</p>

<p>If I do need another what would I need?
<a href="https://i.stack.imgur.com/cxoYG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cxoYG.png" alt="enter image description here"></a></p>

Not using a 12 V rated module
"on its own"
.
Using a 12 V/5 V optocoupler to try to connect 24 V to the 5 V circuit is running the optocoupler outside of its rating, meaning you will destroy it, either immediately or after a short time.
A properly rated one
To shield the 5 V against the maximal 24 V from the probe without extra parts, you will need to use a 24 V/5 V optocoupler.
Trickery with voltage dividers
With a 50 %
voltage divider
made from two properly rated resistors, you could limit the voltage to the optocoupler, which in turn would turn the 24 V signal into a 12 V signal, which would protect our optocoupler and the board beyond.