Protect selfmade PSU sense input from reverse voltage, etc. - Page 1
Forum section: electronics / projects

author: nemail2
author_rank: Regular Contributor
timestamp: June 11, 2019, 12:50:31 am
content: Hi there again!Some may have noticed my work on my self made Lab PSU:https://github.com/mamama1/LabPSU_Darlington(online a bit outdated version)I was wondering how I'd protect the differential input of my ADC which I implemented for sense wire terminals on my lab PSU. I imagine, some motor back EMF or reverse voltage might fry the opamp and/or the ADC, in the worst case.attached you'll find screenshots of the relevant part of the board + schematic.How is this normally done? just a diode in reverse + something like diode clamping?please keep in mind that this is a fairly precise PSU with millivolts and milliamps so introducing measurement errors in the 1mA or 1mV range or even higher by the protection circuitry isn't really an option...thanks!edit: i have updated the github version so now all the latest source files are online, including complete pdf schematic and board preview png.edit2: just to get an idea of how it actually looks like, i have attached two photos of the currently built up (previous revision) of this PSU where I have bodged in a ADS1115 ADC on a breadboard. it actually works already quite well but I'm kinda optimizing and redesigning the crap out of it. partially to get better precision and partially just for kicks.

author: floobydust
author_rank: Super Contributor
timestamp: June 11, 2019, 01:26:08 am
content: R14 limits currents into the OPA2197 op-amp which has input protection, so I don't see a protection issue with voltage sense.You should try the other common trouble scenario, where power is off or setpoint low V but a battery is connected to the output. Example 12V battery and power outage, or you're on but set at 2V, or power is off.Backfeed through D3/D2/D1, and into IC2A, sometimes this damages the driver op-amp. Where does PROT connector go?

author: nemail2
author_rank: Regular Contributor
timestamp: June 15, 2019, 11:29:27 pm
content: Quote from: floobydust on June 11, 2019, 01:26:08 amHithanks for you reply and sorry for the late response, I was on vacation + a bit sick as well, unfortunately.Regarding the topic: What about reverse polarity into the opamp/respectively into the ADC? the ADC will see positive voltage where GND should be and the opamp would see GND where a positive voltage should be...I have updated the design, the negative sense terminal isn't connected to AGND anymore but it is directly connected to one of the differential input pins of the ADC (which was connected to AGND previously as well).regarding the other scenarios: power off is no issue because the output relais would be open without voltage.a low setpoint but connected battery with higher voltage would be an issue, though. How'd I protect that PSU from this scenario? Where to start?I_PROT is a jumper which allows me to basically disable CC mode completely. When I disconnect that jumper, IC2B never gets to kick in to limit the current. Just for debugging and measuring, that jumper is normally ALWAYS closed.

author: cur8xgo
author_rank: Regular Contributor
timestamp: June 15, 2019, 11:55:52 pm
content: it don't matter what happens on isense (polarity reversed or not) because it aint going to be hurting anything through 90000 ohms especially not the opamp input protection diodes

author: nemail2
author_rank: Regular Contributor
timestamp: June 16, 2019, 10:20:58 pm
content: i have slightly changed the circuit. what if one applies like 12V directly to the ADC input pin (SENSE_GND header) and GND to the 90.9k Opamp input (SENSE header)?That would be @ reverse polarity of the sense terminals.Would the 90.9k resistor still protect the ADC input (pin 5, A0-)? The ADC can only tolerate up to it's VCC at it's input pins...

author: mikerj
author_rank: Super Contributor
timestamp: June 18, 2019, 07:15:29 pm
content: Buffer your ADC inputs. If this has to driver sensitive loads then chances are you won't be happy about the charge injection from the ADC MUX anyway.

author: OM222O
author_rank: Frequent Contributor
timestamp: June 18, 2019, 09:50:41 pm
content: What you are missing is some resistors directly on the ADC inputs. Also if the reverse voltage is less than VCC (On differential mode) it won't matter to the ADC based on the data sheetThey specify that no node should be less than GND - 0.3V which can only happen on single ended readings. Again, on differential mode you can go upto +- (VDD + 0.3) without any protection and with current limiting resistors on the inputs, the internal diodes will do their jon to keep the voltage on the safe levels even if you go over that.

author: nemail2
author_rank: Regular Contributor
timestamp: June 19, 2019, 08:53:45 pm
content: Quote from: mikerj on June 18, 2019, 07:15:29 pmQuote from: OM222O on June 18, 2019, 09:50:41 pmat least the positive input is buffered (IC11A) and there is a input resistor as well (R39). should I do that on the negative input as well? but usually that'd be only ground, except if someone reverses polarity and feeds like 15 Volt into it and GND into the positive terminal...sorry if it takes long until i understand stuff but I'm a) quite a noob/hobbyist and b) english isn't my native language and therefore I sometimes have a hard time understanding the correct meaning of things, especially if typos or shortcuts are involved..

