When you're measuring current, there are several approaches to turning the current into a format that can be processed by analog or digital means.
Depending on the current you are measuring, its common mode voltage, and its polarity (including AC current), there are several possible approaches to turning the current into a format that can be processed by analog or digital means.
Nominally, the simplest approach is to convert the current into a voltage using a resistor. As I hope we all know, the voltage developed across a resistor is the instantaneous current flowing multiplied by the resistance value. Obviously, for ease of measurement, we want as high a voltage value as possible, so a high resistance would be desirable.
The downside is that, with increased voltage, there is an increased voltage drop and especially an increase in power dissipation. The more power is dissipated, the higher the resultant temperature of the resistor will be. As a result, the resistance increases and affects the measurement.
Let's first consider the resistor. Normally, we will use a low value for the resistance, and we use a specific term for that -- a shunt. There are many shunts, and some come with Kelvin contacts (a.k.a. 4 terminal). Because the value of the shunt is normally in milliohms, the contact resistance of the shunt due to soldering and construction can be the same order of magnitude as the shunt itself. As a result, the reading can have a significant error. The Kelvin contacts provide a second pair of contacts across the measured resistance, and with no current flowing in these signal lines, an accurate measurement is possible.
If you have a provision to calibrate your product, then you can create your own Kelvin arrangement by running separate tracks up to the sense circuitry from where the shunt is soldered to the board. Depending on the power dissipated, you may need a shunt that can mount on a heat sink. Search for shunts at your favorite supplier -- there are many.
The shunt is obviously placed in the current path, and its electrical location can cause problems. If placed in the return path, it can lead to instability of the circuit (the ground is high-impedance). Also, the ground of the circuit is no longer the ground of the supply. Thus, it is more common to place the shunt in the supply line. However, this can lead to a problem if the shunt's common mode voltage is outside the supply of the sensing circuit. (I will get to this in a moment.) Some circuits will not tolerate this, and you need to be aware of the potential (pun unintended) problem.
To measure the voltage across the resistor, you will need some differential technique, be it a difference amplifier, an instrumentation amplifier, or even an analog-to-digital converter (ADC) with differential inputs. But, of course, it must tolerate the common mode voltage. There are some different amplifiers with very high common mode capabilities. The TI INA149 springs to mind. This can handle a common mode range of +/-275V.
There is another fly in the ointment. Often the method used to handle the above-supply inputs is to use a resistive divider, but this involves a current draw from both sides of the resistor. This can lead to inaccuracies if the draw is in the same order of magnitude as the current being monitored.
Probably as a result of battery charging in portable instruments, an enormous number of current sense ICs can monitor the current across a shunt and transform it into a more useful value. I think anybody who makes any analog ICs will be able to produce several devices that address this segment of the market. The following list covers a few manufacturers and provides links to general reference points to aid you in your initial search. Note that Microchip doesn't actually manufacture current sense amplifiers, but the application note referenced here addresses this topic.
Some of the devices will actually allow for bidirectional current so that you can monitor the change and discharge of a battery or even an AC waveform. I discussed that issue this summer in a post on a sister site, Planet Analog.
There is yet another potential problem. The common mode voltage could be hundreds or even thousands of volts. In this case, some kind of isolation is needed for safety and to eliminate ground loop problems and, of course, semiconductor breakdown. Avago has an optically coupled current sense amplifier called the HCPL-7520 that addresses this issue.
Opto-isolation is not the only method of isolation. In part 2 of this miniseries, we will consider other possible techniques.