# Why cap across shunt resistor, input bypass caps and small resistors on current sensing inputs?

I want to build a sensitive current sensing circuit using shunt, and since I also repair MacBooks occasionally, I have some contact with the schematics of real working expensive devices (although whoever follows Louis Rossmann, knows there are issues there too sometimes, but it's not the point here).

While browsing through the schematics of a macbook, I've noticed an interesting thing: most current sensing circuits are simply shunt resistors with each of their sides connected to current sense amplifier such as INA210. All cool and easy, no magic outside Hogwarts detected.

But when it comes to PPBUS (main power line) and charging power line, there is a 0.02R SHUNT, and sides of the shunt go through 10R RESISTOR each, then there is a CAPACITOR between the inputs of 0.047uF and a 0.1uF CAP on each input line to the ground. And only then the lines go into an IC. Why so much mess, while on other lines it's simply shunt straight to amp. Should I have something similar?

Here's a screenshot of that part of the circuit:

There is some info here about the small resistors, but it doesn't exactly compare what happens with resistors and without, like with: this happens. Without: this happens.

I still didn't understand how some 10 Ohm resistor is supposed to make things better if input impedance is like a megaohm or greater.

Besides, there is also a capacitor question (why cap across? why bypass caps there? what value? what for? should I do it too?)

• these circuits usually come after decades of solving and circumventing problems and circuit bugs. – Abdullah Baig Jun 18 at 10:17

The basic purpose of a pair of resistors and a capacitor across the differential amplifier is to filter out the noise.

Measuring current is often noisy, and measuring critical current path requires clean input.

If you follow the design recommendation for Current Monitor IC INA219 in the datasheet, you'll find the exact same configuration:

I'll copy the verbatim as-is from the datasheet below:

The internal ADC is based on a delta-sigma (ΔΣ) front-end with a 500-kHz (±30%) typical sampling rate. This architecture has good inherent noise rejection; however, transients that occur at or very close to the sampling rate harmonics can cause problems. Because these signals are at 1 MHz and higher, they can be dealt with by incorporating filtering at the input of the INA219. The high frequency enables the use of low-value series resistors on the filter for negligible effects on measurement accuracy. In general, filtering the INA219 input is only necessary if there are transients at exact harmonics of the 500-kHz (±30%) sampling rate (>1 MHz). Filter using the lowest possible series resistance and ceramic capacitor. Recommended values are 0.1 to 1 μF. Figure 14 shows the INA219 with an additional filter added at the input.

Edit:

Is it a good idea to always include a noise filter?

It depends on several factors:

1. Your amplifier input bias current. If your amp has a relatively high input bias, then some current will leak into the amp, reducing measurement accuracy. The situation worsens if you're trying to measure low current (μA or nA). INA219 has 100 nA input bias current, so measuring tens of mA to several amperes will be good enough.
2. Your noise frequency. The low pass filter cannot, well, filter out the low-frequency noise.

But yeah, adding low-pass filter is generally a good practice.

• So if I aim for stability and accuracy (although ultra precision is not necessary in my case) and have room/budget for a pair extra caps in there, better to have them? Of course after consulting the amp datasheet, which can be something else in my case, haven't decided yet. – Ilya Jun 18 at 10:28
• @Ilya I've updated my answer above. – rosmianto Jun 18 at 11:00
• Thanks for the update! Clarifying that I never planned to use INA219, it was nothing more but an abstract example. How come low pass filter doesn't filter out high frequency noise? Isn't it exactly what it filters out by definition? Lets lower frequencies stay and kills higher? – Ilya Jun 18 at 11:29
• Oops, my bad. That's a typo, it should be low-frequency. Will fix it asap. – rosmianto Jun 18 at 11:37
• The datasheet goes on to recommend: "If the need for filtering is unknown, reserve board space for the components and install 0Ω resistors unless a filter is needed." – Alex Hajnal Jun 18 at 22:01

The 10 Ohm with 100nF create a low pass filter with a cutoff frequency of $$\ f_c = 160 kHz\$$. This is too high to be meant to filter the PWM of the current control (this will be something like 20kHz), but it filters out noise above this frequency. Without the filtering the current control loop might become instable when there is noise coupling in.

This kind of RC is not always a filter but is sometimes used to compensate the zero of the shunt (R-L).

The shunt has a very small parasitic inductance that becomes significant when the shunt value is low (<5mOhm). The parasitic inductance is usually between 500pH and 5nH depending on the size and manufacturing of the shunt.

The voltage at the shunt terminals displays some spikes when high di/dt occur (e.g. current chopping application), that can trigger a short-circuit detector.

The RC filters here have much smaller frequencies than the zero of the shunt (160kHz common-mode and 80kHz differential mode due to C7120) so it is used as a filter.

Edit: The small filter resistors are necessary for fast convergence at the analog inputs (parasitic input capacitors). 10 Ohms is much higher than 20mOhm so the resistors won't alter the signal. In some applications, the filter feeds an ADC that can have a significant input capacitance (e.g. SAR) or the small shunt voltage signal needs a high amplification so that low input resistors reduce thermal noise.