Author Topic: Input Protection  (Read 5552 times)

0 Members and 2 Guests are viewing this topic.

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Input Protection
« on: May 14, 2018, 08:32:22 pm »
Many of the boards I make can/do have their inputs connected to parts that are exposed to touch, can be hooked to very long wires, or both. I am trying to make those inputs as robust as possible. Both to being fried and to getting triggered falsely by EMI or static electricity.

I also need to protect against incorrect wiring during the install process, such as hooking a 12v supply directly to an input. The inputs are generally just buttons, switches, or similar; no analog or digital signals.

Most of the boards use ATMegas, but I also use raw 4000 series ICs when it makes sense. 4000s ICs seem much more fragile so I made my first board with my ideas on input protection using one of these.

Attached is a pic of the protection I added to my 4082 board, which should be waiting in my mail box when I get home.

There is a diode to protect against reverse current, a current limiting resistor, a PPTC for extra current limiting, a cap to filter out any EMI/static, and a zener to cap the voltage at an appropriate level.

What do you guys think? Have an suggestions? Would I be better off just using an optoisolator?

Please let me know if you want me to clarify anything.

If mods think this is better of in the Beginners section feel free to move it.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19235
  • Country: us
  • DavidH
Re: Input Protection
« Reply #1 on: May 14, 2018, 10:06:23 pm »
Series protection works well as you have discovered with high impedance inputs which includes CMOS.  Do not forget the breakdown voltage of the series resistor however.  This is one of those applications where a physically larger part with a higher voltage rating or even a special high voltage part is suitable.

Optocouplers are not particularly high impedance but have the advantage of providing galvanic isolation which is probably not needed in your application.  I really like using them for exposed electrical interfaces.

Also watch out for protecting outputs.  LED indicators can carry ESD discharges directly through the plastic into an output pin.  This can happen with switches as well.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #2 on: May 14, 2018, 10:46:03 pm »
Also watch out for protecting outputs.  LED indicators can carry ESD discharges directly through the plastic into an output pin.  This can happen with switches as well.

I yet to run into that. I generally use a transistor to drive any output, including just a single LED. I used to use 2N3904, but am moving to as much SMD as possible so now it would be a MMBT3904.

Other than LEDs, pretty much all of the outputs are relays with a flyback diode (LL4148) driven by a transistor.
 

Offline RobertHolcombe

  • Frequent Contributor
  • **
  • Posts: 275
  • Country: au
Re: Input Protection
« Reply #3 on: May 14, 2018, 11:00:16 pm »
Digikey have a good beginner article here: https://www.digikey.com.au/en/articles/techzone/2012/apr/protecting-inputs-in-digital-electronics

Personally having the circuit and resulting waveform images helped me greatly in understanding, I still occasionally reference the article from time to time
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19235
  • Country: us
  • DavidH
Re: Input Protection
« Reply #4 on: May 15, 2018, 02:49:25 am »
Also watch out for protecting outputs.  LED indicators can carry ESD discharges directly through the plastic into an output pin.  This can happen with switches as well.

I yet to run into that. I generally use a transistor to drive any output, including just a single LED. I used to use 2N3904, but am moving to as much SMD as possible so now it would be a MMBT3904.

I usually do the same thing.  The external transistor serves to block ESD and also prevents high currents into the logic supply voltages which can be separated from the indicator supply voltages.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #5 on: May 15, 2018, 04:50:51 pm »
Digikey have a good beginner article here: https://www.digikey.com.au/en/articles/techzone/2012/apr/protecting-inputs-in-digital-electronics

Personally having the circuit and resulting waveform images helped me greatly in understanding, I still occasionally reference the article from time to time

I read that one quite a few time and combined it with some other things I had read to make the circuit that I posted. It is a really helpful visual article.
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Input Protection
« Reply #6 on: May 15, 2018, 05:32:06 pm »
Not sure the point of your PTC. With a 1k series resistor you would need 50V across the 1k to get 50mA to flow. That's 50V x 50mA = 2.5W being dissipated by the resistor...

cheers,
george.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #7 on: May 15, 2018, 05:44:03 pm »
Not sure the point of your PTC. With a 1k series resistor you would need 50V across the 1k to get 50mA to flow. That's 50V x 50mA = 2.5W being dissipated by the resistor...

cheers,
george.

LOL, that is a good point. I will put a 0ohm resistor there instead.

Originally I wanted a 20mA PTC, but that was the smallest I could find in an 0805 footprint that was reasonably priced.
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Input Protection
« Reply #8 on: May 15, 2018, 06:00:51 pm »
I would stick with the 1k (or even a 10k) and ditch the PTC - there's really no point having it - what is it meant to protect against?

Keep a cap and zener or TVS on the uC side of the 1k or 10k resistor to clamp/filter any momentary spikes, ESD events.

