ADC overvoltage protection (schottky + transistor) will this work?

Discussion in 'General Electronics Chat' started by eigenvictor, Aug 19, 2016.

  1. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Hello guys, can you take a look at schematics? Does it make sense? Schottky is pretty standard. But I also wanted to implement some sort of a feedback to eliminate the cause of overvoltage. Basically by design it is expected that from time to time the input voltage (from the current sensor) will exceed 3.3V and may rise up to 5V. The schottky is calculated to tolerate a small spike in current (100's of mA) until the Q1 opens and triggers the GPIO input to go high. After that the micro will take an appropriate action (ex. turn off the current sensor or automatically switching to a smaller shunt etc). Thanks.
    protection.png

    PS R3 is just for spice simulation, it is not needed
     
  2. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    Looks to me like it should do what you want it to. You might want to add another 1N5817 connected to the input node, with its anode grounded, to protect against negative spikes (if that's a concern).

    My only question is, why is R4 there? Don't you want the GPIO to go all the way up to 3.3V (or a little above) when Q1 turns on? As you have it now, it looks to me like it won't go much past 2.1 volts or so.
     
  3. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Thank you for your reply. I added a voltage divider since the max voltage at the current sensor output can be up to 5V so I just feed half of it to GPIO. Now that you mention this, it will probably be less than 5V since some of it will be dropped on the emitter resistor -- I didn't have it initially but thought it is a good idea to limit the base-emitter current. My first thought was to add a base resistor but then I thought it would interfere with the path from the current sensor so I moved it to the emitter instead.

    P.S. Hmm, I think a better solution would be to increase the value of the emitter resistor and get rid of R4.
     
    Last edited: Aug 19, 2016
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    I'd leave the emitter resistor as you have it, and replace R4 with a silicon diode (a 1N4148 will do). That should bring the GPIO voltage to right about where you want it.
     
  5. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    OK, good point. But just out of curiosity, to increase voltage drop on R2, it looks like it won't make much difference until some point where I believe the bjt will no longer be in saturation, so a big part of the voltage drop will the be on the transistor itself since it will operate in the active region? But I agree, since conceptually it is a switch, it better be left as is to remain in the saturation mode.
     
  6. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    Actually, I think I'd make R2 even smaller, perhaps 330Ω or so, to make a sharper transition on the GPIO.
     
  7. ElectronicMotor

    Member

    May 1, 2016
    53
    6
    Are u sure u could not have made that question a little bit less 'loaded'

    Now I have to think :cool:
     
  8. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,236
    Can your current sensor drive the current required (70 ma.) to raise the emitter .7 volts above the base?
     
    eigenvictor likes this.
  9. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Wow, excellent point. I didn't even think about that! I just took it for granted that surely 70 mA is not a problem. But after checking some datasheets of the sensors/opamps I had in mind (ina199, AD8538, ZXCT1107), looks like there is no way they can source 70mA especially at 5V. Not event the AD8538 which is an op amp but it is too wimpy too. I think the best they can do is about 10 to 20 mA. Man, every time I try to do something "fun" there is always a catch. Frustrating. Actually the microcontroller I use (ST32F4) has FT (5V tolerant) ports. I will check if it is also applicable to ADC and if so then maybe I keep it simple, no transistor, no schottky, I can just determine "saturation" programmatically based on the ADC reading. Unless there is a catch with that, too. I guess if that works then the keep it simple principle proves useful.
     
  10. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,236
    Maybe just a couple hundred ohms in series with the sensor line and the diode. Then if you see several samples over limit change gain?
    Edit:
    Or run the op amp off of 3.3 volts.
     
  11. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Wait but I can just adjust R1 accordingly, right.
     
  12. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Ultimately I have this crazy idea of measuring over a wide range with good accuracy by changing shunt values on the fly via power mosfets. Of course some of these shunts will then have to tolerate power dissipation way over their limit so I am thinking to do it the "PWM" way by quickly alternating between several sense resistors based on the ADC value. And if overvoltage is sensed, switch to a smaller shunt etc.
    Is this something that could be done? Or is it completely insane?
     
  13. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,236
    Sure, but why do you want to add all that "stuff" if you can just read it as over scale?
     
  14. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Well that was just an afterthought. I kept thinking of the "stuff" for a while and it is hard to let go :) So I just wanted to clarify in general but I am all for simplicity (helps me in software but this hardware stuff is way more complicated to me).
     
  15. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,236
    Yes, I do that all the time. :D
    You probably just need to make sure the power for a few microseconds. Without knowing the current it's hard to say. One thing to think about if the FETs are low enough resistance compared to the shunts you can add them in parallel so the power goes up with each step.
     
  16. eigenvictor

    Thread Starter New Member

    Jul 16, 2014
    25
    0
    Hmm if I go with an INA199, it has a fixed gain of x100. And I want to be able to measure up to 50A. So the lowest resistor value I have to use is 1mOhm. So the mosfet's Rdson will be an issue.

    Now, the lowest value I want to measure... I am not sure, but it is going to be interesting. Let's say it is 1mA. So to be able to get a meaningful voltage from the sensor, the shunt needs to be as high 10 ohm. Now imagine a worse case scenario, software routing 50A through it! So are we talking what, 25kW of dissipated power hahahaha. No, I don't have a 500V source. I use Lipo batteries (3s max) so the true worst case scenario works out to be 20W into the 10ohm resistor... But that's per second. So just need to set the duty cycle to 0.1% and that will bring the worst case dissipation down to milliwatts. Now the polling frequency... The duty should probably be at least 10-20us so ADC has enough time to do its thing... I guess the timer frequency should then be around 10 to 20 ms... OK, it is getting late and I hope I get these numbers right, this is scary :)
     
  17. ci139

    Member

    Jul 11, 2016
    341
    38
    you either do it precise - in which case you want manually set ranges - use detection for the auto over-current-off only

    or do it for bulk statistics

    ?? does the ina199 survive proximity to wires that have 0 to 50A contact strobe

    e.g. you sound the power line current range,
    then with mechanical relays switch to "shunt station"
    if the strobe is done you disconnect the master conductor (*MC) relay contacts
    . . .
    if theres a quick rise in current you emmediately switch back to MC* -
    simultaneously - with a set of mosfets and mech. relay mosfets off if relay steady ...

    clear out the circuit's "current profile" - (create) handle (for) every specific transition separately
    then see if they can be combined ...
     
  18. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    Oh, my. Up until now I was assuming you were having to deal with some sort of (unspecified) sensor that was capable of whoomping out huge amounts of current with no way to "tame" it, hence the need for that protection circuit you posted. Now, I can see that's not the case.

    My suggestion would be to abandon the protection circuit you posted, and take ronv's suggestion: if you use an opamp as a current sense amplifier, just run it off 3.3 volts, eliminating the need for any sort of microcontroller input protection entirely. Or, if you use the ZXCT1107, just limit its output voltage with a 1N5817 clamp diode connected to your 3.3V supply.

    Linear Technology makes a series of op amps designed for high-side current sensing applications, where the input common-mode range extends up to +44V even when the op amp is powered from supplies as low as 3V. The LT1490A is one of those, you might give it a look. You might also take a look at their application note AN105 - Current Sense Circuit Collection for some more ideas.
     
Loading...