I am trying to implement a simplified IO-Link communication (I only need to send one command to active the sensor).
I am pretty sure I should be able to connect the comm line of the IO-Link sensor to two pins on the arduino, one to send the messages and another one to receive them.
However, my big hurdle is that my mega is a 5V device and my sensor is a 24V device. I am a not sure, but I believe I should be able to isolate the arduino and the sensor using two transistors?
Would using an npn transistor with the arduino connected to the gate (5V) and 24V on the source, I should be able to generate a 24V signal from my 5V signal. However, do I risk burning my arduino?
I was thinking of using the circuit diagram below because I am dealing with very low power and my local electronic store does not have optocouplers in stock:
I have some npn transistors that can go to over 30V with a threshold voltage of 2V