Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Pin Protection — Parallax Forums

Propeller Pin Protection

Hi all - I've searched around for information on pin protection, but haven't found an ideal solution on the forum. I've got a sensor with a propeller powering the data acquisition. It's going to be talking to a logging unit that could be whatever the user hooks up. I've got a few control lines that run from the logger to the propeller to activate certain modes, etc. All of the lines coming on-board have transzorbs for lightning protection, but I'm concerned about the users hooking up a 5 VDC logic device or mis-wiring the connector and hitting me with 12-24 volts. The lines could be bi-directional to allow maximum versatility for development/features. Should I be thinking optoisolators here?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    There are many ways to connect 3.3V and 5V signals. It really depends on a lot of things. Here's an application note on the subject: https://www.parallax.com/downloads/an010-low-cost-bidirectional-mixed-voltage-interfacing
  • Thank you for the app note Chris! Putting something like a 50k resistor in-line would be a low-cost way to do the trick. Supposing that cost isn't a concern (as it often isn't in instrumentation vs. consumer products) is this still the best way or is a more belt and suspenders approach recommended to be as bullet proof as possible?
  • An approach that I have emulated from various industrial standards, is to create a piece-wise linear model of how the system should behave under a range of voltages and durations. One example is found here.

    Boundary conditions help to make this a very solvable problem. Is the following a reasonable summary ...
    Input <2.7V = normal operation not guaranteed; system survives indefinitely and fully recovers with standard inputs
    2.7V < Input < 5.5V = normal operation guaranteed
    5.5V < Input < 30V = normal operation not guaranteed; system survives minimum of 1 minute and fully recovers with standard inputs
    Input > 30V = normal operation not guaranteed; system survives transient (10us) pulse of 500W and may require reset for recovery


    A word of caution - a TranZorb will have capacitance on the order of 1nF or so. If combined with a series resistor of, say 50K ohm, then the resulting circuit has a time constant of 50usec. Communication will be realistically limited to a few kHz. Is that survivable?

    An optoisolator is not exactly a panacea, either. For instance, let's say that a 3V input drives the opto-LED at 10mA (assume 2V LED drop, and therefore a 100 ohm series resistor). "Hitting" it with 24V will drive the opto-LED with 220mA, killing it in short order.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    There are several types of circuits designed to convert between different voltage signals. Most have some sort of caveat. Optos are certainly and option (you mentioned them), however are only useful on a signal that goes in one direction only. I tend to use them if I need complete isolation, such as in an automotive environment.

    Another is a MOSFET level converter such as the one shown here. One caveat here is that the lines are pulled high on both sides by default. Bandwidth may be increased by using a lower value resistor.

    mosfet_level_converter.jpg
    369 x 185 - 14K
  • The nice thing about the MOSFET level converter that Chris shows is that 2N7000 is rated to block 60V. So, I believe that this would also protect against an erroneous application of 24V that you described.

    One more idea (full disclosure: I have never used this with a Propeller) is use a pair of Schottky diodes, one to each rail. This is basically an extrapolation of the series resistor that exploits the ESD diodes. The difference is that an external Schottky diode can be selected with much higher current capacity and still maintain a very low forward drop. This would allow for a lower series resistor value, as well.

    In the attached image, the Propeller I/O would be to the right. Using BAT54S and the 1K ohm shown, a 5V input would result in <2mA of current through the upper Schottky diode. BAT54S has a forward drop of <350mV at those levels.

    BAT54S also has capacitance (10pF) that is 2 orders of magnitude lower than a typical TranZorb. So, even if you want to use the 50K ohm inline for overkill, there is still decent bandwidth.
    Schottky.jpg
    714 x 668 - 24K
  • Thanks for all of the advice. Given that the tranzorbs (basically Zeners) will clamp to roughly 7V, maybe a series protection resistor would indeed be enough. A 10k would be cutting it close, but I already have that on the BOM. My math says that's 7.4V max protection assuming that the 10k part is at the worst case -5% spec. Sound like a reasonable solution?
  • The circuit hatallica posted is recommended quite often, but it can have a serious problem.
    When a higher voltage is applied to the input the upper diode dumps the input current into the supply voltage.
    In the example with 24V applied you can expect (24-3.3)V/1kOhm = 20mA.
    This works if the supply can take this additional current. Usual power supplies are designed to only supply current but not to have current flowing into them. If the power consumption of the rest of your circuit is low this will raise the supply voltage and can lead to destruction.
    I always recommend to put a transzorb over the supply voltage very near to the schottky diodes and a fast capacitor in parallel to it. This will then also take the energy contained in an fast transient.
  • But you don't really even need the external shottky diodes as long as you limit the current post-transzorb to be safe for the internal diodes on the prop, correct?
  • kwinnkwinn Posts: 8,697
    geo_leeman wrote: »
    But you don't really even need the external shottky diodes as long as you limit the current post-transzorb to be safe for the internal diodes on the prop, correct?

    Correct.
  • @rbehm I'm not sure of the advantage that cap offers. Unless it is very large, it would just protect from the briefest transient and would round off the corners of logic signals.
  • geo_leeman wrote: »
    @rbehm I'm not sure of the advantage that cap offers. Unless it is very large, it would just protect from the briefest transient and would round off the corners of logic signals.


    rbehm brings up a good point and it is certainly an improvement on my simple example. However, it sounds like you (geo_leeman) are going a different direction, so the details of rbehm's point may be moot.

    Sorry if I can be a tad slow sometimes, but I need to verify that I do really understand your current plan. Is it as follows(?):
    External input has tranzorb to ground/common; then series resistor; then Propeller input (with ESD diodes providing final clamp).

    My opinion is that this handles two scenarios well: the 5V logic and the "lightning". Now consider the scenario of a 12V or 24V accidental input. The Propeller is safe, but the tranzorb provides what is essentially a low-impedance short circuit to the external input. The tranzorb and the external equipment will battle to the death. So, again, I go back to defining what is acceptable behavior under various conditions. Otherwise, we are taking wild shots that cannot be back-tested for success.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-09-05 16:14
    The fast cap that was mentioned is in parallel with the 3.3V supply clamp *IF* you are intending to dump input clamp current to the supply. As was mentioned this aspect is almost completely overlooked and while the Prop is running and drawing more current than is dumped then it is fine but this is not the case during reset when very little current is drawn and if the supply were not clamped it would rise to over 4V at which point the Prop substrate itself starts to breakdown. Even if it doesn't destroy the chip I have seen this stopping the Prop from starting up.

    The best solution? Just limit the current and if speed is not a problem you could even use 1M resistors but even just 100k will limit 24V inputs to around 200ua. The other solution for a high voltage fast input is to just use an NPN input with a suitable pullup on the collector. I wouldn't bother trying to make it bidirectional, just allow for a solder bridge to select input or output and there again you could use an NPN for the output.

    At some point you just have to accept the fact that no matter how much you try to cater for that one-off mishap, it probably won't happen that way but I've seen "sparkies" wire up AC mains to logic inputs then try to claim a replacement under warranty (the smelly black bits give it away).
  • hatallica wrote: »
    Is it as follows(?):
    External input has tranzorb to ground/common; then series resistor; then Propeller input (with ESD diodes providing final clamp).

    My opinion is that this handles two scenarios well: the 5V logic and the "lightning". Now consider the scenario of a 12V or 24V accidental input. The Propeller is safe, but the tranzorb provides what is essentially a low-impedance short circuit to the external input. The tranzorb and the external equipment will battle to the death. So, again, I go back to defining what is acceptable behavior under various conditions. Otherwise, we are taking wild shots that cannot be back-tested for success.


    @hatallica : Yes, you've got the setup correct. Handling the 5V logic and surges are the main concern. If the user does something silly like connect the car battery likely to be powering this instrument to the input/output pins, I'd like to protect the prop. I suppose at some point the user must take responsibility for damaging the equipment or their power supply.
    The fast cap that was mentioned is in parallel with the 3.3V supply clamp *IF* you are intending to dump input clamp current to the supply. As was mentioned this aspect is almost completely overlooked and while the Prop is running and drawing more current than is dumped then it is fine but this is not the case during reset when very little current is drawn and if the supply were not clamped it would rise to over 4V at which point the Prop substrate itself starts to breakdown. Even if it doesn't destroy the chip I have seen this stopping the Prop from starting up.

    The best solution? Just limit the current and if speed is not a problem you could even use 1M resistors but even just 100k will limit 24V inputs to around 200ua. The other solution for a high voltage fast input is to just use an NPN input with a suitable pullup on the collector. I wouldn't bother trying to make it bidirectional, just allow for a solder bridge to select input or output and there again you could use an NPN for the output.

    At some point you just have to accept the fact that no matter how much you try to cater for that one-off mishap, it probably won't happen that way but I've seen "sparkies" wire up AC mains to logic inputs then try to claim a replacement under warranty (the smelly black bits give it away).

    I think the series resistor current limiting approach is indeed the best way to go. Here's what I'm seeing design wise - seem reasonable now? The regulator is a switching module. I've got reverse polarity protection in there (in the current design and works quite well).

    576 x 355 - 66K
  • Yikes! Putting the tranzorb on the Propeller side is very different!

    I do not imagine that SMAJ5.0A will provide any value in this configuration. It will start to conduct somewhere between 5V and 7V, at which point the Propeller input has already exceeded absolute maximum ratings.

    Putting SMAJ5.0A on the "control in" side of the resistor would be the belt-and-suspenders approach. Then I think that you are good to go!
  • Allow for a minimum load resistor or a clamp diode across the 3.3V supply to ensure that even with the sum of all possible clamp currents that the 3.3V rail will still be within operating limits.
    A good supply clamp can be made with either two yellow or even green LEDs perhaps in series with a small value resistor of around 47R. LEDs make excellent low voltage zeners as unlike zeners they exhibit a sharp turn-on whereas low voltage zeners are so heavily doped that they conduct well before their threshold.

    For most inputs I much prefer a 10k or more and 100k for 24V PLC style inputs and there is no need for tranzorbs except in extreme cases as the internal ESD diodes are just as good at absorbing transients as any other transient diode especially with the large resistor.
  • LEDs make excellent low voltage zeners as unlike zeners they exhibit a sharp turn-on whereas low voltage zeners are so heavily doped that they conduct well before their threshold.

    Thats worth remembering, I've often been dissappointed with small zeners performance being rather 'wooly' around the 'knee' and resorted to using a number of diodes connected in series to get what I want. An led would replace several diodes and possibly give a visual indication of a prolonged condition- interesting.
    Thanks

    Dave
  • A good supply clamp can be made with either two yellow or even green LEDs perhaps in series with a small value resistor of around 47R. LEDs make excellent low voltage zeners as unlike zeners they exhibit a sharp turn-on whereas low voltage zeners are so heavily doped that they conduct well before their threshold.

    Wow! That is a good tip. I've attached an updated drawing to make sure I understood you correctly, but that seems like a great idea to keep the 3V3 rail down. I'm thinking that something like this SMT LED would do the trick?

    @hatallica I'm not sure I follow. With a 10k resistor the propeller should be fine up to about 7.4V input according to the app note. The transzorb will have turned on by then and be clamping that line.
    1654 x 564 - 328K
  • kwinnkwinn Posts: 8,697
    Another circuit protection idea is to have the over voltage leds trigger an scr that shuts off power when an over voltage condition is sensed. The scr could blow a fuse, a breaker, or shut off power until a reset button is pressed.
  • Zeners conduct in the forward direction just like any other diodes but they are usually used in reverse because they are made to breakdown way early. I say this because when we use zeners that is the way we use them but using an LED as a low-voltage zener we place them in the forward conducting arrangement. Silicon diodes exhibit around 0.6V to 0.8V forward voltage drop, Schottkys around 0.4V or much less at really low currents but LEDs are much higher and vary but red start conducting around 1.6V and under "test" current of 20ma (who uses that much?) the forward voltage drop will be 1.8V or more. Green conduct at 1.8 and those yellow LEDs that you linked are start at 1.9V so they won't have the desired effect. But all this is just a suggestion and another very simple way to "clamp" the supply is to use a low value resistor across the supply if you aren't worried about low power, you can even use this with an LED as a power indicator but the main thing is that this provides a load even during reset.
  • geo_leeman wrote: »
    @hatallica I'm not sure I follow. With a 10k resistor the propeller should be fine up to about 7.4V input according to the app note. The transzorb will have turned on by then and be clamping that line.

    Let's step back a bit and look at how each component is proving protection.

    Case 1A: "Control Input" = 5V
    Propeller ESD protection diode clamps "Prop Pin" voltage to just over 3.3V.
    The 10K resistor limits current to about 170uA. Everything is ok.

    Case 2A: "Control Input" = 8.3V
    Propeller ESD protection diode clamps "Prop Pin" voltage to just over 3.3V.
    The 10K resistor limits current to about 500uA. This is marginal.

    Case 3A: "Control Input" spikes to 100V due to lightning.
    Propeller ESD protection diode clamps "Prop Pin" voltage to just over 3.3V.
    The 10K resistor limits current to about 9.67mA. The ESD diode is dead.

    In each case, the ESD protection diode is going to work to clamp "Prop Pin" to just over 3.3V. So, a tranzorb connected at "Prop Pin" will provide no value.


    Now, consider placing the tranzorb on the "Control Input" side. The tranzorb will clamp "Control Input", which in turn limits the current that the ESD protection diode will need to conduct.
  • @hatallica - the energy from transients can be absorbed since they are "transients", a short pulse of energy which is how ESD diodes manage to do their job with "thousands" of volts discharged into a pin.

    For lightning protection I use gas tubes to absorb most of the energy while tranzorbs are faster but also handle the lower voltages. I also use polyfuses and inductive tracks.
  • @Peter Jakacki - all good points.

    My "lightning" example is wildly over-simplified, but I don't want that to distract from the fallacy of having the tranzorb on the Propeller side of the series resistor. Allow me to submit this example instead.

    Case 3A: "mis-wiring 12-24V"
    Propeller ESD protection diode clamps "Prop Pin" voltage to just over 3.3V
    The 10K resistor limits current to 870uA (at 12V) or 2.07mA (at 24V). There may be damage to the Propeller.
  • @hatallica - but in your 2a and 3a won't the tranzorb clamp things to ~7V? I don't see how there is a current problem through the prop's ESD diodes?
  • Yes, we are absolutely on the same page regarding the tranzorb clamping ~7V. Sorry that I am having trouble clearly explaining what is swirling in my head.

    The Propeller input ESD diode will also clamp, but it will start much earlier - as soon as the Propeller input exceeds the 3.3V supply. So, adding the tranzorb at the Propeller pin means that the ESD diode is providing all of the protection.

    Adding the tranzorb on the other side of the series resistor clamps the control input. If control input is clamped ~7V, then the voltage drop across the series resistor is limited. This, in turn, limits the current to the Propeller input ESD diode to a reasonable range (7-3.3V / 10K = 370uA).

  • This is an i/o protection scheme I use especially when a pin has to remain general purpose for either input or output. The SP720/SP721 is an array of 4-layer diodes that have a sharp threshold, designed specifically for this purpose. (Littlefuse, 14 or 6 io respectively). Excess current from below the negative rail is dumped to ground, and excess current from above the positive rail is also dumped to ground via the hefty PNP transistor. The 4.1V zener is actually an IC that has a very sharp knee, and it is biased by the resistor. That plus the thresholds of the PNP and the SP720 diodes make a rather sharp knee for the input at just above 5V. The extra 220 ohm resistors limit the current to the SP720 network and secondarily to the substrate diodes of the µP or protected circuits.
    pinProtectSP720.png
    400 x 310 - 12K
  • geo_leeman wrote: »
    @rbehm I'm not sure of the advantage that cap offers. Unless it is very large, it would just protect from the briefest transient and would round off the corners of logic signals.

    The cap alone does not protect against continuous overvoltage on the pin. This must be achieved by other means, like with the series resistor and the transzorb or like the circuitry in the above mentioned SP720.
    What concerns me is the often seen form of just using two clamp diodes (with optional series resistor) to GND and VCC. and nothing more.
    The purpose of the cap directly after the clamp diodes between VCC and GND (not on the signal) is to temporarily take the energy contained in fast pulses (transients, ESD, indirect lightning effects). This energy will otherwise enter the power traces (which are by no means zero impedance) and possibly damage other components by increasing their supply voltage.
    The cap will not influence normal logic signals because they are below the threshold where the diodes start to conduct.
  • I like to use a HEF40106 to buffer my input signal . Use a 10K resistor in series with the input to the HEF. Power the HEF40106 from the 3.3v on the prop chip.
    Forget about lighting protection there is no stopping it. I've had many people ask me to fix entry gate controllers blown out by lighting. Throw them out and buy a new one.
  • I think for now I'll use the transzorb with a series protection resistor and call that as much protection as I can offer the user from themselves. Ideally they are using gear with pre-wired connectors and if they wire they own they either know what they are doing or know that they are taking a risk. As pointed it - we can't protect against everything. I'm curious to see what failure modes I'll get in the field - I'm sure something interesting will come up.
  • Cluso99Cluso99 Posts: 18,069
    IIRC lightning is typically 7KV-12KV in Australia. Some places are worse than others.

    When I built modems, I put 2x 3R3 1/10W resistors in series followed by a 90V? Transorb. The idea was to blow the resistors if the phone lines were hit. Worked in nearly all cases. Only a few jumped the resistors (probably 0805 back then) and killed the rest of the modem. Of course, that didn't protect the power lines, but that killed the plug packs as well.
  • Right - These instruments will be sitting outdoors with short (3m) cables, but often in places with storms, so hopefully grounding them and this protection will work. It's usual to loose a few during a field deployment, but I'd like to up their chances!
Sign In or Register to comment.