"Classic" high side current sense amp circuit - Page 1
Forum section: electronics / beginners

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 03:59:08 am
content: I learned today that you don't have to use a dedicated part to do high side current sensing: you can do this with plain old op amps. This was news to me, so I thought I'd write a post to introduce the other newbies to this idea.Disclaimer: This information isn't useful for making "real" products: dedicated parts which do this can be had for under $1. This approach is of interest for educational purposes, and would be appropriate in an educational kit power supply current limiting circuit.I was browsingdigikeyand came across theCS30. In the datasheet, they show this functional representation of how the part works:Later, I came across a greatapp notefrom Linear about high side current sensing, and they showed the same circuit:I decided to throw this into LTSpice and play around with it, and sure enough it works!However, as-is, that circuit has a few limitations. You'd have to use a rail-to-rail op amp there, because the sense voltage would be right up at VCC, and also the VCC of your circuit would be limited to what the op amp can handle. Also, you'll need a buffer on the output.If we add in a few extra voltage dividers and op amps, we have a usable circuit:This can be implemented with a quad op amp, 9 resistors, and a 2N3904.I've attached the LTSpice files so you can have a play with it.Use R3, R5, and R9, R10 to scale down the sensed voltage to ensure it is within the common mode range of your op amps. Here, I've just divided it by 2, but if your op amp supply rail is e.g. 5V, you'll want to tweak those resistors to divide it further.From what I can tell, the ratio of R2 to R8 sets the overall gain of the sensed voltage (which now has to be combined with the voltage divider's gain to calculate the overall gain). R4 should match R2.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 04:04:11 am
content: I'm curious about what would be the advantages / disadvantages of using this approach vs making your own instrumentation amp to subtract the current sense offset voltage. That's a similar number of op amps and resistors.http://www.circuitstoday.com/instrumentation-amplifier

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 04:21:39 am
content: Hmm, this circuit appears to be misbehaving when the load is a short.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 04:29:35 am
content: Ah, U1 is trying to make both inputs equal. As soon as the inverting input drops below 1 diode drop, it can no longer do this. This is because if there is any current flowing out of the op amp, the lowest the voltage can ever be at the top of Q1's collector is one diode drop. Below that, the circuit goes haywire.

author: TerminalJack505
author_rank: Super Contributor
timestamp: May 11, 2015, 05:00:03 am
content: Thanks for sharing the information.Rob77 showed a similar circuit inthis post.It seems to work pretty well. I'm using it in one of the circuits that I'm playing around with in the simulator.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 05:35:02 am
content: TerminalJack505, Thanks for the link! Interesting circuit. That's the first time I've ever seen the negative power rail of an op amp "hang" off of another rail via a zener. Interesting idea

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 11, 2015, 05:59:22 am
content: Primary drawbacks are CMRR (ever try sensing a flying shunt on a switching inductor?) and unidirectional operation. Bias current, and errors thereof, are another drawback (transistor bias current, and base current error).The AD8210 solves bidirectional operation in a reasonable manner. The internal equivalent schematic is basically the mirror double of the above circuit. It's not entirely apparent what its "fully differential" op-amp is doing (what's Vcm set or controlled to?), but in any case, one could very easily be made in a similar way with a little study. The CMRR is quite a bit better than most, probably due to that symmetry.Tim

author: ludzinc
author_rank: Unknown
timestamp: May 11, 2015, 06:17:50 am
content: Similarly, there's this:http://www.daycounter.com/Circuits/High-Side-Current-Monitor/High-Side-Current-Monitor.phtml

author: Howardlong
author_rank: Super Contributor
timestamp: May 11, 2015, 06:54:23 am
content: Practically speaking, using a pair of resistor voltage dividers to try to take the current sense voltage below the rails doesn't work becuase of the resistor tolerances.The typically small voltage drop across the sense resistor will be swamped by any divider resistor tolerance differences, so getting an accurate absolute value isn't possible in the real world.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 02:24:18 pm
content: Howardlong, I'm not sure I understand. Wouldn't the voltage divider resistors cause an error which scales with the signal? If the resistors are out by 1%, it doesn't matter how small the signal is, because the error will scale with the signal.But the input offset voltage of the op amps would create the kind of problem you are referring to, where as you make the signal smaller and smaller, eventually it gets swamped by Vos.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 04:27:22 pm
content: Quote from: ludzinc on May 11, 2015, 06:17:50 amThanks!

