Welcome! Log In Create A New Profile

Advanced

NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...

Posted by NateR 
NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 21, 2020 03:57PM
Hello all,

I've got an SKR 1.4 Turbo that I'm trying to get an NPN NC inductive probe (link) working on. I'm very much a novice in electronics, so was hoping that someone could provide some guidance, and point out what I'm doing wrong here. I apologize for any unclear language when communicating these ideas - I will attempt to describe it as clearly as I know how.

How I've got it connected:
12v+ -> + lead on probe
Ground -> Ground lead on probe
Signal pin of Z endstop -> 1N5819 Diode -> signal wire of probe

My understanding of this is that when activated (or vice-versa, don't recall which), the signal should switch to connect to ground. Otherwise, it should be supplying +12v. With the diode, it should be connecting to ground, and then be 0v, respectively, correct?

When I measure voltage between the signal wire and +12v on the power supply, I get: 12v, and then 0v, respectively, as I would expect.

However, when I measure voltage from the signal pin on the board to the signal pin on the probe, I get +3.3v, then -5.8v, respectively. It looks like, somehow, there is voltage coming through the diode?

Any idea how this would work? I'm at a loss with where that -5.8v is coming from, and obviously am missing something - I would've thought that it would read either 0v since it should theoretically be isolated by the diode, or perhaps a few mV of leakage.

Thank you


EDIT: Ok, what the hell... My perception of how diodes work must be completely wrong.

To test diode behavior I went +12v -> diode -> multimeter -> ground. I tried three different diodes in both directions. With all three diodes, the direction electricity should flow is passing 12v. However, if I flip them around:
1N1N5817: Passing 2.5v (this slowly works its way lower)
1N5819: Passing 8.5v (started around 9v, and slowly worked its way lower)
1N5822: Passing 12v

What am I missing? Is the amount of leakage reverse through a diode really this high?

Edited 6 time(s). Last edit at 10/21/2020 04:44PM by NateR.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 21, 2020 07:11PM
The Z endstop connector on the SKR 1.4 has a pull-up resistor that will take the pin to 3.3V if nothing is connected. So the 3.3V is normal and expected.
The diode needs to be connected with the cathode (the line) towards the sensor - that way if the sensor puts more than 3.3V on the cathode the pin on the MCU will just see the 3.3V from the pull-up resistor.
The NPN sensor will pull the cathode to ground when closed - at that point you should see very close to 0V between the cathode and ground, and about 0.35V between the anode of the diode and ground (there's always a small voltage drop across the diode).

The multimeter is an extremely high impedance device when set to volts (usually in the megaohm range) which means that the current flowing through the diode is in the 12uA range so you can't really make the measurement as you describe. What you should do is do:

12V -> 10K resistor -> diode -> ground

and measure the voltage _across_ the diode (i.e. put the multimeter in parallel with the diode). For the 1N5819 you should see about 0.34V across the diode when it's forward biased (cathode to ground) and the full 12V when it's reverse biased (anode to ground).

You always need to measure voltage across a component - you can't put the multimeter in series with the component.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 21, 2020 07:23PM
Thank you, MMcLure.

I do have the "line" side of the diode toward the sensor, so from your description, it sounds like I have it set up correctly. Is there a way that I can connect it to the signal pin on the MCU to check voltages, without risking exposing it to 12v? I'd thought I could just connect the multimeter in series with it, but you've set me straight on that point.

And thank you for the explanation of how to test the diode... I really need to go through a course or something to learn about electronic components and how they work. Can you never put the multimeter in series for testing, or is that just for diodes or other specific components?

EDIT: Spent the evening reading about this and trying to figure out what's wrong... Even after following this guide word-for-word, setting it up exactly the same, I was getting between 7v and 8v coming back through the diode where he specifies it should be 0.7v (yes, I verified the scale on the multimeter) (EDIT) 0.055v. In the end, I just decided to go the optocoupler route.

Edited 3 time(s). Last edit at 10/23/2020 01:12AM by NateR.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 22, 2020 12:54PM
Quote
NateR
EDIT: Spent the evening reading about this and trying to figure out what's wrong... Even after following this guide word-for-word, setting it up exactly the same, I was getting between 7v and 8v coming back through the diode where he specifies it should be 0.7v (yes, I verified the scale on the multimeter). In the end, I just decided to go the optocoupler route.

"coming back through the diode" - what do you mean exactly? What points are the multimeter leads connected to when you measure these 7-8V? If the sensor is open I would expect to see about that voltage _across_ the diode, since the sensor will be at a higher voltage (probably around 12V) and the MCU pin will be at the 3.3V that the pull up resistor brings it to. If the sensor is closed then you should only see the forward voltage drop across the diode which would be in the 0.3-0.7V range. In either case the measurement between the MCU pin and ground should never be over 3.3V.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 22, 2020 03:30PM
Also, I noticed that the guide you linked to is using a NO sensor, while you indicate that your sensor is NC, so you should expect to see the opposite. I.e. when the sensor is triggered (open) you should see the higher voltage, and when the sensors is not triggered (closed) you should see the low voltage.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 23, 2020 01:14AM
Yes, I'm seeing the opposite in terms of when it is triggered, but I wouldn't expect to see different voltages from what he's seeing on either triggered/not triggered.

I had it hooked up exactly as he did in the picture on page three - positive probe to anode of diode, negative probe to ground. The leg of the diode with the line marked was in the direction of the sensor. I was reading 7v.
Re: NPN NC Inductive Probe with SKR v1.4 Turbo? Weird Diode Stuff...
October 23, 2020 03:08AM
I think you need a voltage divider. I have made a few posts about that. It means that you connect two leads with electronics; a resistor and a diode. Also, you can make an optocoupler, I also have a post on that. But the voltage divider is easier and fine for 12v use.

On mobile now but if you are interested I can send you the schematic I used later.


http://www.marinusdebeer.nl/
Sorry, only registered users may post in this forum.

Click here to login