This section will serve the purpose of explaining how we can integrate current-sensing in a PCB. I found this to be a somewhat common technical interview question for those who want to do Hardware in their 1st few coops.
It’s easy for someone to just say “oh, to measure current use an ammeter”. Now, there’s nothing wrong with this answer, because it’s not wrong. But let me ask you two more questions :
How does an Ammeter measure current?
Say this is for sensitive equipment, do I really want to just stick an ammeter inside? How are we going to get the equipment to read it digitally?
This is where current-sensing comes in
Introduction :
Current-Sensing has many applications, not just for a Solar Car, let’s briefly look at some examples.
State of Charge in a BMS(Battery Management System)
Recall the fundamental definition of current is : “The rate that charge(Coulombs) that flows through per unit of time”. This means that if we want to calculate how much charge is in a battery, one way is using something called coulomb counting. Effectively, you integrate your function of current with respect to time. This requires us to know the current, which is where current sensing comes in.
Over Current Protection
In a conventional DC-DC Voltage regulator, using something like a switching mode regulator is generally more efficient than a linear regulator. Hence, it’s important for us to know the current going through the system. From a safety standpoint, this also makes sense for many sensitive circuits, we’d want to disconnect the system from the Power Rail if the current exceeds a safety threshold.
Current Sense Resistors(Shunt Resistor):
The simplest and most cost effective way to measure current is with a shunt resistor. These resistors reduce energy loss and are used all over industry. Think back to a circuits course, how do you measure current without an ammeter? That’s simple, using Ohm’s Law. We know the resistance R, and we measure the voltage drop. Solve for the current
V = IR
In other words, a shunt resistor R is placed in series with the electrical load we want to measure. Given our voltage drop and known resistance value, we can calculate current. There’s a few factors to take into account for our shunt resistor :
Resistance : Recall P = I^2*R, so we want a small resistance value to minimize power losses. This is why you see shunt resistors are usually in the magnitudes of 0.1 - 10 milliOhms. This also means we can handle much more precise voltage drops
Wattage : Pretty self explanatory, this is the maximum power rating the resistor can handle.
Tolerance : As you could imagine, we need the tolerance to be very high especially at small resistance values to achieve high accuracy, otherwise we’d see a lot of variance and deviation.
TCR(Temperature Coefficient of Resistance) : This describes how sensitive a resistor is to varying temperatures, so we ideally want a shunt resistor with a very low TCR so it decreases temperature dependency for having good measurements. Especially important if your system is working in a very hot ambient environment.
Current Sense Amplifiers:
When an IC measures the voltage drop across the resistor, this is usually in the realm of a few mV, so how do we actually use this information? A few mV could also just be noise in a circuit, so how do we actually use this information?
The answer is we use current-sense amplifiers. If you’ve studied a circuits course already, you’ve probably seen what operational amplifiers are. This is precisely an application of Op-Amps. These circuits will amplify the difference in voltage(difference amplifier) so an Analog-Digital Converter(ADC) in a microcontroller can properly process this information.
If R1 = R3 and R2 = R4, then Vout = Vin * R2/R1 * (V+ - V- ). In other words, our gain is configurable by these resistance values. These are effectively how the ICs do voltage sensing. Of course, with a few extra parameters to take into consider
This next part I’m gonna take from WARG’s Electrical Lead(Kevin Li), he explains this section very well:
“An instrumentation amplifier is a type of differential amplifier with an input buffer, eliminating the need for input impedance matching. This makes it suitable for use in measurement and test equipment applications. Instrumentation amplifiers are used where great accuracy and stability of the circuit are required. Characteristics of an instrumentation amplifier include:
Very low DC offset
Low drift
Low noise
High open-loop gain
High common-mode rejection ratio
High input impedance
The figure below shows a typical differential amplifier.
The gain of the circuit is given by the following expression:”
Now, let’s discuss some common configurations and common issues with current sensing.
High Side vs Low Side Sensing:
High side refers to placing the shunt resistor on the “high side” of the circuit, next to the supply, versus connecting it “low side” next to the ground node.
High Side Advantages & Disadvantages
In some automotive applications, it simplifies wiring since Car Chassis is usually used as Ground, so we only need one extra wire
Shorts to ground are easily detectable
Common mode voltage is very close to the bus(since the voltage drop is so minimal), so you need an amplifier that can handle it. It may require the input common-mode larger than the supply required, which is not always feasible. Unless you want to shift the reference down
Low Side Advantages & Disadvantages
Reference is fixed at ground, common mode is close to 0 so the amplifier doesn’t necessarily need a very high CMRR
Low voltage drop in a shunt means both nodes act as a “ground”, potentially causing a ground loop. This can be bad for electrical noise, especially if we interface with the load. This is because the ground of the monitored circuit is slightly higher than System Ground. Some Analog circuits will really hate this. This is why low side is normally used for isolated systems or a system where the load isn’t noise sensitive.
Bus Shorts won’t be detectable