Wiring a 3-wire prox sensor to Rio

Here is some connection information for connecting a 3-wire proximity sensor to the Rio channel 0.

Here is a link to the prox sensor. IFM model IGS249

WIRING THE PROX TO THE RIO
Configure the Rio channel 0 as a 5-30 VDC Digital Input.
Connect the Prox BN (brown) wire to the +24VDC power supply.
Connect the Prox BK (black) wire to the Rio terminal 1.
Connect the Prox BU (blue) AND the Rio terminal 2 to the Common of the 24v supply.

image

EQUIVALENT CIRCUIT
IFM provides a wiring diagram which could use a little interpretation.
The small rectangle shown between the BK and BU wires represents the Rio. For channel 0 on the Rio, that is terminals 1 and 2.
image
The IFM specs show the prox is a PNP device.
image

The RIO’s DC Discrete input on channel 0 is like a photodiode. It passes current in one direction and it turns on the internal circuits through an optocoupler for isolation.
image

Here is the channel shown on the Rio’s wiring chart.
image

Here is a crude equivalent circuit.

Tracking the flow of current through the circuit: When the prox trips ON, the PNP transistor acts like a switch, which allows the current to flow from the +24vdc power supply, through the prox and through the input circuit on the Rio, finally back to the common side of the power supply.

Note: The BU wire on the prox also needs to connect to the common of the power supply. That wire is not shown below.
image
WIRING A 3WIRE PROX TO THE RIO.zip (334.8 KB)

5 Likes

How about an NPN sensor? I’ve been struggling with this today. Lots of head-scratching trying to make this work.
I’ve set it up per the attached drawing, but I always get the channel to read ON.

Pin 2 on the RIO is internally connected to pins 5, 8, 11, 14, 16, 18 and 20 - if you using the same power supply on other pins (or if its negative is connected to the negative of your other power/signal sources), then pin 2 would always be connected to the negative of your power supply, and since pin 1 is connected to the positive, it will always be on.

If that is the case, try using an isolated power supply and see if that works. That is the only thing I can come up with at the moment.

You should be able to wire it exactly the same as the PNP.
Just the logic state will be flipped, so you will have to unflip it in your code (if it matters - some people can think backwards easier than others).

The real question is if your prox has a pull up resistor or not??

1 Like

Continuing the legacy of my own personal Obi-Wan Kenobi, aka @D_Engsberg I have this NPN proximity sensor working nicely with the Rio. Here’s the setup explained in pictures, a diagram, and short video.

(! Note that the max current specified is 300 mA. Be sure the power supply you use does not exceed this amount. I might have destroyed an earlier prox sensor by using a power supply that fed too much current.)

9-second demo video: https://photos.app.goo.gl/fn6tAK8KLY2J1Wwy7

2 Likes

Nice and clear - just be careful if following this and using other channels on the RIO and using the same 24V supply or a supply without a floating negative. You will find your proximity input always reading “on” when the negative of the power supply is landed on one of the common terminals. If using an NPN - you can land the output on the channel input instead of the common if you use a pull-up resister as Beno alluded to, but you will need to reverse your logic. This will eliminate the need for an isolated power supply.

Strange on the 300mA - usually that would be the minimum required current for the sensor, not the max.

This is what the pull-up configuration would look like. The Ground would land on the RIO common (terminal 2 in your case) and the signal on terminal 1. The pull up would be connected between the signal and the 24V positive supply.

image
From How to connect NPN and PNP sensors

1 Like

Thanks @philip

I have 4 rotating metal objects that I was planning to use 4 sensors with all 4 powered from the same 24V power supply, so you already mapped out what I will need to do. Re: the pull up resistor, is this something that I add myself, or are there prox sensors with this built in?

Based on the comments in the amazon reviews - the sensor you have probably has an internal pull-up. If you measure 24V between the signal and ground when there is no metal nearby, then it has an internal pull up and all you need to do is change your wiring and reverse your logic so off = proximity and on = no proximity. The 300mA is the max current the sensor can “switch” - not an issue with the way you are using it. You should be able to use a larger power supply if want, but it is not necessary.

Got it, thank you. Will try it out later today and report back.

OK, I was able to measure 24V between the signal & ground when no metal nearby, so I proceeded to wire up two proximity sensors to channels 0 and 1 as shown below:

However, while the proximity input is always reading “on” (as we expected), both channels turn to “off” when metal passes by either proximity sensor. See this 11-second video: https://photos.app.goo.gl/W8reFH5Li54hRa4g6

In case we need to refer to it, here is the Rio wiring diagram:

Looks to me like you have pin 1 and 4 connected together in the blue wire nut - you need to separate those, one for each sensor.

2 Likes

Thanks Philip! And we have success for hooking up two NPN sensors to the same power supply.

The final setup:

and the requisite proof-of-concept video: https://photos.app.goo.gl/1ei3v8Szz6q9HepQA

3 Likes