On my circuits that go into a vehicle I use a series 10k, a 0.1uF (or even 1uF) depending on RC constant I want to deal with. Then a low voltage TVS or diode pair to clamp any spike below ground potential or above VCC potential. I usually then feed that through a 2n7002 FET (will use a 1M pull up resistor on the gate) to finally drive the uC. Seems to have survived well for many years on various vehicle uC projects I've implemented on my 4wds - reasonably harsh environments with winch/starter motor induced spikes etc.

cheers,
george.
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 11204
  • Country: gb
Re: Input Protection
« Reply #9 on: May 15, 2018, 06:07:39 pm »
Not sure the point of your PTC. With a 1k series resistor you would need 50V across the 1k to get 50mA to flow. That's 50V x 50mA = 2.5W being dissipated by the resistor...

cheers,
george.

LOL, that is a good point. I will put a 0ohm resistor there instead.

Originally I wanted a 20mA PTC, but that was the smallest I could find in an 0805 footprint that was reasonably priced.

No, stick another series resistor in there, it will double the voltage withstand (element limiting) voltage versus a single resistor package.
Best Regards, Chris
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #10 on: May 15, 2018, 07:23:33 pm »
Not sure the point of your PTC. With a 1k series resistor you would need 50V across the 1k to get 50mA to flow. That's 50V x 50mA = 2.5W being dissipated by the resistor...

cheers,
george.

LOL, that is a good point. I will put a 0ohm resistor there instead.

Originally I wanted a 20mA PTC, but that was the smallest I could find in an 0805 footprint that was reasonably priced.

No, stick another series resistor in there, it will double the voltage withstand (element limiting) voltage versus a single resistor package.

OK, I will replace it with another 1k resistor.
 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: Input Protection
« Reply #11 on: May 16, 2018, 02:05:23 am »
OK, I will replace it with another 1k resistor.

  If you have two resistors you could use Si diodes instead of schottky ones, even if they conduct at the same voltage the internal diodes will, as they have a 1k resistor in the middle the internal ones have no current to conduct, probably under 100µA.

  If you can afford two schottky diodes you can probably afford a TVS, in which case you need only one part and only connected to ground, even less if you consider multiple channels ones are available so one part for a few channels. They also come with two sets of diodes and an internal resistor, you would just need to add a cap for filter/debounce the signal and you are good to go. It all depends on the BOM costs you aim for, the reliability and the environment you are working in.

  Few weeks ago I build a circuit to communicate over one wire interface on a boat, tested on my boat first for a few days, all good, installed it, tested it ok. Next day the owner reports it didn't worked, the serial wiring on the client boat was close to the engine, when it was running the alternator noise wouldn't let the communication to work properly. For now I relocated the device and the client didn't came back but I need to solve the problem. Changing the wiring location is not an option so I'm thinking in lowering the pull-up resistor value, but I have to look that further as it might not be compliant with the standard (or simulating too many devices on the network). Enviroment can sometimes be a bitch.

JS
If I don't know how it works, I prefer not to turn it on.
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Input Protection
« Reply #12 on: May 16, 2018, 02:25:39 pm »
I have great luck with just using diodes. Be sure to go to VDD and GND as well since ESD can take form as negative transients as well. You can even combine them. Start with the regular diodes to VDD and to GND, then put a TVS diode next to it.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #13 on: May 16, 2018, 03:50:49 pm »
OK, I will replace it with another 1k resistor.

  If you have two resistors you could use Si diodes instead of schottky ones, even if they conduct at the same voltage the internal diodes will, as they have a 1k resistor in the middle the internal ones have no current to conduct, probably under 100µA.

  If you can afford two schottky diodes you can probably afford a TVS, in which case you need only one part and only connected to ground, even less if you consider multiple channels ones are available so one part for a few channels. They also come with two sets of diodes and an internal resistor, you would just need to add a cap for filter/debounce the signal and you are good to go. It all depends on the BOM costs you aim for, the reliability and the environment you are working in.

  Few weeks ago I build a circuit to communicate over one wire interface on a boat, tested on my boat first for a few days, all good, installed it, tested it ok. Next day the owner reports it didn't worked, the serial wiring on the client boat was close to the engine, when it was running the alternator noise wouldn't let the communication to work properly. For now I relocated the device and the client didn't came back but I need to solve the problem. Changing the wiring location is not an option so I'm thinking in lowering the pull-up resistor value, but I have to look that further as it might not be compliant with the standard (or simulating too many devices on the network). Enviroment can sometimes be a bitch.

JS

Thanks, I will read up on TVS diodes today.
 

Online splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Input Protection
« Reply #14 on: May 16, 2018, 08:29:50 pm »
Also watch out for protecting outputs.  LED indicators can carry ESD discharges directly through the plastic into an output pin.  This can happen with switches as well.

I yet to run into that. I generally use a transistor to drive any output, including just a single LED. I used to use 2N3904, but am moving to as much SMD as possible so now it would be a MMBT3904.

I usually do the same thing.  The external transistor serves to block ESD and also prevents high currents into the logic supply voltages which can be separated from the indicator supply voltages.

