# Inductive sensor wiring?

**URL:** <https://forum.arduino.cc/t/inductive-sensor-wiring/1048054>\
**Category:** Sensors\
**Created:** [October 31, 2022, 5:42pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054 "2022-10-31T17:42:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wkossen](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wkossen](https://forum.arduino.cc/u/wkossen)\
**Post date:** [October 31, 2022, 5:42pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/1 "2022-10-31T17:42:19Z")

</div>

Hi there,  
I want to use two npn nc inductive sensors in an arduino project. They get 12v power, which i dont want on the arduino. How should i wire this? I have been hitting google hard, but no conclusive solution. I saw resistors, optocouplers, etc. Whats the best way to do this?  
Thanks  
Willem

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [October 31, 2022, 6:03pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/2 "2022-10-31T18:03:49Z")

</div>

What does the documentation for your sensors show? We can't see it from here.

---

<div class="post-metadata">

**Author:** ![ZX80](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zx80/32/643687_2.png) [@ZX80](https://forum.arduino.cc/u/ZX80)\
**Post date:** [October 31, 2022, 6:30pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/3 "2022-10-31T18:30:13Z")

</div>

[https://www.phippselectronics.com/using-the-inductive-proximity-npn-sensor-lj12a3-4-z-bx-with-arduino/](https://www.phippselectronics.com/using-the-inductive-proximity-npn-sensor-lj12a3-4-z-bx-with-arduino/)

Don't be surprised if it does not work well at 5V.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [October 31, 2022, 7:09pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/4 "2022-10-31T19:09:31Z")

</div>

Basically you are asking how to connect this widget to that thing. Post a link to technical information on the sensor, without that we can only guess. If we are wrong something will get damaged. I would assume that it is an open collector output needing a pull up resistor but if not it would probably fry the input port on the Arduino (which one are you using?).

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [October 31, 2022, 8:03pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/5 "2022-10-31T20:03:00Z")

</div>

> [@wkossen](#):
>
> I want to use two npn nc inductive sensors in an arduino project. They get 12v power, which i dont want on the arduino.

The output of an NPN sensor is basically an NPN transistor switch to sensor ground.  
Measure output voltage of the sensor with a voltmeter with sensor power connected to 12volt.  
You should measure nothing on the sensor output (both activated or not).  
If so, then you can safely connect it to an Arduino pin.

Because an NPN sensor output is only a switch to ground, YOU have to provide pull up.  
If the sensor is near the Arduino, then internal pull up on the pin could be enough.  
`pinMode(sensorPin, INPUT_PULLUP);`  
Leo..

---

<div class="post-metadata">

**Author:** ![wkossen](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wkossen](https://forum.arduino.cc/u/wkossen)\
**Post date:** [October 31, 2022, 8:16pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/6 "2022-10-31T20:16:28Z")

</div>

Npn nc 5-36v is all i know.

---

<div class="post-metadata">

**Author:** ![wkossen](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wkossen](https://forum.arduino.cc/u/wkossen)\
**Post date:** [October 31, 2022, 8:17pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/7 "2022-10-31T20:17:13Z")

</div>

Thats why i give them 12v. 5 is the minimum, i dont like to use minimal values.

---

<div class="post-metadata">

**Author:** ![wkossen](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wkossen](https://forum.arduino.cc/u/wkossen)\
**Post date:** [October 31, 2022, 8:18pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/8 "2022-10-31T20:18:53Z")

</div>

What does “ if the sensor is near the arduino” mean? Is there a max distance or cable length i can use?

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [October 31, 2022, 9:56pm UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/9 "2022-10-31T21:56:09Z")

</div>

With longer wires (noise pickup) you can (should also) add external pull up.  
Which could mean a 1k resistor between Arduino pin and MCU supply (5volt?).  
For electrically noisy environments (false triggering) you could also add a 100n ceramic cap between pin and ground.  
Leo..

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [November 1, 2022, 12:14am UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/10 "2022-11-01T00:14:37Z")

</div>

The NPN output can accept voltages less than 5V. Power the sensor with 12V, and connect all the GNDs. The NPN output goes to an Arduino input pin, with a pullup resistor to Arduino Vcc.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 30, 2023, 12:15am UTC](https://forum.arduino.cc/t/inductive-sensor-wiring/1048054/11 "2023-04-30T00:15:09Z")

</div>

Closed on April 30, 2023, 12:15am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
