Reverse protection diode - Should I worry about apparent leakage paths?

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
I'm in the middle of doing a redesign of a Hall Effect based non contact switch board I designed a few years ago (my very first board design, in fact!) In the original, I didn't include any protection for reverse voltage in case the power supply leads are hooked up backwards, and sure enough, the mistake has been made a number of times in the last few years. The mistake is rare enough, and the board cost low enough, that if making this fool-proof were going to be difficult or expensive, it wouldn't be worth it. It seems to me like it should be quite simple and cheap though, so I'm trying to add protection.

I've looked at adding a protection diode on either the 5V input or the ground input, and I've experimented with each by simply putting an external diode in series with the corresponding supply wire on one of our current production boards. My plan for the redesign would be to use Schottky diodes, but at the moment I'm experimenting with a 1N4001 and some 5.1V Zeners that we had lying around.

If I put a diode on the ground side, everything works as expected, but the whole board, including its outputs when they're in a low state, floats one diode-drop above the ground reference for the rest of the machine that this board connects with. It seems like things functioned properly in this case, but I still don't trust it - I'd much rather have all of my "ground" points be as close as they reasonably can be to the same voltage. I know nothing's ever perfect, but I think I'd prefer to not deliberately force the "ground" on this board to no longer match the rest of the machine's grounding.

If I put it on the 5V side, the board works perfectly when wired correctly, but if I reverse wire it, both outputs go high, passing current and activating the corresponding inputs on the main board for the rest of the machine. As first I ignored this, thinking I don't really care how the machine behaves in a mis-wired situation, as long as the board is protected. But then I started trying to make sense of where and how the leakage is happening, and it seems like it's through the comparator (MCP6542 push-pull output.) The datasheet for this part (linked here) doesn't provide an internal schematic, so I'm not sure if this is a function of built-in protection features, in which case I'm probably ok with the ~2mA that passes through. If it's getting through some unintended breakdown (not a deliberate protection feature) then I'd have to assume that any leakage is bad.