author: nemail2
author_rank: Regular Contributor
timestamp: July 06, 2019, 12:33:33 pm
content: Ok I did receive the PCB and built stuff up and I was stunned. Voltage setting and measurement was precise down to ONE mV, without calibrating anything.However later I blew the ass out of the ADC, T10, R39 for sure, and very likely the opamp IC11 as well.That appears to have happened with a big ass "Delta" fan with 12k rpm and about 3 Amps current rating. I have another, older revision built up here, where the Sense ADC channel is cactus as well, since that monster fan was connected.So I guess some sort of additional protection would be good.What about diode clamping on the ADC inputs (with stronger diodes than the integrated ones) and also diodes directly before (or after?) the voltage divider? Where would I put them?Also I guess a bigger value resistor for R39 would be good. How can I calculate the best value and will it affect the RC fiilter in a bad way?Thank you all who are helping, the project is and will always be open source and the precision already looks very promising!

author: Kleinstein
author_rank: Super Contributor
timestamp: July 06, 2019, 03:06:24 pm
content: R39 can be quite a bit larger, as the ADC is rather high impedance and the signal is not fast anyway. So some 2.2 K or so should be OK. One could add additional clamping at the base of T10 (e.g. a 3.6-5.1 V zener to ground).Additional diodes directly at the ADC input may not help very much, as the chip internal "diodes" (usually actually parasitic path to the substrate) often have a relatively low forward voltage.It could make sense to have a diode directly at the input of the OP to avoid a large negative voltage, just in case.Depending on the supply current to the ADC, one could consider using a 50 Ohms or similar resistor instead of the ferrite bead - this would limit the current in case of a latch-up and reduce possible damage.

author: nemail2
author_rank: Regular Contributor
timestamp: July 06, 2019, 09:15:55 pm
content: Quote from: Kleinstein on July 06, 2019, 03:06:24 pmThanks!I was thinking about increasing R39 as well. Supply current of the ADC when operating is max. 300µA, according to the datasheet.Regarding the diodes at the ADC input the datasheet says this:QuoteSo I thought, additional diodes would be a good idea. But then those diodes would not protect the opamp inputs and voltage could go there and make damage...I have a reverse diode on the output of the PSU but that diode gets disconnected if the relais is turned off. So in this case the sense input of the ADC is connected with the load (which might be a fan or a coil) without any reverse biased diode. I guess that is one huge mistake I made. Actually, the relais should disconnect the sense wires from the sense input as well or there should at least be some protection of the sense input like a reverse diode..So what I'll try (currently building up the sense stage on a breadboard):- increase R39- zener at T10 base (actually: what would that do? according to my understanding the npn is current driven so if it conducts or not - and how much - can't be nailed down to a specific voltage if I'm correct?)- maybe still try some diodes at the ADC inputs, as the datasheet suggests that? or would that be pointless in this context?- replace L6 with a resistor (or put a resistor in series?)

author: nemail2
author_rank: Regular Contributor
timestamp: July 07, 2019, 08:24:47 pm
content: what about clamping Pin 3 of IC11A to 3.3V? Output voltage of the PSU is 16.384V max. so after the 10:1 voltage divider there never should be more than 1,6384V.3.3V + Vf of the clamping diodes is something which the ADC inputs should withstand, especially with the raised value R39.What do you think about that approach?What about SENSE_GND pin, which is directly connected to the ADC input pin 5? If some motor induces voltage into that pin, the ADC would go the way of the dodo, wouldn't it?Thanks, as always I'm very grateful for any advice.

author: Kleinstein
author_rank: Super Contributor
timestamp: July 07, 2019, 08:40:57 pm
content: Clamping before the OP is a little tricky, as small leakage currents matter. It is much easier to do clamping at the output of the OP, before the transistor. The BJT acts as a kind of voltage follower, not as a switch. So the output at the emitter is never higher than the base, normally some 0.5 V lower. So clamping at the base works as well. At least for a short time the OP is short circuit proof, so that a simple zener to ground is OK here - one could add a series resistor if one wants to avoid a very high supply current for the OP. With a maximum of some 1.7 V under normal operation the limit could be at 2.7 V already - the OP will compensate for initial leakage.The OP is already reasonable protected from the 90 K resistor. It is not a perfect protection, but not that bad either. Normally one would use larger resistors here, more like 500 K and possibly a few resistors in series as the voltage per resistor is limited.The GND side could indeed be a problem too. It depends on the layout. A similar resistor like R39 and cap could be a good idea at least. If not directly connected some clamping could be needed.

