# NPN NC Prox Sensor Getting False Readings

**URL:** <https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067>\
**Category:** Sensors\
**Created:** [May 30, 2024, 2:31pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067 "2024-05-30T14:31:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 2:31pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/1 "2024-05-30T14:31:38Z")

</div>

Hello there hopefully someone can give some guidance, I am using a 6-30v npn nc prox sensor with arduino mega 2560 to detect gear rotations of a machine with a bolt & nut acting as the activator for the switch. I am powering externally with 12v and have combined both grounds from power and arduino. I have added a 10k resistor between the 5v and output signal of sensor and a 10uf capacitor between 5v (output) and ground. I am having issues where when the machine runs constant it counts as expected but if the operator jogs the machine a small amount i am getting false readings.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 3:06pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/2 "2024-05-30T15:06:52Z")

</div>

Why the resistor from 12 volt to 5?  
Please post a link to the datasheet of that sensor.

---

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 3:38pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/3 "2024-05-30T15:38:30Z")

</div>

@Railroader MY fault I have the 10kR between 5v and signal to arduino

- Product Name：Inductive Proximity Switch; Wire Type : DC 3 Wire Type (Black, Brown, Blue);Switch Appearance Type : Cylinder Type
- Supply Voltage : DC 6-36V;Current Output : 300mA;Detect Object : Iron
- Model: LJ12A3-4-Z/AX;Theory : Inductive Sensor;Output Type: NPN NC;Diameter of Column Sensor: 12mm;Detecting Distance : 4mm
- Total Size: 6.2 x 2cm/2.4'' x 0.8'' (L\*Max. Dia); Cable Length: 1.2m/47'';Net Weight :44g
- External Material : Plastic, Alloy;Package Content : 1 x Inductive Proximity Switch

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 4:13pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/4 "2024-05-30T16:13:38Z")

</div>

> [@perryj0001](#):
>
> 10kR between 5v and signal to arduino

That's better.

I guess the output is an open collector type.

> [@perryj0001](#):
>
> if the operator jogs the machine a small amount i am getting false readings.

Look for intermittent contact i the wiring. Touching the cables might cause the same error. Else there's a mechanical play somewherer-

---

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 5:13pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/5 "2024-05-30T17:13:43Z")

</div>

@Railroader I'm assuming the same that its an open collector i couldnt find any specs for it, Ive tried also NO NPN and same issue. Its odd ill have the sensor away from the machine and still same reaction when moved a small amount but constant operation is fine. It posses an issue if the operator is doing a change out and jogs to feed in would jump the count. It has been a lot less since the introduction of the resistor and a capacitor for noise i don't know if the small of uF is gonna cut it and my next option is to add a diode to the signal side for any irregular voltage.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 5:29pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/6 "2024-05-30T17:29:30Z")

</div>

Do You say that removing the sensor from the machine and jogging the machine causes errors?

What is the physical sensing element in the sensor? Know that hand moving a thing might contain like a vibration, moving forward and easily have small backwards compnents in it.  
Is it a physical switch of some kind? Then contact bouncing might be the reason.

---

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 5:37pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/7 "2024-05-30T17:37:04Z")

</div>

@Railroader Not removing it from the circuit just off its mount, it is mounted facing a gear using a bolt without direct contact to trigger. If i take it off the mount still connected and place down facing away from the machine i will get the same results. It is a physical start button, but yes the machine itself def has vibration.

---

<div class="post-metadata">

**Author:** ![DrDiettrich](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/drdiettrich/32/219048_2.png) [@DrDiettrich](https://forum.arduino.cc/u/DrDiettrich)\
**Post date:** [May 30, 2024, 5:49pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/8 "2024-05-30T17:49:22Z")

</div>

> [@perryj0001](#):
>
> If i take it off the mount still connected and place down facing away from the machine i will get the same results.

If you get results with the sensor removed then the signal is not related/originated to the rotation of the bolt. Make the sensor output stable when removed off the mount.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 5:52pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/9 "2024-05-30T17:52:36Z")

</div>

Can You make a close up photo of that sensing thing alone and one mounted?

> [@perryj0001](#):
>
> It is a physical start button, but yes the machine itself def has vibration.

Is the sensing device a conventional button? If it is, You are facing normal contact bouncing.

---

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 6:40pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/10 "2024-05-30T18:40:48Z")

</div>

@Railroader sensing device is a non contact proxy sensor, mounted to an L bracket and when not mounted was placed on a plastic cart still wired in. The start button to the machine is a physical star button, the machine itself is pretty used and has a lot of vibration in jog. I ended up adding a debounce delay to counter act the false triggers in between the rotation of the gear to the next next proximity trigger

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 7:05pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/11 "2024-05-30T19:05:51Z")

</div>

Okey. What´s the diameter of the sensor sensing end and what's the distance between teeth of the wheel?

---

<div class="post-metadata">

**Author:** ![perryj0001](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@perryj0001](https://forum.arduino.cc/u/perryj0001)\
**Post date:** [May 30, 2024, 7:41pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/12 "2024-05-30T19:41:10Z")

</div>

@Railroader the sensor is 12mm, I was originally using a fork sensor to count the teeth. But unfortunately I had to switch to the proxy due to the gear teeth being driven by a chain and catching debris giving false break beam readings

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [May 30, 2024, 7:53pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/13 "2024-05-30T19:53:26Z")

</div>

> [@perryj0001](#):
>
> the sensor is 12mm

and the distance between the gear teeth is?

---

<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:** [November 26, 2024, 7:53pm UTC](https://forum.arduino.cc/t/npn-nc-prox-sensor-getting-false-readings/1266067/14 "2024-11-26T19:53:29Z")

</div>

Closed on November 26, 2024, 7:53pm UTC

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