Chapter 15 - MPLAB® Mindi™ Analog Simulator - Current Sensing

Last modified by Microchip on 2023/11/09 09:06

This chapter presents an introduction to a couple of current sensing solutions. Two different high-side current sensing topologies for battery-operated systems are presented. In battery-powered embedded equipment, the current sensing devices should accurately measure the sensed current in the load even when battery voltage decreases to its minimum operational value and consume very little power. The simulations below illustrate this application.

15.1 Prerequisites

15. 2 High Side Current Sensing

Design a circuit to sense high-side current in a battery-operated embedded design and show proof of concept using the MPLAB® Mindi™ analog simulator. The solution must be designed to operate at 1.8V LDO output and tested at 1.8V supply rail. The variable load resistance range is 9 Ω to 18 Ω. The sense resistor chosen should be commercially available and should minimize heat dissipation at the sensed currents while maintaining a reasonably large sensed voltage for amplification.

15.2.1 Current Sensing Using Difference Amplifier

Open the schematic named HighsideCurrentSensing_MCP6V01.wxsch as shown in the accompanying image. The circuit is configured as a difference amplifier for measuring the current across the 5 mΩ sense resistor. With VDD at 1.8V, a load of 9 Ω will sink 200 mA and a load of 18 Ω will sink 100 mA.

The symbol, E1, is a voltage-controlled voltage source of gain 1 and is used to measure the sensed voltage input (vsense=isense*Rsensed). It is used as the X input to probe AmplifierOut that plots amplified output versus the sensed voltage.

The current probe, IPROBE1, measures the load current.

The load resistor, R5, is parameterized ("restail") to vary the load for a DC sweep simulation that will simulate the sensing current from 100 mA to 200 mA.

MCP6V01 Current Sensing Highside

The accompanying figure shows a differential configuration with a gain of 1773 (R1/R2), amplifying the sensed voltage across the 5 mΩ sense resistor. To optimize the signal output and to allow the use of lower-valued gain resistors, 5 mΩ was chosen. The lower value gain resistors cause the least interference with the sense resistor’s resistance. In addition, 5 mΩ is also a commercially available sense resistor.

Add DC bias annotations to the positive input and negative inputs of the E1. Select Place > Bias Annotation > Place Marker at E1 + input and – input.

Set up the DC sweep to simulate a load current change as shown in the accompanying image.

MCP6V01 Current Sensing DC sweep dialog

Double click on IPROBE1,

In the Probe Options/Analyses dialog, set DC Sweep
In the Probe Options/Analyses dialog, set Use separate Graph. Write the graph name as "Load Current".

Double click on probe AmplifierOut. In the Probe Options/Analyses dialog, select All analyses disabled.

Select Simulator > Run Schematic (F9). Two graphs will be rendered, one for probe IPROBE1 and the other for AmplifierOut respectively.

Sweeping the resistor R6 from 9 Ω to 18 Ω drives a current of 200 mA to 100 mA through the load respectively. The simulation results are displayed in the accompanying figures. It shows the load current output versus the load resistance change and the amplified output versus the sensed current voltage.

Using our measurement cursors, we read a load current of 199.9 mA at 9 Ω and 100 mA at 18 Ω. We can use Measure > Minimum and Measure > Maximum to read amplified outputs of 889.97 mV and 1.775V for sensed outputs of 500.2 µV and of 999.6 µV respectively.

The ideal sensed current amplified output at 100 mA is (100 mA * 5 mΩ) * 1773 = 886.5 mV. The ideal sensed current amplified output at 200mA is (200 mA * 5mΩ) * 1773 = 1.773V. Therefore, the zero error is 0.39% and full-scale error is 0.11%.

MCP6V01 Current Sensing Loadcurrent

MCP6N16 Current Sensing Output

Next, compute the expected total error contributions for this circuit. There are two error sources, Common Mode Rejection Ratio (CMRR) and input offset voltage.

CMRR Error Contribution

Refer to the MCP6V01 datasheet. On page 3, you will note that the common mode input range maximum exceeds the supply rail and is VDD + 0.2V and that the minimum CMR is 130dB.
Error contribution to output from common mode = [Vsense/CMRR] * Gain (non-inverting)
CMRR = 10(130db/20) = 3.16 x 106
Gain = 1 + R1/R2 = 1774
Vsense = 500 µV
CMRR Error Contribution is = (500 µV/3.16 x 106) * 1774 = 280 nV

Input Offset Error Contribution

The input offset error contribution is measured as a ratio to the input sense voltage at a minimum load current, as this provides the worst-case error. Error due to input offset voltage = MCP6V01 offset/Sense Voltage = ±2 µV/500 µV = 4 mV.

As the two errors are non-correlated, we will take the square root of the sum of squares of the individual errors, yielding a total error of 4 mV. Our observed error from the simulation is around 2 mV.

The bias annotations show that the positive input to the differential input is at 1.8V which is the supply voltage of the MCP6V01. Although one of the inputs is at the power supply rail voltage, the amplifier accurately amplifies this signal as the common mode voltage input range includes the supply rail of the MCP6V01. You can verify this on page 3 of the MCP6V01 datasheet, under the specification common mode input voltage range. It is listed as VDD + 0.2 V. Note that we used 0.1% tolerance resistors for the difference amplifier gain resistors, 5% tolerance for the sense resistor, and 1% tolerance for the load resistor to achieve this result.

15.2.2 Sensing with an Instrumentation Amplifier

Next, we will use an instrumentation amplifier to sense the load current. Open the file HighSideCurrentSensing_MCP6N16.wxsch. Observe in the figure below, the current sensing solution is configured similarly to the difference amplifier solution to provide a gain of 1773 for an input of 500 µV across the 100 mA to 200 mA load current range. Run the DC Sweep simulation.

