Do I need to use zener clamping? - Page 1
Forum section: electronics / beginners

author: kjr18
author_rank: Regular Contributor
timestamp: August 06, 2018, 02:53:40 pm
content: Hi, I'm making something that uses attiny13. uC is used for detecting voltage on two inputs and depending on both inputs, outputting some different pwm signal. As this will be used in a car like environment, should I use clamping on both inputs as well as on voltage supply?

author: Benta
author_rank: Super Contributor
timestamp: August 06, 2018, 05:31:18 pm
content: Yes, you need protection. An automotive environment is one of the dirtiest you can operate in (electrically-wise).I'd strongly suggest using an automotive voltage regulator that will survive a 60-V load dump. For the inputs, use double Schottky diodes for deflecting over/under voltage transients to V+ or ground.

author: Ian.M
author_rank: Super Contributor
timestamp: August 06, 2018, 07:05:01 pm
content: As Benta points out, you *need* clamping. I'd clamp the taps of the input potential dividers with Schottky diodes as he suggests, then add 1K resistors between the divider taps and the input pins. A few nF of capacitance to ground at the taps would go a long way towards making it less sensitive to transients and EMI.As the whole circuit only needs a few mA at +5V for the ATtiny13 and the MOSFET gate drive, consider using a 5.1V Zener as a shunt regulator. As long as it and its dropper resistor have adequate wattage ratings, it will be immune to typical automotive supply transients and load dumps. I'd also upgrade the BC547B to something with a Vceo comparable to the MOSFET Vds breakdown voltage (100V) so it can survive the transients unprotected.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 06, 2018, 07:37:14 pm
content: Toss on a MMSZ5231B and you're fine.I wouldn't actually recommend clamp diodes, because there's nowhere for the current to go -- likely you don't have much load on the 5V supply, so it will be pulled up, and cause problems. The solution to that, is a TVS across the supply. Which isn't a bad idea, and usually comes for free in TVS array chips, which is not a bad idea here.You may also want to replace Q1 with a protected switch device. This is a MOSFET with an internal control circuit to handle level shifting (may not need Q2 and resistors), to protect against excessive voltage, current and temperature (but not all three at once, obviously(?)).As-is, you still may want to protect Q1's gate with a zener, 5 to 15V rating is fine. The zener would be wired from gate to source, in parallel with R5. Q2 should then have a resistor added in series with its collector, maybe 1-10k, so it doesn't draw excessive current through the zener. This protects against excessive input voltage (automotive load dump can swell up to 40V+, well outside of Q1's Vgs(max) rating).Tim

author: Ian.M
author_rank: Super Contributor
timestamp: August 06, 2018, 09:14:24 pm
content: Good catch on the need for a gate-source Zener.Yes, clamping to the +5V rail can cause it to rise, but if you use a shunt regulator (which is only possible because the operating current is so low), that's entirely manageable. As the ATtiny13 has internal ESD clamping diodes, not fitting external Schottky ones wont prevent the rail rising if a series regulator is used. You'd need clamps that divert current to ground to do that.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 07, 2018, 12:18:41 pm
content: ESD diodes on MCUs is not usually a good idea, especially if you're using the ADC, which seems to be the case here. For general purpose logic, I don't mind a few mA peak.Tim

author: kjr18
author_rank: Regular Contributor
timestamp: August 08, 2018, 05:57:53 pm
content: Thanks for all your answers. This thing that I'm making is just one piece for myself, it will be tail light/stop light led driver for my diy tractor, that's why I said car like environment. Both inputs are for switches, one for brake pedal switch, second one for tail light. So I need to clamp both inputs, output transistor and input or use zener diode to supply mcu, right? I want it to be simple so things like tvs arrays are a bit of overkill for me, and zener diodes are cheap.Also I have another question, those spikes in voltage, won't they be suppressed by car battery?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 08, 2018, 07:00:55 pm
content: Short spikes occur specifically because the battery is at a distance from the stuff making the racket -- ignition and lights and motors and relays turning on and off. The wiring has stray inductance, probably on the order of 5uH. (This is also the value used in most automotive test fixtures.)The other tests commonly done -- undervoltage, overvoltage and reverse -- occur during cranking (low voltage), jump starting (when backwards (reverse) or when accidentally jumped to a 28V system -- that one seems rare though!). These involve large currents (or a completely faulty battery), so the voltage can change a lot. The final test occurs when the battery comes entirely disconnected: load dump, where the alternator generates a large voltage swell without a battery connected to reign it in.So if you don't need to worry about your project turning into a lump of charcoal when one of these -- probably quite rare -- events occurs, there you go, don't worry about dealing with it.Fast transients are definitely worth a think. Filtering on signal inputs, and often outputs too, helps prevent random upsets or mysterious failures. Basically, 10nF across those signal input zener diodes would do a good job.Tim