I’m working on retrofitting an existing machine to serve other purposes. The system uses a number of NPN inductive limit switches that I’d like to read into the Arduino.
The problem is that these limit switches operate on a 10-30 VDC level, and will be being used with 24VDC to match other voltages in the system. As the Arduino (currently using an UNO that was lying around, but will be upgrading to MEGA for the extra IO) only supports 5VDC, I’ll need something to step it down. I’d like to shy away from custom circuitry if at all possible (otherwise I’d just use a voltage divider circuit and be done with it).
After some digging, I think I’ve come up with a solution, but I wanted to run it by you guys to make sure it will work (the last thing I want to do is send 24 volts into the input pin). I have attached the wiring diagram of the sensor and a basic sketch of the schematic for the system. When the switch is closed, I have no doubt that it would work (it shouldn’t to much of a resistor to hit what I need it to, and there are some easily wireable options out there without the need for a custom PCB). However, when the switch is open, I’m not too sure what the arduino would see.
Is this the best way to do this or is there a better way?
Thanks.