Propeller Pin Protection
geo_leeman
Posts: 190
in Propeller 1
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
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.
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.
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.
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.
Correct.
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.
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 : 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.
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).
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!
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.
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
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.
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.
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.
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.
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).
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.
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.
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.