<p>An NPN sensor is wired differently from a PNP sensor. The signal wire is the black wire, blue is the ground wire.</p>

<p>According to this posting, <a href="https://mertarauh.com/2017/01/18/dont-trust-the-internet-and-how-to-add-an-inductive-proximity-sensor-to-your-3d-printer-the-proper-and-easiest-way/" rel="nofollow noreferrer">Don’t trust the internet (and how to add an Inductive Proximity Sensor to your 3D printer the proper and easiest way</a>, you need to insert a 6.8&nbsp;k&ohm; resistor in between the black and the blue wire, I quote:</p>

<blockquote>
  <p>...Indeed, all we need to do is add a single 6.8&nbsp;kΩ resistor between BLACK and BLUE and all should work fine.</p>
</blockquote>

<p><a href="https://i.sstatic.net/yfaNB.png" rel="nofollow noreferrer" title="NPN inductive sensor using voltage divider resistor"><img src="https://i.sstatic.net/yfaNB.png" alt="NPN inductive sensor using voltage divider resistor" title="NPN inductive sensor using voltage divider resistor"></a></p>

<p>Alternatively, a diode in the black wire would also work, I quote:</p>

<blockquote>
  <p>... So I did test using a diode and that also works perfectly fine, simply because the direction in which the 12&nbsp;V current would like to flow when the sensor is open will be blocked by the diode. The internal (or hardware) pull-up still pulls the Atmega’s sensor pin to <strong>HIGH</strong> however.</p>
</blockquote>

<p><a href="https://i.sstatic.net/SSO9C.png" rel="nofollow noreferrer" title="NPN inductive sensor using diode, high output to printer board"><img src="https://i.sstatic.net/SSO9C.png" alt="NPN inductive sensor using diode, high output to printer board" title="NPN inductive sensor using diode, high output to printer board"></a></p>

<blockquote>
  <p><br>... 
  But as soon as the sensor is closed, the diode would allow the 5&nbsp;V current to flow in the opposite direction towards ground, which pulls the Atmega’s sensor pin to <strong>LOW</strong>.</p>
</blockquote>

<p><a href="https://i.sstatic.net/YceLn.png" rel="nofollow noreferrer" title="NPN inductive sensor using diode, low output to printer board"><img src="https://i.sstatic.net/YceLn.png" alt="NPN inductive sensor using diode, low output to printer board" title="NPN inductive sensor using diode, low output to printer board"></a></p>

CC BY-SA 4.0
2019-07-04T06:51:33.123Z
Good catch! Hopefully that is the answer :-)
Greenonline
CC BY-SA 4.0
2019-07-04T06:50:23.617Z
2019-07-04T08:35:13.613Z
2019-07-04T08:35:13.613Z
0scar
<p>As discussed previously on a post, <a href="https://3dprinting.stackexchange.com/questions/10420/tevo-tarantula-z-port-burnt">Tevo tarantula Z- port burnt</a>, I've burnt one of my Z endstops ports (I solved this issue and I'm using the Z+ port, normally).
I did that trying to install an auto bed leveling sensor. I don't want to mess up again...</p>
<p>I have a LJ18A3-8-Z/BX NPN sensor.</p>
<p>Brown wire is connected to the N (+) of the power supply, blue and black wire connected as shown in the picture (pay attention to the red markings on the white wire):</p>
<p><a href="https://i.sstatic.net/ZnGe5.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZnGe5.jpg" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/6HspA.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6HspA.jpg" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/Q5CNw.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q5CNw.jpg" alt="enter image description here" /></a></p>
<p>Any advice about the wiring is welcome. But I hope it's right, I've read in several places<sup>1</sup> that this type of sensor doesn't require any kind of resistor.</p>
<p>I'm using the last version of Jim Brown firmware.</p>
<p>Here it is what I've changed so far:</p>
<pre>
//#define BLTOUCH       // ANTClabs BLTouch sensor (might also work with clones)
//#define BLTOUCH_V3    // ANTCLabs BLTouch sensor version 3
//#define SN04          // Green sensor
#define INDUCTIVE_NO  // Normally open inductive sensor
//#define INDUCTIVE_NC  // Normally closed inductive sensor
//#define SERVO_PROBE   // Endstop switch on rotating arm. Set servo angles!
//#define NOZZLE_PROBE  // Nozzle wired up to contact metal on bed

//#define TRIPOINT
//#define LINEAR
//#define BILINEAR
#define UBL
//#define MANUAL
</pre>
<p>Let's go to my issues:</p>
<ol>
<li><p>Before flashing this configs, the sensor's LED would go on near metal and off far from metal. With this new config the LED remains off until I place the sensor near metal... But after it goes on, it remains on, even when far from metal.</p>
</li>
<li><p>When I home the axis, I try to simulate the position of the Z axis, holding the sensor close to a metal plate. But the Z axis moves up... up... up... Doesn't matter what I do with the sensor (hold close or distant from metal). Until some point and it stops.</p>
</li>
</ol>
<p>So far nothing is fried and I'm trying to make it work right now. It seems to me (based on what I read) that a NPN sensor really doesn't need anything. Just plug on the power supply and board.</p>
<p>So... basically, as you can see, I have no idea of what I'm doing. I hope someone can help me...
I've tried to find answers and figure it out by myself. I'm not being lazy here...</p>
<hr />
<p><sub>BTW I'm wondering if Jim Brown is still better than the official Marlin Firmware... So I'm willing to change it if that is the opinion of the pros! </sub></p>
<hr />
<h3>Footnote</h3>
<p><sup>1</sup> For example, in the <a href="https://reprap.org/forum/read.php?406,660029,662465#msg-662465" rel="nofollow noreferrer">second post</a> to <a href="https://reprap.org/forum/read.php?406,660029" rel="nofollow noreferrer">How do I wire my lj18A3-8-Z/BX to my prusa? going insane</a></p>

