I have an inductance sensor on a CNC machine that goes 12V high when triggered (open collector when not) . I want to read that input on my arduino who uses 5V logic.
I was thinking I could just use a simple NPN transistor to do the logic level shifting. Would this work? I dont want to test it incase it could fry the arduino.
Best Answer
It will work. This circuit should be at logic 1 if there is no signal and at logic 0 if there is 12V signal present.
P.S. 10K resistors are just there as a generic value. For this purpose you can use almost anything. Base-ground resistor is 100K as recommended by @Russell.