author: floobydust
author_rank: Super Contributor
timestamp: July 07, 2019, 09:00:38 pm
content: I'm not sure why there is an emitter-follower after the op-amp, I don't see it necessary especially if R39 is increased in value as it needs to be.I don't like running an A/D on 3.3V yet the op-amp ahead is on a 15V rail. You have to be careful which rail comes up first and collapses last, which may be why your fan caused things to blow up.9.1.3 Input Protection"The ADS101x are fabricated in a small-geometry, low-voltage process. The analog inputs feature protection diodes to the supply rails. However, the current-handling ability of these diodes is limited, and the ADS101x can be permanently damaged by analog input voltages that exceed approximately 300 mV beyond the rails for extended periods. One way to protect against overvoltage is to place current-limiting resistors on the input lines. The ADS101x analog inputs can withstand continuous currents as large as 10 mA."The A/D can take 10mA, so R39>1.1k assuming 10mA per channel does not lift up the 3.3V rail.

author: nemail2
author_rank: Regular Contributor
timestamp: July 07, 2019, 09:21:06 pm
content: Quote from: Kleinstein on July 07, 2019, 08:40:57 pmThanks! I'm gonna draw that into the schematic and post it here ASAP (already working on it) with my humble plea whether you could check it if i understood it correctly.So normally the sense input voltage divider would be much higher than 90.9k? I thought that was quite high already.. Again I learned something..Quote from: floobydust on July 07, 2019, 09:00:38 pmYeah, I'm going to increase that R39. Stupid me didn't really do the math on this one...The emitter-follower is to raise the working voltage of the opamp a bit. It struggles to output voltages near 0 mV which is what i need for accurate ADC readings at low voltages.The emitter-follower forces the opamp to output at least the transistors forward drop voltage to get 0mV on the feedback pin.I agree that 15V on the NPN is not ideal, 3.3V should work as well, right? That would mean that even if the opamp outputs 15V at pin 1, the ADC will see 3.3V at max without anything taking damage - or am I misunderstanding that? Will actually the voltage get from the base through to the emitter and be higher than 3.3V?I'm sorry, I'm really not a pro yet at transistors - everything self-taught and still the learning curve is very steep.Thanks!

author: nemail2
author_rank: Regular Contributor
timestamp: July 07, 2019, 09:57:32 pm
content: Ok, how about this? Did I misunderstood ZD2? Not sure if you meant that there should be one, @Kleinstein...I have put red circles on the changed parts of the schematic...Btw. I'm not quite sure about C46 - is that correctly connected? SENSE_GND against SENSE?D5 and D7 could be something like BAV199 or BAV99, right?

author: nemail2
author_rank: Regular Contributor
timestamp: July 08, 2019, 12:33:54 am
content: Or, what about this solution...?- Sense has a flyback diode connected (D5) which should do the business for things like motors and coils discharging themselves while connected to the sense wires but disconnected from the PSU output (because the relais disconnected the output but not the sense wires - btw. should the relais actually disconnect the sense wires as well??)- OPA2197 has integrated clamping diodes according to the datasheet and should be reasonably protected by R14 as Kleinstein pointed out already.- OPA2197 still has 15V supply voltage so voltage on SENSE may be as high as 150V without harming the OPA2197-- IC11 (OPA2197) will in that case output 15V which would be clamped by the zener diode ZD1 and through T10 there would only be 3.3V minus T10 forward drop voltage anyway.- Series resistor R39 will further limit current to the ADC input pin, which in turn has clamping diodes by itself as well, if everything goes wrong.SENSE_GND has a series resistor R27 which limits current + acts as a RC filter with C46 and clamps to 2.7V with ZD3. If SENSE_GND sees negative voltages, ZD3 should clamp as well, depending on its characteristics...Am I missing anything?edit: seems to work quite well in the attached simulation. even added the opamp supply pin series resistor to limit current through the zener.sorry for the crudity, I'm no LTSpice Pro...

author: nemail2
author_rank: Regular Contributor
timestamp: July 09, 2019, 03:18:25 am
content: just a quick update:stupid me just realized that my whole sense input is absolutely pointless, as it is not integrated into the control loop and therefore doesn't do anything besides showing the value which was read by the ADC on the display.I simply didn't know and didn't think about that, that a sense input is supposed to be part of the control loop and as I don't want to extend my control loop outside of the PSU, I ditched the whole idea of a sense input completely.for me that means:- less PITA with protection- more space on the PCB- more space on the display- less components- simpler design (actually I'll go with the quad OPAx197 version, the OPA4197 + 1x OPA197 for onboard voltage measurement now, instead of 3x OPA2197)still, I have learned much about circuit protection so it is still a win for me, from all perspectives.