A number of the projects we are involved with require accurate monitoring of DC currents. Here we explain the numerous techniques for measuring DC current flowing in a line, highlight some of the multitude of integrated circuits available and list the pros and cons of various techniques. This is an on-going work – please post comments with your ideas and techniques.

Background

DC current measurement is required for power measurement, as power = voltage x current. Accurate measurement is obviously beneficial, but higher accuracy comes with a higher cost and there are also some fundamental limits and hardware limitations to how accurate we can measure.

In this page I’m hoping to describe the main requirements for reasonably accurate current measurement and also a number of techniques to do this and a number of components and integrated circuits which are used to perform this function. I am assuming that this data will be read by a micro-controller (a digital device). I may write another piece on voltage measurement.

Measuring the waveform

There are two main aspects to accurately measuring a varying signal, no matter what the signal. These are the sampling frequency and the resolution:

Sampling frequency

The sampling frequency is of great importance if we are to accurately monitor a waveform. For example if we took only one temperature measurement a day, at 7.47am, we could not say anything about the changes through the day. We can say something about changes through the year, though. So it depends on what kind of data trend you are interested in.

The same is true for monitoring current. If we take one sample every day, it might be at the time when nothing is switched on. Hence we could look at this for a year and conclude that no power was drawn. Obviously this is probably not the case. Maybe 10 mins later someone turns on some huge load for 5 hours then switches it off again. So the rate at which we sample is important.

The mathematics of this were done by Harry Nyquist and hence we have the Nyquist rate. This states that, to get all the information from a waveform, we must sample at a frequency at least twice that of the waveform. For example – we want to listen to music, which has audiable frequencies up to 20kHz. To cover this we must sample at a frequency of at least 40kHz. Those who have recorded music into a computer will know that the sample frequency used is generally 44kHz. Any less and you will loose information.

This is important with DC power systems. There are components, such as inverters, which switch on and off very high currents at very high rates (10’s to 100’s kHz). Generally this is internal to the unit and capacitors on the input smooth this frequency, hence we do not need to look quite at that high frequency, but we definitely need to think about it. If we can take lots of samples and then average them then that is best. This is especially true when we are measuring energy into and out of the battery, where any inaccuracy could mean the device does not know what has gone into the battery and hence looses track of the energy balance.

Resolution

This relates to the fact that we are converting an analogue signal into a digital signal. (This is sometimes called quantization). Digital signals can either be on or off. Analogue signals can be anything at all and can vary infinitely within their range. We are trying to get this varying analogue data into our digital device (the micro-controller). In order to do this we use the concept of levels (also called quanta). Say we have a sine wave signal varying from 0 to 5V. Lets say we only have one bit resolution. The digital representation can only be on or off. If we set the level at 2.5V then we will see the digital signal to be 0 then 1 then 0 then 1 as the waveform goes above and below 2.5V. You can see that we have lot a lot of detail from the signal. This might be enough data to do what we want, but generally we use more levels. The more levels, the higher the resolution and hence the better data accuracy.

Adding an extra bit to the resolution increases the resolution by a factor of 2. Hence 1 bit = 2 levels, 2bits – 4 levels, 3 bits = 8 levels. This quickly multiplies up and at 8 bits we have 256 levels or at 10bits we have 1024 levels. A typical micro-controller (such as a PIC 18 series, or the Atmel chip in an Arduino Uno) has 10-bit accuracy. Some have 12, 14 or even 16 bits. If you go to higher numbers of bits this puts more work onto the microprocessor, so you can also use special analogue to digital chips (ADC) which process the data and sends it to the micro-controller.

In this article I will be using the ADC within the micro-controller (I use both PICs and Atmels) – usually a 10 bit ADC.

Ensuring the waveform stays accurate

When measuring current, we are usually measuring very small voltages. These have the potential to be corrupted by other very small parasitic signals. These can be broken down into offsets and noise.

Although converting the signal from analogue to digital will mean a loss of information, it also means we can apply techniques to ensure the signal does not get corrupted by noise. Hence I try to convert to digital as quickly as possible.

Noise

Noise is everywhere. It comes from the physics of electrical devices and from interference of the many different man-made and natural electrical and magnetic waveforms. There is lots of information about noise and reducing noise levels, although it is sometimes a bit of a dark art.

I try to keep noise to a minimum by:

  • Keeping signal paths as short as possible
  • Shielded cable or additional metal shielding can be used around parts of the circuit affected by noise.
  • Reduce the number of components the signal travels through – this will reduce the potential for noise to interfere