MCP6N16 Current Sensing Highside

The simulation results of the INAAmpOut and LoadCurrent probe outputs are shown in the accompanying figures.

Observe that the amplified sensed current outputs are similar to the difference amplifier. Hence, the resulting accuracy of the solution is the same. If you open the MCP6N16 datasheet and observe the CMRR and the offset of the MCP6N16, they are 112 dB and 17 µV respectively. The 17 µV of offset should contribute an error of 34 mV. However, this is not the case as the INA has a zero-drift architecture that compensates for offset voltages.

MCP6N16 Current Sensing Output

Load Current vs Load Resistance

Back to top

15.3 Supply Voltage Effects on Current Sensing

15.3.1 Using a General-Purpose Amplifier

Open the simulation file named Current_Sensing_HighSide_LowBattery_MCP6001. The circuit shown in the accompanying figure is configured as a difference amplifier and is sensing current across the 10 mΩ sense resistor. The amplifier selected for this purpose is the general purpose MCP6001 with a minimum CMRR of 60 dB and a maximum offset voltage of ±4 mV.

A changing supply voltage is simulated by sweeping the DC power supply source V2 from 3.3V to 1.8V. The gain of the difference amplifier is 303. The voltage-controlled voltage source, E1, is set up to monitor the differential output * gain. The amplifier's output is the sensed voltage * gain. The XY Probe plots amplified sense voltage against the supply voltage change (Vdd). The resulting plot from the simulation is displayed in the accompanying figure.

MCP6001Highside Current Sense Batterysweep

Zoom into the Y-axis of the graph to view the small change in output. From the accompanying figure, we observe that the output changes by 22.81 mV when the power supply of the amplifier changes from 3.3V to 1.8V. There are many parameters that affect this gain. They are the Power Supply Rejection Ratio (PSRR), CMRR, input offset voltage, and the input bias current * equivalent source resistance of the circuit.

The expected output is 1.158V and the actual output is 0.9376. This is a large error. This error arises due to the power supply rejection ratio, the limited common mode input range of the amplifier, as well as reduced common mode rejection ratio (60dB). The expected error contributions are:

  1. Output Error due to CMR=[∆Vcm/ CMRR (V/V)]*Gain
    1. [(0.15) / 10(60dB/20)] 303 = 45.45 mV
    2. where ∆Vcm = Vdd – Vcm(data sheet) is computed at the test conditions specified in datasheet Vdd/2 = 1.65.
  2. Output Error due to PSRR Error= (∆Supply * Gain) / 10(PSRR in dB/20)
    1. ((3.3 V-1.8 V) * 303)/ 10(86dB/20) = 22.8 mV
  3. Output Error due to Offset Error= (Input Offset Voltage * Gain)
    1. (300 µV) * 303) = 90.9 mV
  4. Total Error is = √(CMR Err)2+ (PSRR Err)2+ (Offset Err)2 = 104 mV

MCP6001 Highside Current Sense Batterysweep Out

Although the common mode input of the MCP6001 amplifier extends to the rails VDD + 0.3 V, section 4.1.3 in the datasheet states that common modes inputs in the range of VDD-1.1V should be avoided to stay away from gain non-linearity and distortion. According to our simulation, this effect contributes to the additional error beyond 104 mV.

15.3.2 Using Precision Amplifier

Next, we will use the precision amplifier MCP6V01 to evaluate its response to power supply changes. The common mode input range of this supply is at the supply rail and the rejection ratio is 130 dB and the offset is ±2 µV. Open the simulation file named Current_Sensing_HighSide_LowBattery_MCP6V01. See the accompanying figure.

MCP6V01 Highside Current Sense Batterysweep

Run the DC sweep simulation. The output will be as shown in the accompanying figure.

MCP6V01 Highside Current Sense Batterysweep Out

In the above simulation, there are two important observations:

  • Amplifiers output does not change when supply voltage changes
  • Accuracy of sensed current is maintained, 1.1586V is only 0.06% from the expected output of 1.15798 V.

This simulation illustrates that a precision amplifier (MCP6V01) with common mode input range that extends beyond the supply rails (VDD + 200 mV), a high CMRR (130 dB), and very low offset (2 µV) voltage is a good choice for current sensing in battery-powered embedded systems, as it can measure the sensed current with high precision even when battery voltage is at the common mode rails of the amplifier. The bias annotations on the schematic at the end of the DC sweep are at 1.8V (amplifier rail voltage) at the non-inverting input and 1.7961V at the inverting input.

15.3.3 Using an Instrumentation Amplifier

Repeat the above analysis using INA MCP6N16. The minimum CMRR is 112 dB and the PSRR is 110 dB. Open the simulation file named Current_Sensing_HighSide_LowBattery_MCP6N16. See the accompanying figure.

Run DC sweep. Simulate > Choose Analysis > Analysis Mode/DC Sweep. The output is shown in the accompanying figure.

MCP6N16 Highside Current Sense Batterysweep

The INA-based current sensing solution also displays no changes in sensed current when the supply voltage drops from 3.3V to 1.8V and behaves similarly to the MCP6V01.

Back to top


Amplifiers with rail-to-rail common mode input range, high CMRR > 100 dB, very low offsets, or offset compensated are good candidate amplifiers for current sensing in low power embedded applications where accurate current monitoring is needed even when the battery supply voltage drops with time and usage.

MCP6N16 Highside Current Sense Batterysweep Out

The INA-based current sensing solution also displays no changes in the sensed current when the supply voltage drops from 3.3V to 1.8V. In addition, the output accuracy is 0.03%. A small improvement from the difference amplifier solution.

15.4 References

15.4.1 Datasheets

15.4.2 Evaluation Boards

Back to top