I've included a few schematic snippets - one is the current board design with the addition of a diode on the 5V supply side, the next is the input stage of our machine's main electronics board (the input that my smaller board's output will be feeding into,) and the last is a marked-up version of the first schematic, indicating voltage measurements and calculated currents.

I've tried to measure voltage and current a bunch of different ways. In the marked-up schematic below, green numbers are voltage measurements referenced to the ground of the rest of the machine. Red numbers are measurements between the two points their corresponding arrows point to, and current was calculated anywhere that I measured a voltage across a known resistance value. I've highlighted what I think is the leakage path in yellow.

So my questions to all the experts here are:
  • Which reverse protection method I should employ?
    • Diode on +5V side:
      • Maintains ground referencing throughout machine.
      • Allows leakage current through board when protecting against mis-wiring, maybe through comparator chip.
    • Diode on "ground," or common, side:
      • Local common reference on this board would be one diode drop above machine ground potential.
      • This also means that outputs from this board would be one diode drop up when in their off state (it seems like this might be ok since the input stage uses a Darlington input with a correspondingly high Vf, but it still feels weird to have off not be zero.)
      • This method appears to completely protect board components; no leakage is apparent.
  • Should I be worried about the leakage, assuming I'm right about it passing through the comparator chip?
hall-comp_clip.png
MainBoard-Inputs.png
hall-comp_clip_highlighted.png
 

crutschow

Joined Mar 14, 2008
34,420
I recommend a third option:
Use a single MOSFET to block reverse voltage in the +5V line as shown here.
It's forward drop can be made arbitrarily small, as determined by the MOSFET's ON resistance carrying the load current, and the reverse (blocking) current is just the tiny off MOSFET leakage current.
For the +5V line you need a logic-level type P-MOSFET (Vgs(th)≤2V).
For 5V you don't need the gate resistors shown in the article, you can connect the gate directly to ground.

Be sure and note the proper connections to the source and drain of the MOSFET as it's opposite of how you may think it should be connected.
 

kubeek

Joined Sep 20, 2005
5,795
As the current draw I presume is very small, then I would use a PTC in series with the power supply and a diode between the negative and positive terminals going into the board. You won´t get any negative voltage on the board, and the ptc will limit the current to a safe value until someone realizes their mistake and plugs the board in the correct way.
 

-live wire-

Joined Dec 22, 2017
959
In addition to what others have suggested, maybe also add an active peizo-electric buzzer and red LED in series with the polarity reversed so that if you plug it in wrong you are aware of it and can easily fix it. Just make sure the LED can handle the current.
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
I recommend a third option:
Use a single MOSFET to block reverse voltage in the +5V line as shown here.
It's forward drop can be made arbitrarily small, as determined by the MOSFET's ON resistance carrying the load current, and the reverse (blocking) current is just the tiny off MOSFET leakage current.
For the +5V line you need a logic-level type P-MOSFET (Vgs(th)≤2V).
For 5V you don't need the gate resistors shown in the article, you can connect the gate directly to ground.

Be sure and note the proper connections to the source and drain of the MOSFET as it's opposite of how you may think it should be connected.
I could certainly use the MOSFET instead of a diode, but that still leaves the question of the leakage from what would normally be ground out to the comparator output (presumably through the comparator - I can't find any other path.) If I use your suggestion, there will still be a path there.

Do you think 2.3mA leaking from VSS through the comparator output is acceptable, or potentially damaging?
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
As the current draw I presume is very small, then I would use a PTC in series with the power supply and a diode between the negative and positive terminals going into the board. You won´t get any negative voltage on the board, and the ptc will limit the current to a safe value until someone realizes their mistake and plugs the board in the correct way.
Interesting thought.

The 5V rail that supplies this board (and several other small boards that are also separate from the main board) is fed by a current-limited circuit, capped at roughly 80mA. I wonder if that current limiting circuit would do the job of the PTC you mentioned, in which case all I need is a diode across the power inputs to my little board.

I guess I should do some quick math on what 80mA through a diode works out to in terms of power dissipation to see if I need to limit current further. I'll do that and check back in.
 

kubeek

Joined Sep 20, 2005
5,795
80mA*0.5V is 40mW for a schottky, or *1V is 80mW for a silicon diode. Either way, if you are sure that the supply is limited to 80mA, even a tiny diode in sot-23 will handle that without a sweat.
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
80mA*0.5V is 40mW for a schottky, or *1V is 80mW for a silicon diode. Either way, if you are sure that the supply is limited to 80mA, even a tiny diode in sot-23 will handle that without a sweat.
Yeah, I'll have to refresh my memory on the current limiting circuit. It's a variation on a current mirror. It's definitely configured for 80mA, but I know the circuit depends a lot on transistor matching and temperature stability, and I don't know how much I trust it to stop right at 80, or how far beyond 80 I think it's upper limit would be.

I've tested them a few times by shorting the power rail through a current meter. They were within a few mA every time I tried, but my sample size was quite small!

Still, my gut feeling is that this is likely to be an easy fix!

I'll do some short circuit current measurements tomorrow - assuming those still check out, I'll try this diode arrangement on my test machine and make sure everything else still performs as expected.
 

BobaMosfet

Joined Jul 1, 2009
2,113
First, you wouldn't normally put a diode on the ground side. elevating ground across the board alters the reference for the entire board. If for some unknown reason you at any point later add another trace to the cathode side of the diode (closes to ground), you've unwittingly created a ground-loop that can cause you no end of suffering.

Normally, you would put a diode on the upstream side of any regulation you use; for example a 1N5818. Likely for your circuit that will mean only a modest drop of 0.33V ahead of the regulation so your circuit won't even know it. Furthermore, I'd add an appropriately rated fuse (like FUX1A250V-AGC, which is 1A up to 250V) for protection upstream of the diode. Two very inexpensive components, and the leakage of a 1N5818 is 1mA -not likely to cause any damage to anything. Average rectified forward current is 1.0A, well aboe your 80mA supply.

Also, you may also consider mounting a socket on your PCB, in order to make it so a power-cord is used or something like this to eliminate the possibility of connecting it incorrectly altogether (like a 9V Wallwart type solution).

In reviewing your schematics, if possible I offer another thing- Power it with a 9V wallwart and use regulation to take it to 5V. 4.8-4.9V is dipping towards the 'signal' high logical level, which can be around 4.6-4.7V. If for any reason your voltage sags a little the logic of the circuit could suddenly fail. Also, if you use a Diode on the positive rail, make sure your OpAmp doesn't draw it's own power from anywhere on the cathode side.
 
Last edited:

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
I think I've confused some of the discussion by using the word "leakage." I wasn't referring to leakage THROUGH the diode, so changing diodes wouldn't address the question.

I was referring to current that's finding a different path through the circuit, bypassing the high side protection diode entirely. It appears to be passing through the comparator, going from its VSS ("ground") pin to its output pin. A little over 2mA leaks through the comparator there, even with a blocking diode on the high side of the circuit. The diode on the high side has no effect, because this current is following a totally different path.

So what I wanted to find out is whether a comparator whose VSS pin is at a higher potential than its output pin, and which is "leaking" a little over 2mA through those pins, is in danger of being damaged, or if this apparent "leakage" through the comparator is passing through deliberate protection diodes, or some other safe mechanism, within the comparator IC.

If the amount of current passing the wrong way through the comparator is harmless, I have more options for circuit protection. If it's unacceptable, that reduces my options. If @kubeek's idea works as planned, it will be a moot point, although I'd still be interested in knowing, just for the sake of understanding things better.
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
80mA*0.5V is 40mW for a schottky, or *1V is 80mW for a silicon diode. Either way, if you are sure that the supply is limited to 80mA, even a tiny diode in sot-23 will handle that without a sweat.
Well, test results today were surprising and interesting. I must've remembered things wrong. I have no record of ever testing the short circuit current on our machines - only on the circuit I later built for another project, which was based on the same concept, but used different transistors. The circuit I built (with help from this forum, in the thread linked here) performs within a few mA of its 80mA target.

The circuit in our machines claims to be set for 80mA, but I tested a bunch of machines here in the shop, plus some old control boards I found left over from earlier production runs, and they all test around 135mA. After taking a closer look at the schematic, and at the datasheet for the transistors used in our boards, I calculated that the circuit is set for 122mA, not 80. My calculations based on the schematic and data sheet don't quite match the measured results, but they're much closer to matching than they are to the 80mA claim commented in the schematic. I wonder if the designer planned for a different transistor and forgot to recalculate values when they changed parts, if the part specs changed at some point in the last 8 years, or if they just miscalculated the first time.

Regardless of the explanation, it looks like I've got a current limit set somewhere around 135mA, not 80mA. If I choose a Schottky diode for low Vf, I can certainly make sure power dissipation through the diode is less than 100mW.

I did test functionality with a 1N4001 across the power inputs to our current machine, and it behaves as desired in both normal operation and reverse-wiring scenarios. I think this is my solution. Thanks @kubeek!
 
Top