There are different ways to accomplish current sensing on a voltage rail. Learn more about these methods.
As an editor, I see a variety of design submissions, from good, to not so good. A recent article I turned down for several reasons included a high-side current sense circuit with implementation problems. This got me thinking about the different ways to accomplish current sensing on a voltage rail. At their heart, the majority of DC current sense circuits start with a resistance in a supply line (though magnetic field sensing is a good alternative, especially in higher-current scenarios). One simply measures the voltage drop across the resistor and scales it as desired to read current (E = I × R (if I didn't include this, someone would complain)). If the sense resistor is in the ground leg, then the solution is a simple op-amp circuit. Everything stays referenced to ground, and you only have to be careful about small voltage drops in the ground layout. But often, placing the sense resistor in a supply lead is the preferred approach. Why? Ground might not be available (e.g., a chassis-grounded automotive device), or you may not want device ground to be different than supply ground, which can lead to ground loops and other problems. So, what are the options? The most obvious and explicit method is to throw a differential or instrumentation amplifier (inamp) across the sense resistor, but in practice this is rarely a good way. To accurately sense current, extremely high CMR (common-mode rejection) is usually required, which is both expensive and prone to drift. How so? Let's consider an example design: 0-10A, 12V nominal, 5mΩ sense resistor:
The most obvious high-side current sensing solution, using a differential amp.
Don't even think about using discrete resistors for this, unless they're part of a precision matched network (hence not really discrete of course). For a 1V shift in supply voltage, and 80dB of CMRR in the diff amp (which translates to ~0.01% resistor matching), you'll see the equivalent of a 20mA shift in current (a 1V change with 80dB CMRR results in a 0.1mV shift referred to input; divide that by the 5mV/A scaling of the 5mΩ sense resistor). For a 0-12V power supply, multiply that by 12: 240mA shift over the voltage range. Note that a true three-op-amp inamp has lower sensitivity to resistor matching than a single-op-amp diff amp. Nonetheless, there are generally better ways. The article I mentioned above used a one-op-amp diff amp with discrete resistors. In fact, one resistor was trimmable with a pot, which I initially assumed was for CMRR, but turned out to be a gain adjust! This would work – in some sense of the word – if the supply voltage were rock solid, but is not really a good idea. A second high-side sense method is one I came up with many moons ago, involving a bit of lateral thinking. I turned things on their head, and used V+ as my reference rail instead of ground. This is conceptually like low-side sensing of a negative supply, and it's a good solution if you can get away with it.
Further processing (e.g., comparators) of the output is referenced to V+. R4 is optional, for protection.
The third method I'll tell you about is now commonly seen in IC solutions, where a transistor and op-amp work together to ground-reference the current measurement. I didn't know about this design when I came up with my upside-down op-amp, and that was probably a good thing, as it saved me a transistor.
ST's TSC103 uses a BJT in the loop.
While Linear's LTC6102 uses a MOSFET.
Sources for such parts include ST, Maxim, and Linear Tech, but the circuit is easy to implement yourself too. Could an OTA like the LM13700 be used as a high-side sensor? Hmm. I'll leave that as an exercise for the reader.