How rugged are low voltage SMT transistors like the 3904 (and the LED) in the face of ESD discharges? The relatively expensive microcontroller/logic may be saved but the product may still become unusable if an LED stops working. We would probably investigate and replace a blown driver transistor/LED but for most people repair is not economic.

If you need additional protection for the LED and/or transistor then you may as well skip the transistor.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19235
  • Country: us
  • DavidH
Re: Input Protection
« Reply #15 on: May 16, 2018, 08:46:04 pm »
How rugged are low voltage SMT transistors like the 3904 (and the LED) in the face of ESD discharges? The relatively expensive microcontroller/logic may be saved but the product may still become unusable if an LED stops working. We would probably investigate and replace a blown driver transistor/LED but for most people repair is not economic.

If you need additional protection for the LED and/or transistor then you may as well skip the transistor.

They are usually more rugged than a CMOS logic input or output.  In a switching application, beta degradation from reverse breakdown on the base-emitter junction is not a serious problem.  Offhand I have never seen a 2N3904 fail due to ESD in this application but I have seen CMOS ICs (but not TTL) fail under the same conditions.

If it mattered, I would test different configurations to destruction.  If a 2N3904 is not tough enough, then a 2N4401 might be.

I have seen some designs where the exposed I/O buffers used socketted ICs for easy replacement.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #16 on: May 16, 2018, 09:26:31 pm »
How rugged are low voltage SMT transistors like the 3904 (and the LED) in the face of ESD discharges? The relatively expensive microcontroller/logic may be saved but the product may still become unusable if an LED stops working. We would probably investigate and replace a blown driver transistor/LED but for most people repair is not economic.

If you need additional protection for the LED and/or transistor then you may as well skip the transistor.

They are usually more rugged than a CMOS logic input or output.  In a switching application, beta degradation from reverse breakdown on the base-emitter junction is not a serious problem.  Offhand I have never seen a 2N3904 fail due to ESD in this application but I have seen CMOS ICs (but not TTL) fail under the same conditions.

If it mattered, I would test different configurations to destruction.  If a 2N3904 is not tough enough, then a 2N4401 might be.

I have seen some designs where the exposed I/O buffers used socketted ICs for easy replacement.

I try to always put THT ICs in sockets for easy replacement. Sometimes we even send extra (programmed if applicable) ICs with things. I still don't trust end users to be able to replace them with all the legs intact.

What would be a more rugged option for output protection? I will compare the datasheets on the 2n3904 and 2n4401.

Is there a good way to test ESD without expensive equipment? This winter would have been perfect, I was getting pretty epic static shocks. Now that the weather is changing they went away. I played around with rubbing some styrofoam but it doesn't seem to work to well.
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #17 on: May 16, 2018, 09:38:21 pm »
Would using a common emitter vs a common collector make any difference? Besides the signal being inverted.

I normally use a common collector design, because that was the logical way for a transistor to work in my brain. The only time I have used a common emitter is when I want the inverting. From what I have read recently common emitter has other advantages to though like less voltage drop and less dissipation in the transistor.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19235
  • Country: us
  • DavidH
Re: Input Protection
« Reply #18 on: May 17, 2018, 12:02:53 am »
Is there a good way to test ESD without expensive equipment? This winter would have been perfect, I was getting pretty epic static shocks. Now that the weather is changing they went away. I played around with rubbing some styrofoam but it doesn't seem to work to well.

Get a long reach butane lighter and remove the guard so you can use the included piezoelectric ignition to zap exactly where you need to.  You can even get a rough calibration of the voltage based on the length of spark.

Quote
What would be a more rugged option for output protection? I will compare the datasheets on the 2n3904 and 2n4401.

Physically larger junctions are tougher.  I only suggested the 2N4401 because it is about 4 times the size of the 2N3904 but costs about the same.

If you are really worried, then add dedicated ESD protection in the form of diodes, resistors, and capacitors.  Put a diode in anti-parallel with the LED to protect it from reverse breakdown.

Some designs use light guides for the LEDs and stand-offs for the pushbuttons to keep ESD menacing fingers away.

Would using a common emitter vs a common collector make any difference? Besides the signal being inverted.

I normally use a common collector design, because that was the logical way for a transistor to work in my brain. The only time I have used a common emitter is when I want the inverting. From what I have read recently common emitter has other advantages to though like less voltage drop and less dissipation in the transistor.

I am not sure it matters as long as one terminal of the transistor is tied directly to ground or power which will not always be the case with common-base.

Common-collector and common-emitter have the advantage of minimizing the current required from the logic gate.  Common-emitter and common-base maximize the output compliance (have the least voltage drop).  Common-emitter has both advantages and is usually what I see and it is what most people think of as "switching".
« Last Edit: May 17, 2018, 02:05:49 am by David Hess »
 

Offline Seph.bTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Input Protection
« Reply #19 on: May 17, 2018, 12:10:50 am »
Thanks for all the help!  :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->