Protection diode placement - Page 1
Forum section: electronics / projects

author: sentry7
author_rank: Regular Contributor
timestamp: October 04, 2015, 04:06:50 pm
content: Hey guys,I need to put a safety diode in the power section of my design; below is a diagram of the power section. Since the 7805 regulator is voltage sensitive, should the diode go before the regulator?

author: Zero999
author_rank: Super Contributor
timestamp: October 04, 2015, 04:12:14 pm
content: Yes, put the diode before the regulator.If the diode were connected after the regulator, then not only would the regulator be no longer protected, but the voltage drop due to the diode would ruin the regulation.

author: sentry7
author_rank: Regular Contributor
timestamp: October 04, 2015, 05:01:29 pm
content: Thanks for the help guys. So this is the correct placement? I've also been thinking about the switch placement. SW10 is supposed to be a main power switch, but with it being where it is, even if it's in the "OFF" position, there's still power going to the regulator, right?

author: sentry7
author_rank: Regular Contributor
timestamp: October 04, 2015, 05:14:03 pm
content: Quote from: blueskull on October 04, 2015, 05:05:09 pmSorry, I think my diagram is confusing (or I'm confused). The up position is OFF, and it is connected to nothing. the down position is ON and it is labeled as +5v (for the load). The skinny triangle is the way that the program shows voltage source.

author: DanielS
author_rank: Frequent Contributor
timestamp: October 04, 2015, 05:33:28 pm
content: If there is any chance the input side of the 7805 might get shorted to ground or powered down while there is still any voltage on the output, you may want to add a diode from the 7805's output to its input to protect the 7805 against reverse biasing - many linear regulators are ridiculously sensitive to that too.

author: mariush
author_rank: Super Contributor
timestamp: October 04, 2015, 05:39:33 pm
content: You don't need two 0.1uF capacitors at the input ( C20 and C21), one will be enough. However, most datasheets recommend an input capacitor of 0.33uF or higher if there's long input power cable.I'd suggest going for a 10-22 uF ceramic or electrolytic capacitor rated for 25-50v (even if your input is only 7.5-9v) besides the 0.1uF ceramic capacitor. It wouldn't hurt to have some capacitance at the output as well, even if it's not required in most cases. I typically use anything between 33 and 100uF electrolytic, rated for 16-35v even if the output is 5v, because there's little difference in diameters and volume of capacitors at this specs.As for reverse voltage protection, you may consider using a p-channel mosfet instead of diode, it's quite easy and just a bit more expensive. See Afrotechmods video for a nice tutorial :ps. I'd also move the on/off switch right at the input jack, otherwise your linear regulator will be always on and waste a tiny amount of power (maybe less than 1mA).

author: sentry7
author_rank: Regular Contributor
timestamp: October 04, 2015, 06:42:01 pm
content: Considering the suggestions, here's is the final circuit; is it sound?@mariush,I didn't go with the MOSFET this time; for this project, the power loss due to the diode isn't critical. Thanks for that design tip though!

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: October 04, 2015, 07:13:01 pm
content: Why is the barrel positive? And put a reversed diode across the in and out of the regulator.

author: eneuro
author_rank: Super Contributor
timestamp: October 04, 2015, 07:46:38 pm
content: Quote from: mariush on October 04, 2015, 05:39:33 pmWhat if reverse voltage will be outside mosfet gate VGS limits? This simply addon doen't look as good protection no more and 1000V 1N4007 looks much better than +/-20VGS onlyMaybe putting 12V zenners througth a 1k resistor could be fine to protect p-mosfet gate?I didn't tested it practice, but probably I will, since overall concept is fine but it might be issue at some transients etc since low power mosfets will have very small total gate current, so they are more sensitive to ESD, etc...

author: dom0
author_rank: Super Contributor
timestamp: October 04, 2015, 08:12:25 pm
content: Quote from: DanielS on October 04, 2015, 05:33:28 pmNot necessary at 5 Volts. Except if your input can become more negative than a Volt or so (in non-automotive applications: how?), then you need it.

author: tggzzz
author_rank: Super Contributor
timestamp: October 04, 2015, 09:26:25 pm
content: You have to define what you are protecting against - i.e. threat analysis. And then you must alway remember that you can't make something foolproof because fools are so damn ingenious.I learned that early on when i built a simple solenoid pulser test box that was protected againse reverse voltage, short circuits and open circuits. "Bigfoot", for that was what all his colleagues in the production department called him, set the PCB on fire. Turned out there was a problem with a solenoid and, rather than draw the obvious conclusion, he decided there was a PSU problem. Since the solution to all PSU problems is a large capacitor, that's what he connected across the output.

author: singapol
author_rank: Frequent Contributor
timestamp: October 04, 2015, 09:28:34 pm
content: Quote from: sentry7 on October 04, 2015, 05:01:29 pmThe usual reverse voltage protection is a diode across input and output ( pin 1, 3 ). Download the 7805 datasheet and note the polarity of this diode.See pg. 11 ,12.http://www.ti.com/lit/ds/symlink/ua7815.pdf

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 12:28:04 am
content: OK guys,Here is the final (I think) revision. Just so that you all know, there will be 9V applied to the jack.

author: MarkF
author_rank: Super Contributor
timestamp: October 06, 2015, 01:01:06 am
content: I think you want this. Diode D10 where you have it doesn't make sense.

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 02:52:58 am
content: Quote from: MarkF on October 06, 2015, 01:01:06 amThanks. I'm not familiar with this technique; in fact, maybe someone can clear some things up for me. Let's assume there is no protection or shunt diodes in the circuit, just the voltage source and regulator with capacitors on the in and out. If I understand correctly, the capacitors clean up the voltage so that there is no (or little) sudden spikes. However, if the source drops quickly and there is still voltage on the output cap, the discharged current will go through the out of the regulator and through to com (damaging the regulator). To stop this from happening we put a shunt resistor across the in and out of the regulator to divert the current around the regulator to ground.If we want to keep the current from reverse biasing the regulator, why can't we just put a forward diode at the output so that the voltage remains on the capacitor?

author: tautech
author_rank: Super Contributor
timestamp: October 06, 2015, 03:15:28 am
content: Quote from: sentry7 on October 06, 2015, 02:52:58 amYou can, but the output voltage beyond the diode will be one diode drop down ~0.6V.Protection diodes specifically as detailed in datasheets is for protection against remote bulk capacitance discharging through the regulator after power down.

author: rs20
author_rank: Super Contributor
timestamp: October 06, 2015, 03:20:55 am
content: Quote from: Alex Eisenhut on October 04, 2015, 07:13:01 pmThis. Barrel = ground is the standard; you shouldn't go against this standard unless you have a specific reason.

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 03:35:51 am
content: Quote from: rs20 on October 06, 2015, 03:20:55 amI thought the two prongs above the "J" was the barrel, and the long rectangle was the center?Quote from: tautech on October 06, 2015, 03:15:28 amOf course. Now it makes sense. Can someone explain the change that MarkF made?

author: rdl
author_rank: Super Contributor
timestamp: October 06, 2015, 06:34:41 am
content: The idea is that when the regulator is turned off, the charge on C22 and any capacitance present on the output is diverted around the regulator through D10 instead of into the regulator's output which could damage it. Seems like either way of connecting the diode does that. I guess if the charge was large enough it could cause damage when passed back to the regulator's input, and connecting D10 ahead of D9 would avoid that.

author: DanielS
author_rank: Frequent Contributor
timestamp: October 06, 2015, 03:17:46 pm
content: Quote from: MarkF on October 06, 2015, 01:01:06 amWhy does it not make sense? Directly across the regulator is the usual way of protecting linear regulators against input shorts or reverse bias.If you connect the protection diode from the output to the input jack terminal, the input jack becomes live if there is voltage present on the output, which would be potentially unsafe. Connecting the diode after the input polarity protection diode prevents that.

author: rdl
author_rank: Super Contributor
timestamp: October 06, 2015, 05:17:23 pm
content: Anything is possible, but the odds of a voltage appearing on the output that is higher than the input seems pretty small.

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 05:48:44 pm
content: Wow. I have learned a lot from your responses guys. I have been doing regulator circuits all wrong for a long time.May as well have all my questions answered now.1. As far as I can tell, D9 does not protect the regulator (or the load) if the 9V battery is put in backwards. Even though there won't be any current through D9, there will still be a negative voltage at the input of the regulator.2. What happens with the regulator when the battery starts to lose voltage and it falls below 5V?

author: Siwastaja
author_rank: Super Contributor
timestamp: October 06, 2015, 06:24:32 pm
content: Quote from: rdl on October 06, 2015, 05:17:23 pmThis is completely normal, happens in many situations all the time, and (after burning a few, and they burn as shorts!) my design principle with 78xx regulators (and LM317) nowadays is that I always put the diode there (directly from output to input, as recommended in datasheet - why couldn't they just integrate this protection!),unlessI conduct proper analysis that it is not needed in that particular case.Most typical cases are:- Large enough output capacitance. Every power-off stresses the device over the limits, and it may fail randomly, sometimes after months of use and several power-offs.- Input bulk capacitance smaller than output capacitance.- Input short circuit, which discharges the input bulk capacitance quickly, or even just other unregulated loads on input side!TLDR; Always connect a diodedirectlyfrom 78xx output pin to its input pin, unless you know you don't need to.

author: Gyro
author_rank: Super Contributor
timestamp: October 06, 2015, 06:39:59 pm
content: QuoteQuoteSurely if you connect the return path of D10 ahead of D9 then you're guaranteeing that if anyone connects a wrong polarity input to the jack it will immediately pull the output of the regulator negative - exactly what the polarity protection diode D9 is there to prevent!It also increases the likelihood of the output getting discharged via D10... any time the input jack gets accidentally shorted. If it is connected after D9 then it in extremely unlikely that it would ever happen in the first place (it would need a specific short on the board at the input to the regulator).

author: mariush
author_rank: Super Contributor
timestamp: October 06, 2015, 07:15:20 pm
content: QuoteThe linear regulator needs an input voltage up to 2v above the output voltage to output a stable 5v. The exact amount depends on the output current and temperature of the chip itself. The 7805 datasheets don't usually have detailed information about this as it's just a plain boring old common component with lousy specifications for today's chips, but other linear regulator chips will have graphs with the dropout voltage depending on the current output and possibly even temperature.With the currents a 9v battery can produce, let's say up to 100mA, most 7805 regulators will have an internal dropout voltage of about 1.5v, maybe a bit less. That means when the battery's voltage drops below about 6.5v (but don't forget the voltage drop on the reverse voltage protection diode as well, which would be about 0.5-0.8v for a regular 1n400x diode), the 7805 will no longer be able to output stable 5v. It will output less than 5v and will continue to basically output input voltage - dropout voltage up to a threshold, let's say maybe 2-3v at the output.For a slightly better linear regulator with decent amount of output current (800mA) and still very cheap, see LM1117 or a 1117 made by other manufacturer, here's anexample searchat Digikey.It's a linear regulator similar to 7805 but has a dropout voltage of less than 1.2v at low currents and temperatures as you can see on the datasheet (see page 7. figure:http://www.ti.com/lit/ds/symlink/lm1117-n.pdf.. It also doesn't need protection diode unless you go crazy with capacitance on output (like 1000uF or more) and the only thing you have to be careful about is that the pins on the regulator may be in another order compared to 7805 and that it needs 10uF or more capacitance on the output with some esr (no ceramic capacitor on output).If you're sure your product won't use a lot of current, you can go even further and pick a linear regulator optimized for low current and low dropout voltage, like LP2950 for example which has a maximum output current of 100mA:http://www.digikey.com/product-detail/en/LP2950-50LPRE3/296-20933-1-ND/1216905As you can see on the first page in the datasheet (http://www.ti.com/lit/ds/symlink/lp2951.pdf) at about 60-80C (the regulator will heat up inevitably from regulating voltage because it's a small chip) and up to 100mA, the regulator will have a dropout voltage of up to 0.45v , which means excluding the reverse voltage protection diode, your device will get 5v even when your battery goes as low as 5.5v

author: DanielS
author_rank: Frequent Contributor
timestamp: October 06, 2015, 07:29:40 pm
content: Quote from: rdl on October 06, 2015, 05:17:23 pmHave you ever worked in a lab before? Accidents, such as input shorts or hooking things up backwards (either polarity or input-output) happen more frequently than most people would care to admit. I bet most people here with more than a few years of training/experience have fried over $100 worth of parts and equipment from such mistakes and accidents.Accidentally reversing polarity on a linear regulator is a very easy mistake to do - it can be as simple as forgetting to put your multimeter back into voltage mode after measuring current before probing the regulator's input voltage. Bam! Dead LM317 if it did not have the reverse bypass diode. I fried quite a few in this or similar ways in my earlier days.

author: Gyro
author_rank: Super Contributor
timestamp: October 06, 2015, 07:30:09 pm
content: You could also look at automotive spec regulators - for instance the LM2940 which is fully specified for reverse battery protection to -15V and spikes of +/- 75V. Dropout voltage is typically 0.5V @ 1A. Quiescent current is higher at typ. 10mA though, maybe there are alternative parts that are lower.

author: rs20
author_rank: Super Contributor
timestamp: October 06, 2015, 11:12:33 pm
content: Quote from: sentry7 on October 06, 2015, 03:35:51 amOn further research, you may be right. I can't tell anymore, that's a horrendous symbol if that's the case -- the rectangle looks so much like a sleeve/shield that slips around the barrel there. I'd never look at that symbol and think the rectangle represents a centre pin; it's rotated 90 degrees from the right place for it to be a centre pin! I much prefer this symbol:Just to make up for being wrong, I'll point out that pin 2 above (and the corresponding pin in your schematic) is not a barrel pin per se, but a is-there-a-plug-plugged-in-detection-switch. Handy for switching between battery and DC power, for instance. When the plug is plugged in, pin 2 is floating, and pin 1 is connected to the barrel. When the plug is removed, pins 1 and 2 are shorted together.Let's not get hung up on the schematic though, just make sure your real-life implementation is barrel-ground, centre-positive

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 11:21:23 pm
content: Quote from: rs20 on October 06, 2015, 11:12:33 pmI was actually about to post my fix while you were writing! I made a custom symbol, and it looks like the one you found. The elongated rectangle in that other symbolisthe sleeve. There is an inconsistency in the symbol and the part in my PCB program, hence the confusion. As far as the circuit is concerned, I think this is it...If there is anything majorly wrong with this scheme, let me know!

author: sentry7
author_rank: Regular Contributor
timestamp: October 06, 2015, 11:39:39 pm
content: By the way guys, thanks a billion, for the guidance here. If I had sent for my first boards with a layout like the original, I would surely have had some problems!