# How to connect an NPN sensor output to DI or CI?

**URL:** <https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682>\
**Category:** Technical Questions\
**Tags:** electrical\
**Created:** [November 5, 2020, 9:06pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682 "2020-11-05T21:06:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tulio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tulio/32/1690_2.png) [@tulio](https://forum.universal-robots.com/u/tulio)\
**Post date:** [November 5, 2020, 9:06pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/1 "2020-11-05T21:06:44Z")

</div>

I just got an NPN output capacitive sensor and I need to conenct it to the UR inputs. I checked the User Manual and it only talks about mechanical switches. And seems like the optocupler inside the UR is hardwired to ground. So it can only accept switches and PNP output sensors.  
Is that correct?

---

<div class="post-metadata">

**Author:** ![tulio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tulio/32/1690_2.png) [@tulio](https://forum.universal-robots.com/u/tulio)\
**Post date:** [November 5, 2020, 9:07pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/2 "2020-11-05T21:07:33Z")

</div>

I did a little bit more reading in the User Manual and seems that the inputs are unidirectional optocupled, ranging from -3 to 30V input voltage.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/f/f6b4fbbc5c7c0928c8277644dd680007d90a4925.png)  
And by the image above, since it needs no GND it seems to be hardwired. Is that correct?

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [November 6, 2020, 11:22am UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/3 "2020-11-06T11:22:34Z")

</div>

Hi @tulio,

I will assume you can solve it with a 820ohm pull up resistor. At 15mA that will give you a voltage drop of 12.3V and the input is still above 11V.  
You shall make sure your sensor can sink 30mA and that the resistor can handle the power ~1W.

---

<div class="post-metadata">

**Author:** ![tulio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tulio/32/1690_2.png) [@tulio](https://forum.universal-robots.com/u/tulio)\
**Post date:** [November 6, 2020, 2:46pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/4 "2020-11-06T14:46:31Z")

</div>

😓 This workaround will not work in my case…I have 12signals to connect 😬!  
I got into some analysis…It’s a SUPER HINT, it’s better to use a PNP sensor, since it will “switch” the positive side, it will pretty much act like the switch from the manuall, switching the highside!

---

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [November 6, 2020, 5:07pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/5 "2020-11-06T17:07:10Z")

</div>

The inputs in the controller and took flange are PNP optocouplers so you will need to use PNP sensors.

---

<div class="post-metadata">

**Author:** ![tulio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tulio/32/1690_2.png) [@tulio](https://forum.universal-robots.com/u/tulio)\
**Post date:** [November 9, 2020, 3:45pm UTC](https://forum.universal-robots.com/t/how-to-connect-an-npn-sensor-output-to-di-or-ci/9682/6 "2020-11-09T15:45:32Z")

</div>

Thanks, I got it.  
My work around was to use some interface relays.  
The problem was that the output signal was from an old PLC’s NPN digital output. And the output didn’t have any freewheeling diodes 😢, so I needed to insert an interface board with them. 🙄