This is a complex area, so I will not go into too much detail here. Generally good layout and circuit design will ensure relatively low noise.

Offsets

Offsets are when an additional signal is added to the waveform we are measuring. They generally occur when the signal has passed through some other active component, such as an op-amp. Lets say we are measuring a 0 to 5V analogue signal using a 10 bit ADC. This gives us 2^10 levels = 1024 levels. Each level equals 5V/1024 = 0.00488V, or 4.88mV. Hence any offset greater than 4.88mV will change the signal enough to change the number read by the microprocessor.

The main reason this might be a problem would be if the signal is taken through an operation amplifier and the operational amplifier has some offset, or cannot get all the way to the ground rail. You can check out the offset voltage using the op-amp data sheet. For example, the offset voltage on a standard 741 op-amp is +/- 15mV, which could give an inaccuracy of over 3 levels. (Note: there is the option to null the offset on lots of op-amps, but this needs individual calibration and additional components). I try to use single supply rail to rail op-amps with an offset of less than 3mV.

Methods to measure current

There are two main methods of measuring DC current: invasive and non-invasive.

Invasive

Invasive methods, as the name suggests, means you must place something in the actual current path. We usually use a low value ‘shunt’ resistor. As V=IR, current flowing through a small resistance will mean that a small voltage drop will occur. We can then read this voltage, which will be proportional to the current flowing.

The shunt resistor can either be in the high-side path (the positive wire) or in the low-side path (the negative wire).

We must be very careful with the resistor value selection as a high resistance will mean a high voltage drop, which also means a high power loss.

Typical shunt resistor values are from 0.01 milli-ohms to around 1 ohm (dependent upon the current range). They come in many different forms. The classic design is quite large, as shown here:

They are good as they are usually quite accurate and also do not get too warm, so the resistance is not affected by temperature. But they are expensive (around £10-50 each).

Less expensive options include ‘bare element’ shunt resistors (around £0.80 to £4.00), along with surface mount types.

Here is an article on making a DIY shunt from copper wire.

The voltage can be interfaced directly to a micro-processor, but generally some form of amplification is required to the the shunt voltage to be within the input range of the ADC. An op-amp is usually used to perform this function.

Pros

  • Simple
  • Cheap
  • Easy
  • Can be accurate

Cons

  • Low-side current measurement is easiest, but it can introduce a voltage drop where it is not desirable
  • High-side current measurement is difficult, and requires careful thought or a specific IC
  • Shunt resistor requires careful design
    • eg: measure 100A in a 12V system. With a 1ohm resistor you will get 100V voltage drop (i.e. it would not work) and that resistor would be dissipating 100W (Power = VI) which would be a massive waste.
    • For reasonable power dissipation (of under 5W), the resistor must be (Power = I2XR) 5/(100×100) < 0.5milli-ohms
    • For reasonable voltage drop (of under 5% = 0.6V ), the resistor must be (V=IR) 0.6/100 < 6milli-ohms
    • In this case you must choose the lower value, to ensure both requirements are met.
  • Shunt resistor might exhibit a temperature non-linearity (can use temperature correction)
  • Usually requires an additional op-amp (with offset and noise issues)
  • Sometimes requires a high impedance buffer – the ADC might not have a very high impedance (in a lot of micro processors this is true) and hence measuring the signal will change it. An additional op-amp buffer is required to stop this error.

Non-invasive

Non-invasive techniques generally use a hall-effect sensor. The hall effect is a transducer whose voltage varies in response to a magnetic field. Current traveling through a cable will set up a magnetic field which is proportional to the current flowing. Hall effect sensors generally have a hole through them where a single current-carrying cable is passed through. Sometimes they can open out to clip around large cables. The main companies producing hall effect sensors are LEM and Honeywell. Sensors are in the range of £5 to £80.

Pros

  • Do not need to disrupt the wires or cabling
  • Total electrical isolation (galvanic isolation) of the measuring device
  • Wide range of currents – including very high currents
  • Usually on-board processing of the signal to output a useful range for a microcontroller.

Cons

  • Expensive
  • Linearity sometimes not great (although this can be corrected)
  • Inaccuracy in measurements, especially low currents

Some current shunt ICs and information

(Note: prices are from on-line search June 2011.)

Invasive ICs

INA220 from Texas Instruments: £3.28+vat from Farnell

  • Requires a shunt resistor
  • High or Low-side current measurement
  • Bi-directional
  • 26V max
  • Output as 2-wire interface (serial data)

