Can I use a 12 V single channel optocoupler module in a 24 V machine? 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.

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

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.

If I do need another what would I need?
You can safely use the module with 24V.

The input side shows a red LED, optocoupler and 1k resistor in series. The LED and optocoupler probably have a voltage drop in the neighbourhood of 3.1-3.5&nbsp;V put together, so for a 12&nbsp;V input you will get a current of approximately 9&nbsp;mA-.

For a 24 V input voltage the increased current will cause a slightly higher voltage drop, but even if the voltage drop remains as low as 3.1&nbsp;V the current will still only be 21&nbsp;mA. This is well within the rating of the optocoupler (similar optocouplers are often rated for 60&nbsp;mA) and slightly pushing the rating of the LED (similar LEDs are usually rated for 20&nbsp;mA) but it will probably be fine.

For extra peace of mind you could connect an additional resistor in series with the input. The "ideal" value (that is, to keep the current identical to that at 12&nbsp;V) would be 1.3&nbsp;kΩ, though any small value resistor (above 100&nbsp;Ω) would be fine.