CC BY-SA 4.0
2019-07-04T06:38:43.197Z
I now see you are using an NPN instead of a PNP sensor! That makes a difference! There is an excellent post,  [Don’t trust the internet (and how to add an Inductive Proximity Sensor to your 3D printer the proper and easiest way)](https://mertarauh.com/2017/01/18/dont-trust-the-internet-and-how-to-add-an-inductive-proximity-sensor-to-your-3d-printer-the-proper-and-easiest-way/) on how these sensors work and how to connect them.
0scar
<tevo-tarantula><inductive-sensor>
Tevo Tarantula auto bed leveling config
Paulorfo
# Tevo Tarantula auto bed leveling config

(Asked by: username_0 on 2019-06-29)

As discussed previously on a post, Tevo tarantula Z- port burnt, I've burnt one of my Z endstops ports (I solved this issue and I'm using the Z+ port, normally).
I did that trying to install an auto bed leveling sensor. I don't want to mess up again...
I have a LJ18A3-8-Z/BX NPN sensor.
Brown wire is connected to the N (+) of the power supply, blue and black wire connected as shown in the picture (pay attention to the red markings on the white wire):



Any advice about the wiring is welcome. But I hope it's right, I've read in several places1 that this type of sensor doesn't require any kind of resistor.
I'm using the last version of Jim Brown firmware.
Here it is what I've changed so far:

//#define BLTOUCH       // ANTClabs BLTouch sensor (might also work with clones)
//#define BLTOUCH_V3    // ANTCLabs BLTouch sensor version 3
//#define SN04          // Green sensor
#define INDUCTIVE_NO  // Normally open inductive sensor
//#define INDUCTIVE_NC  // Normally closed inductive sensor
//#define SERVO_PROBE   // Endstop switch on rotating arm. Set servo angles!
//#define NOZZLE_PROBE  // Nozzle wired up to contact metal on bed

//#define TRIPOINT
//#define LINEAR
//#define BILINEAR
#define UBL
//#define MANUAL

Let's go to my issues:

Before flashing this configs, the sensor's LED would go on near metal and off far from metal. With this new config the LED remains off until I place the sensor near metal... But after it goes on, it remains on, even when far from metal.

When I home the axis, I try to simulate the position of the Z axis, holding the sensor close to a metal plate. But the Z axis moves up... up... up... Doesn't matter what I do with the sensor (hold close or distant from metal). Until some point and it stops.


So far nothing is fried and I'm trying to make it work right now. It seems to me (based on what I read) that a NPN sensor really doesn't need anything. Just plug on the power supply and board.
So... basically, as you can see, I have no idea of what I'm doing. I hope someone can help me...
I've tried to find answers and figure it out by myself. I'm not being lazy here...

BTW I'm wondering if Jim Brown is still better than the official Marlin Firmware... So I'm willing to change it if that is the opinion of the pros! 

Footnote
1 For example, in the second post to How do I wire my lj18A3-8-Z/BX to my prusa? going insane

**Tags:** tevo-tarantula, inductive-sensor
> **Comments:**
> **username_1**: I now see you are using an NPN instead of a PNP sensor! That makes a difference! There is an excellent post,  [Don’t trust the internet (and how to add an Inductive Proximity Sensor to your 3D printer the proper and easiest way)](https://mertarauh.com/2017/01/18/dont-trust-the-internet-and-how-to-add-an-inductive-proximity-sensor-to-your-3d-printer-the-proper-and-easiest-way/) on how these sensors work and how to connect them.  

---

## 1 answers

### Answer by username_1 on 2019-07-04. Score: 1

An NPN sensor is wired differently from a PNP sensor. The signal wire is the black wire, blue is the ground wire.

According to this posting, [Don’t trust the internet (and how to add an Inductive Proximity Sensor to your 3D printer the proper and easiest way](https://mertarauh.com/2017/01/18/dont-trust-the-internet-and-how-to-add-an-inductive-proximity-sensor-to-your-3d-printer-the-proper-and-easiest-way/), you need to insert a 6.8 kΩ resistor in between the black and the blue wire, I quote:

> ...Indeed, all we need to do is add a single 6.8 kΩ resistor between BLACK and BLUE and all should work fine.

[![NPN inductive sensor using voltage divider resistor](https://i.sstatic.net/yfaNB.png "NPN inductive sensor using voltage divider resistor")](https://i.sstatic.net/yfaNB.png "NPN inductive sensor using voltage divider resistor")

Alternatively, a diode in the black wire would also work, I quote:

> ... So I did test using a diode and that also works perfectly fine, simply because the direction in which the 12 V current would like to flow when the sensor is open will be blocked by the diode. The internal (or hardware) pull-up still pulls the Atmega’s sensor pin to **HIGH** however.

[![NPN inductive sensor using diode, high output to printer board](https://i.sstatic.net/SSO9C.png "NPN inductive sensor using diode, high output to printer board")](https://i.sstatic.net/SSO9C.png "NPN inductive sensor using diode, high output to printer board")

> ...
> But as soon as the sensor is closed, the diode would allow the 5 V current to flow in the opposite direction towards ground, which pulls the Atmega’s sensor pin to **LOW**.

[![NPN inductive sensor using diode, low output to printer board](https://i.sstatic.net/YceLn.png "NPN inductive sensor using diode, low output to printer board")](https://i.sstatic.net/YceLn.png "NPN inductive sensor using diode, low output to printer board")

> **Comments:**
> **username_2**: Good catch! Hopefully that is the answer :-)  

---