INA170 from Texas Instruments: £2.79+vat from RS

  • Requires a shunt resistor
  • High-side current measurement
  • Bi-directional
  • 2.7-40V voltage
  • Output current proportional to current flowing (hence needs an output resistor)
  • Requires a reference voltage

INA138/INA168 from Texas Instruments: £3.40+vat from RS

  • Requires a shunt resistor
  • High-side current measurement
  • Uni-directional
  • Voltage range: up to 36V (INA138) 60V (INA168)
  • Output current proportional to current flowing (hence needs an output resistor)
  • Will need an op-amp on output

INA193 from Texas Instruments: £1.76+vat from RS

  • Requires a shunt resistor
  • High-side current measurement
  • Uni-directional
  • Voltage range: up to 80V
  • Internal gain (20V per V)
  • Low accuracy at low currents

LTC6104 from Linear Technologies: £2.76 from RS

  • Bi-directional
  • Very low power consumption
  • Wide supply range (max 70V)
  • Requires shunt resistor
  • Requires additional components
  • Requires a reference voltage to do bi-directional measurement

LT1495 from Linear Technologies: £5.07 from Farnell.

  • A precision op-amp with application note for current monitoring.
  • Requires shunt resistor
  • Requires 2 x additional transistors
  • 36V max input
  • High-side current measurement

LT6100 from Linear Technologies: £2.28 from Farnell

  • Single-direction
  • High-side current sense
  • 48V max
  • Gains are internal to the IC (set using 2 pins on the IC)
  • Shunt resistor is required (but not much else)

INA206 from Burr Brown: £2.68 in 25+ from RS

  • Uni-directional
  • +80V max
  • Low accuracy at low currents

INA230 from Texas Instruments: £3.03 from Farnell

  • High or low side
  • Bi-directional
  • I2C interface
  • High accuracy (0.5%)
  • Max 28V DC
  • Monitors both bus voltage and shunt voltage (current)
  • Tiny QFN package – virtually impossible to hand solder.

AD8211 from Analog Devices: £1.77 from Farnell

  • High side current sense
  • Buffered output voltage (no op-amp requird)
  • Output linearity maintained
  • +65V operational voltage
  • Uni-directional
  • x20 amplification

LTC2945 from Linear Technologies: $5.87 direct from Linear Technologies (not yet available via RS/Farnell)

  • SPI output (serial data output)
  • Voltage range 0-80V DC
  • 12 bit ADC resolution
  • Outputs: Current & Voltage (12 Bits) and Power (24 bits)
  • 102.4mV full scale on the current sense resistor

SFP100 from Sendyne: $??

  • Very wide current range from mA to 100s A
  • Precision 24 bit ADCs
  • Voltage and temperature measurement
  • Output via SPI/digital

Non-Invasive ICs

LTS-25-NP from LEM: £9.19+VAT from RS

  • Hall effect
  • Bi-driectional
  • +/-25A (max 80A)
  • Low thermal drift (<50ppm)
  • Accuracy around +/- 0.7%

ACS756 from Allegro: £4.80+vat from RS

  • Hall effect
  • Design of unit means it is invasive (not a clip-on to the wire)
  • Bi-directional
  • +/- 50A
  • Very low resistance
  • 3kVrms isolation voltage
  • 14mA operational current – quite high

Operational amplifiers

These are useful for amplifying the signals for use on the micro-controller ADC. Thousands of op-amps exist, these are ones which are single-side power supply, rail-to-rail output and low offset.

Analogue to Digital Converters (ADCs)

Information and  Application Notes

To Do

  • Test each IC within a circuit – practical details and accuracy
  • Review more current sensing options
  • Produce full designs from DC current sensor
  • Look at full cost of each type of sensor

2 responses to “DC current measurement

  1. What a use full post.

    I been looking for some info about replacing the controller board of a fork lift truck charger battery this article will be help full.
    Thanks.

  2. sir.., i have something to ask about… according to my understanding about this post.. if i choose to use hall effect(ACS) sensor. I dont have to use a shunt resistor right? because if i i use shunt resistor, i need to use ad8211 ic for analog measurement right?. I am about confusing to use this 2 method invasive and non-invasive method.Second one is, for the analog conversion.. for arduino ..it is the same for ad8211 and ACS sensor according for your gifthub pv iv curve tracer?because i had run the code that you give but i had replace ad8211 with ACS in proteus it seem that the current does not read by the arduino.

Leave a Reply

Your email address will not be published. Required fields are marked *