Electronic – Simplest way to connect a proximity sensor to a PC

npnproximity-sensorrs232sensor

I want to interface a PC with a proximity sensor. The one I've been thinking about is this one.

I can see that the output is "NPN, 3 wire, NO" which I'm kind of unfamiliar with. I also see it outputs a signal of 300 mA. Will a 4-20 mA analog input be fried if I connect this one? Could some input relay (if they exist) be the most appropriate solution here? An RS232 connection would be optimal.

As you can see, I'm not an electronics expert. If you have other simpler suggestions for proximity control with a PC I'm all ears 🙂

Best Answer

To use this sensor, connect ground and power (6..36V). The third wire will be connected to ground when something is detected, otherwise it will be floating.

Note that it does not output 300 mA, that figure is the maximum current it can handle (sink to ground).

If you have a 4-20mA input you could use a resistor to supply 20mA to it, and use the output wire to ground the 4-20mA input to ground, so it will get 0 mA (or at least a good deal less than 20) when the sensor detects something.

You could use a serial port if you know how to read a handshake signal in your programming language.