author: mikerj
author_rank: Super Contributor
timestamp: May 11, 2015, 05:16:48 pm
content: Quote from: cellularmitosis on May 11, 2015, 02:24:18 pmHaving mismatched resistors ruins the CMRR, so if the voltage supply was unregulated the output would vary as the voltage changed.

author: Howardlong
author_rank: Super Contributor
timestamp: May 11, 2015, 07:13:06 pm
content: Quote from: cellularmitosis on May 11, 2015, 02:24:18 pmNo, it's that the relatively small voltage drop across the sense resistor is likely to be of similar magnitude to the errors incurred by 1% resistors in the voltage divider.See the attached spreadsheet I made up for you.In the first case, we have perfectly matched resistors:All good. The difference in the + inputs to U2 and U3 are what we'd expect.Now say R3 is 1% high in resistance:As you can see, you now have a significant negative offset, not only that, but can the next stage even deal with a negative offset?Here is the worst case in that direction:... and the worst case in the other direction:So the main problem is that the resistor tolerances inevitably introduce offsets. You can reduce the impact to some degree by increasing the R1 sense resistor, but then you'll be wasting more power in your sense resistor. Either that or go for 0.1% or better resistors, with a shock to the BOM cost. Or trimpots, which adds to your production line costs.That is why I don't recommend using voltage dividers on current shunt resistors.Edit: How do I know this? Been there, done that, have appropriate scars. It is boldly recommended in a Microchip datasheet of all places (MCP19111) to allow the device to provide outputs over 3.6V, due to a pin voltage limit (http://ww1.microchip.com/downloads/en/DeviceDoc/20002331B.pdf). I raised a ticket on how this could ever work but got nowhere. I did indeed wire it up, and it behaved as I expected, i.e. there was a significant offset on the current sense. I don't think they ever tried it.

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2015, 08:18:47 pm
content: Quote from: Howardlong on May 11, 2015, 07:13:06 pmDon't they only mean you need a divider for the Vsen feedback? I don't see any mention of common mode limits for the current sense amplifier.

author: cellularmitosis
author_rank: Unknown
timestamp: May 11, 2015, 09:59:03 pm
content: Howard, thanks a lot for taking the time to illustrate your point. That really helped me understand the problem.After work I'll reproduce your spreadsheet as a Google doc to reinforce the lesson and so future readers of this thread can play with it.

author: Howardlong
author_rank: Super Contributor
timestamp: May 11, 2015, 11:50:57 pm
content: Quote from: Marco on May 11, 2015, 08:18:47 pmSection 4.1, max voltage on any pin except those named is VDD+0.3V, and VDD is internally regulated to 5V. I needed 7.4V.

author: Unknown
author_rank: Unknown
timestamp: January 05, 2018, 12:53:58 am
content: Sorry to resurrect an old post, but it was recently referenced in the posthttps://www.eevblog.com/forum/projects/sensing-voltage-current-glitches-on-5v-rail-schematic-enhancements/.I just wanted to comment that this post demonstrates why images should be stored locally on the eevblog forum. All of Howardlong's (hi nezbrun!) images have vanished (remotely stored in photobucket, which has changed it's hosting terms). Now, imagine if OP cellularmitosis' images were likewise unavailable -- it would make this valuable post useless.Perhaps David should write a script to replace all remote images with a local copy. I know this involves more storage space, i.e. $$, but in 10 years the eevblog archives will be severly limited.This is probably the wrong place to post this, but it's such a good example of the drawbacks of remote image storage.-Steve

author: mikerj
author_rank: Super Contributor
timestamp: January 05, 2018, 03:17:27 pm
content: There are various browser plugins to resurrect dead photobucket links (I see all of Howard's pictures through Firefox), but I suspect PB will be trying to stop these working.