I have an inductance sensor on a CNC machine that goes 12 V high when triggered (open collector when not). I want to read that input on my Arduino which uses 5 V logic.
I was thinking I could just use a simple NPN transistor to do the logic level shifting. Would this work? I don't want to test it in case it could fry the Arduino.