Input Protection - Page 1
Forum section: electronics / projects

author: Seph.b
author_rank: Regular Contributor
timestamp: May 14, 2018, 08:32:22 pm
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: May 14, 2018, 10:06:23 pm
content: 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 14, 2018, 10:46:03 pm
content: Quote from: David Hess on May 14, 2018, 10:06:23 pmI 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.

author: RobertHolcombe
author_rank: Frequent Contributor
timestamp: May 14, 2018, 11:00:16 pm
content: Digikey have a good beginner article here:https://www.digikey.com.au/en/articles/techzone/2012/apr/protecting-inputs-in-digital-electronicsPersonally having the circuit and resulting waveform images helped me greatly in understanding, I still occasionally reference the article from time to time

author: David Hess
author_rank: Super Contributor
timestamp: May 15, 2018, 02:49:25 am
content: Quote from: Seph.b on May 14, 2018, 10:46:03 pmI 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 15, 2018, 04:50:51 pm
content: Quote from: RobertHolcombe on May 14, 2018, 11:00:16 pmI 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.

author: georges80
author_rank: Frequent Contributor
timestamp: May 15, 2018, 05:32:06 pm
content: 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 15, 2018, 05:44:03 pm
content: Quote from: georges80 on May 15, 2018, 05:32:06 pmLOL, 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.

author: georges80
author_rank: Frequent Contributor
timestamp: May 15, 2018, 06:00:51 pm
content: 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.

author: Gyro
author_rank: Super Contributor
timestamp: May 15, 2018, 06:07:39 pm
content: Quote from: Seph.b on May 15, 2018, 05:44:03 pmNo, stick another series resistor in there, it will double the voltage withstand (element limiting) voltage versus a single resistor package.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 15, 2018, 07:23:33 pm
content: Quote from: Gyro on May 15, 2018, 06:07:39 pmOK, I will replace it with another 1k resistor.

author: JS
author_rank: Frequent Contributor
timestamp: May 16, 2018, 02:05:23 am
content: Quote from: Seph.b on May 15, 2018, 07:23:33 pmIf 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

author: Gibson486
author_rank: Frequent Contributor
timestamp: May 16, 2018, 02:25:39 pm
content: 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 16, 2018, 03:50:49 pm
content: Quote from: JS on May 16, 2018, 02:05:23 amThanks, I will read up on TVS diodes today.

author: splin
author_rank: Frequent Contributor
timestamp: May 16, 2018, 08:29:50 pm
content: Quote from: David Hess on May 15, 2018, 02:49:25 amHow 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.

author: David Hess
author_rank: Super Contributor
timestamp: May 16, 2018, 08:46:04 pm
content: Quote from: splin on May 16, 2018, 08:29:50 pmThey 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 16, 2018, 09:26:31 pm
content: Quote from: David Hess on May 16, 2018, 08:46:04 pmI 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.

author: Seph.b
author_rank: Regular Contributor
timestamp: May 16, 2018, 09:38:21 pm
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: May 17, 2018, 12:02:53 am
content: Quote from: Seph.b on May 16, 2018, 09:26:31 pmGet along reach butane lighterand 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.QuotePhysically 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.Quote from: Seph.b on May 16, 2018, 09:38:21 pmI 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".

author: Seph.b
author_rank: Regular Contributor
timestamp: May 17, 2018, 12:10:50 am
content: Thanks for all the help!