Hi all, I'm using a 5v Pro Trinket to operate a linear actuator, with a 12V 10amphour power supply and 5W solar panel/converter. The Trinket/switch/relay are potted together in electrical grade epoxy and housed in a steel enclosure. This is attached to a steel canister with linear actuator that deliver chemical product on oil&gas wells.
I believe I've addressed EMI from the motor and relay coil inductance with the use of caps and diodes (note schematic). To help prove this, in shop I have the same setup as in the field (minus the 10,000ft of downhole pipe). It's burdened with near max motor load, about 4X of what would be in the field and a short launch period of every 15 mins vs ~8 hours in field. Runs with no problems.
However in the field there's failures as often as twice a week, with the board scrambled and actuator stuck full open, requiring a power down. Its worse in drier climates, leading me to believe its ESD. I've messed with TVS diodes on the power supply and MOVs on the motor leads, but have no definitive results. What ESD protection can be done at board level and/or what other areas should be addressed? Thanks for the input. -Will
ESD affecting Trinket?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- cobalt4life
- Posts: 5
- Joined: Wed Mar 07, 2018 12:57 pm
ESD affecting Trinket?
- Attachments
-
- M-EE Processor 2019.pdf
- (91.08 KiB) Downloaded 65 times
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ESD affecting Trinket?
If you have a couple miles of cable, you're looking at an enormous amount of parasitic inductance.. especially if some of the cable is sitting coiled at ground level.
That would produce spikes on the 12V and GND rails any time the current tried to change suddenly.
I'd suggest adding some heavy-duty filtering to the Pro Trinket's input power.
Start by tapping power for the Pro Trinket off from the main 12V line, and wrapping the positive wire to the Pro Trinket around a ferrite toroid until you're sick of passing the wire through the hole. That will create a secondary current path with its own inductance, mostly independent of the main power cable's inductance.
You only want to add inductance in one of the power lines though, not both. The imbalance between the two lines makes it harder for spikes to pass through.
Then I'd add a couple stages of low-pass filters clamped by Zener diode shunts:
The inductance should make voltage spikes in the main cable mostly stay in the main cable. The capacitors will absorb most of what gets through, limited by the amount of current that can flow through the 15-Ohm resistors. The Zeners will keep any voltage spikes that do get through the capacitors from rising too far.
That should keep what happens in the wire under control, but you'll also have to deal with the EMF pulses. For that, I'd suggest making a Faraday cage.
The steel enclosure you mentioned could be convenient, but the shield needs to be grounded and I doubt you want an electrical connection between your circuit and the earth around it.
The best cage would be a short piece of copper pipe with end caps, assuming the potted circuit can fit into a standard size pipe. You don't need to solder the endcaps in place, but use some dielectric grease to make sure there's a good electrical connection. Connect the pipe to the Pro Trinket's GND pin, then wrap the whole thing in a layer of insulating material like Kapton tape to keep it from shorting to the steel.
EMF induces current in any conductor it passes through, but the current mostly stays on the surface of the conductor. The resistance inside the conductor is low enough that the electrons will keep moving until they reach a surface where they can't go any farther. Below the layer of electrons on the surface, the voltage between any two points inside the conductor is nearly zero, so the effects of the EMF outside the surface are no longer felt.
The same principle applies if you cut a hole out of the center of the conductor. As long as the remaining surface is thick enough (a value that depends on frequency, but 0.2mm is plenty for most applications), the voltage inside the metal drops to negligible levels before you reach the inner surface.
Connecting the shield to the Pro Trinket's GND pin holds the voltage of the inside surface at a known level, further preventing any EMF effects from getting through.
That would produce spikes on the 12V and GND rails any time the current tried to change suddenly.
I'd suggest adding some heavy-duty filtering to the Pro Trinket's input power.
Start by tapping power for the Pro Trinket off from the main 12V line, and wrapping the positive wire to the Pro Trinket around a ferrite toroid until you're sick of passing the wire through the hole. That will create a secondary current path with its own inductance, mostly independent of the main power cable's inductance.
You only want to add inductance in one of the power lines though, not both. The imbalance between the two lines makes it harder for spikes to pass through.
Then I'd add a couple stages of low-pass filters clamped by Zener diode shunts:
The inductance should make voltage spikes in the main cable mostly stay in the main cable. The capacitors will absorb most of what gets through, limited by the amount of current that can flow through the 15-Ohm resistors. The Zeners will keep any voltage spikes that do get through the capacitors from rising too far.
That should keep what happens in the wire under control, but you'll also have to deal with the EMF pulses. For that, I'd suggest making a Faraday cage.
The steel enclosure you mentioned could be convenient, but the shield needs to be grounded and I doubt you want an electrical connection between your circuit and the earth around it.
The best cage would be a short piece of copper pipe with end caps, assuming the potted circuit can fit into a standard size pipe. You don't need to solder the endcaps in place, but use some dielectric grease to make sure there's a good electrical connection. Connect the pipe to the Pro Trinket's GND pin, then wrap the whole thing in a layer of insulating material like Kapton tape to keep it from shorting to the steel.
EMF induces current in any conductor it passes through, but the current mostly stays on the surface of the conductor. The resistance inside the conductor is low enough that the electrons will keep moving until they reach a surface where they can't go any farther. Below the layer of electrons on the surface, the voltage between any two points inside the conductor is nearly zero, so the effects of the EMF outside the surface are no longer felt.
The same principle applies if you cut a hole out of the center of the conductor. As long as the remaining surface is thick enough (a value that depends on frequency, but 0.2mm is plenty for most applications), the voltage inside the metal drops to negligible levels before you reach the inner surface.
Connecting the shield to the Pro Trinket's GND pin holds the voltage of the inside surface at a known level, further preventing any EMF effects from getting through.
- cobalt4life
- Posts: 5
- Joined: Wed Mar 07, 2018 12:57 pm
Re: ESD affecting Trinket?
Sorry for the misunderstanding, but the motor and power leads are <3ft in length. The unit just sits on a large pipe network, what I assume would be a perfect place to pick up static charge. In theory I could ground the board to this well "grounded" pipe network, but your idea of a Faraday cage seems safer considering the environment.adafruit_support_mike wrote:If you have a couple miles of cable, you're looking at an enormous amount of parasitic inductance.. especially if some of the cable is sitting coiled at ground level.
I love the idea of the filtering, but my question is, wouldn't I need to use 12V Zener diodes? My understanding is with the 5.1V rating, any voltage above 5.1 the diode will allow current (only limited by the 15ohm resister) to cross through, basically creating a short since the system is 12V?
Besides protecting the power rails, could the I/Os be vulnerable and require similar diode shunting etc? Thanks for the help! -Will
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ESD affecting Trinket?
Zener diodes are normally used as shunt voltage regulators: their resistance looks infinite up to a certain voltage, then falls dramatically.
Taking the 5.1V Zeners above as an example, they'll look like an infinite resistance below about 5V, and like a short circuit above about 5.2V. Putting them in parallel with a load means any spikes higher than 5.2V-ish will get shorted through the Zener.
When you use a Zener in series with a load, it drops the incoming voltage by that much.. if you have a 12V power source, a 5V Zener, then the load, the voltage across the Zener will be about 5V and the load will see an input voltage of about 7V.
Your schematic showed a series Zener, but the symbol was drawn upside-down.. if you connect a Zener like a regular diode, it acts like a regular diode with a forward voltage of about 0.7V. You get the shunt voltage from a reverse-biased Zener. It's a reverse-biased diode designed to fail in a non-destructive way at a predictable and repeatable voltage.
I used 5.1V Zeners on the assumption that the voltage going to the Pro Trinket's BAT pin would be around 5V. You could replace them with 12V Zeners if you want that input voltage, or split the difference with a 6V series Zener dropping the 12V input to 6V, and 6V Zeners in parallel with the filters to shunt any spikes away from the Pro Trinket.
That latter one would be a good option, actually.. Zeners have nearly ideal performance around 6V.
I didn't think it would be necessary to shield the output because I thought the PN2222 was physically close to the linear actuator, and the built-in flyback protection diode in that would guard against any voltages that could cause problems. A BJT's base-emitter and base-conductor junctions are diodes though, and are also subject to reverse breakdown.
I don't think there's any chance of seeing reverse breakdown from the emitter to the base, but the collector could break down at about 60V. If the actuator sees voltage spikes from the downhole cable, it could potentially carry the diode along with the supply voltage. Under those circumstances, diode-clamping the GPIO pin that toggles the PN2222 to the filtered supply voltage might be useful.
Better yet would be to replace the PN2222 with an optocoupler. That will give you a hard disconnect between the microcontroller and the load that's good up to a kilovolt or so.
Taking the 5.1V Zeners above as an example, they'll look like an infinite resistance below about 5V, and like a short circuit above about 5.2V. Putting them in parallel with a load means any spikes higher than 5.2V-ish will get shorted through the Zener.
When you use a Zener in series with a load, it drops the incoming voltage by that much.. if you have a 12V power source, a 5V Zener, then the load, the voltage across the Zener will be about 5V and the load will see an input voltage of about 7V.
Your schematic showed a series Zener, but the symbol was drawn upside-down.. if you connect a Zener like a regular diode, it acts like a regular diode with a forward voltage of about 0.7V. You get the shunt voltage from a reverse-biased Zener. It's a reverse-biased diode designed to fail in a non-destructive way at a predictable and repeatable voltage.
I used 5.1V Zeners on the assumption that the voltage going to the Pro Trinket's BAT pin would be around 5V. You could replace them with 12V Zeners if you want that input voltage, or split the difference with a 6V series Zener dropping the 12V input to 6V, and 6V Zeners in parallel with the filters to shunt any spikes away from the Pro Trinket.
That latter one would be a good option, actually.. Zeners have nearly ideal performance around 6V.
Hrm.. I suppose that's possible.cobalt4life wrote:Besides protecting the power rails, could the I/Os be vulnerable and require similar diode shunting etc?
I didn't think it would be necessary to shield the output because I thought the PN2222 was physically close to the linear actuator, and the built-in flyback protection diode in that would guard against any voltages that could cause problems. A BJT's base-emitter and base-conductor junctions are diodes though, and are also subject to reverse breakdown.
I don't think there's any chance of seeing reverse breakdown from the emitter to the base, but the collector could break down at about 60V. If the actuator sees voltage spikes from the downhole cable, it could potentially carry the diode along with the supply voltage. Under those circumstances, diode-clamping the GPIO pin that toggles the PN2222 to the filtered supply voltage might be useful.
Better yet would be to replace the PN2222 with an optocoupler. That will give you a hard disconnect between the microcontroller and the load that's good up to a kilovolt or so.
- jps2000
- Posts: 811
- Joined: Fri Jun 02, 2017 4:12 pm
Re: ESD affecting Trinket?
Sorry but the filter drawn here has some room for improvements. The first resistor burns 3.3 Watt!! without additional load.
May be your problems are caused by totally different reasons.
For example in your schematic the button raises some concerns.
The pin is open when the button is not pressed and hence extremely sensitive.
So you should have a pullup here ( The programmable pullup is still high impedance) and also a small cap (10-100n) to gnd may be considered.
With respect to supply I suggest a voltage regulator (LM317, 7808 or the like) or simply a resistor in series. In your circuit the 5V1 zener does not do reasonable things. It works as a normal diode in this orientation.
Another point is the rotary switch
Again open inputs. Here the question is what does the software do if more than one input reads LOW ??
May be your problems are caused by totally different reasons.
For example in your schematic the button raises some concerns.
The pin is open when the button is not pressed and hence extremely sensitive.
So you should have a pullup here ( The programmable pullup is still high impedance) and also a small cap (10-100n) to gnd may be considered.
With respect to supply I suggest a voltage regulator (LM317, 7808 or the like) or simply a resistor in series. In your circuit the 5V1 zener does not do reasonable things. It works as a normal diode in this orientation.
Another point is the rotary switch
Again open inputs. Here the question is what does the software do if more than one input reads LOW ??
- cobalt4life
- Posts: 5
- Joined: Wed Mar 07, 2018 12:57 pm
Re: ESD affecting Trinket?
Yes I need to change the drawing, in reality I wire it correctly to drop the voltage by 5.1V (someone told me it gives the MCU's voltage regulator an easier time, idk). I have an assortment of Zeners arriving tomorrow, and will split the difference like you suggested. Will have to account for voltage fluctuations in the field due to solar output. Had to google optocoupler, that's pretty neat! I understand the I/Os have their own built-in ESD/voltage protection, but not sure if one of them received a shock if that would even caused the board to lock up.adafruit_support_mike wrote:Your schematic showed a series Zener, but the symbol was drawn upside-down.. if you connect a Zener like a regular diode, it acts like a regular diode with a forward voltage of about 0.7V. You get the shunt voltage from a reverse-biased Zener. It's a reverse-biased diode designed to fail in a non-destructive way at a predictable and repeatable voltage.
I use the program's pullup resisters for all of the inputs. Still concerned with the single push button switch because its ~3ft to reach outside of the enclosure and makes me think of a antenna to pick up noise or static. Guess the 0.1uF cap will take care of that.adafruit_support_mike wrote:The pin is open when the button is not pressed and hence extremely sensitive.
So you should have a pullup here ( The programmable pullup is still high impedance) and also a small cap (10-100n) to gnd may be considered.
I have a lot of parameter discrimination, as I'll call it, in my code:adafruit_support_mike wrote:Again open inputs. Here the question is what does the software do if more than one input reads LOW ??
Code: Select all
if ((scada == LOW) && (p == 0) && (off == HIGH) && (time1 == HIGH) && (time2 == HIGH) && (time3 == HIGH) && (time4 == HIGH) && (time5 == HIGH) && (time6 == HIGH) && (time7 == HIGH) && (time8 == HIGH) && (time9 == HIGH) && (button == HIGH)){
scadaWait = currentTime;
sW = 1;
p = 1; // SCADA input must be released before taking another input.
}
else if (scada == HIGH){
p = 0;
}
Please be positive and constructive with your questions and comments.