One of the methods to sense a current is using a sense resistor to convert the current into a voltage and then using this voltage to change the bias of an emitter-degenerated current mirror. In doing so, the current in the current mirror becomes directly proportional to the sensed current. This method is not suitable when measuring currents in the milliampere range, because the current for the circuit (I2) is also passing through the sense resistor together with the current through the load (ILoad).
Let's start with the left circuit below. The right circuit is the "upside-down" version of the left circuit and is using NPN instead of PNP transistors, but the functionality is the same. In the left circuit below, the current mirror is formed by Q1 and Q2 and use emitter degeneration resistors R2 and R3. The sense resistor is R1. ILoad is the current that we want to measure. ILoad goes through the load (RLoad) and also flows through R1, with R1 being 0.1E.
Suppose that no load is connected, so RLoad is infinite, thus ILoad = 0. In that case, the current I2 through R1, R3 and R5 will be (12V - Vbe of Q2) / (0.1E + 10E + 470K) = 24.0 uA. As mentioned earlier, the current mirror uses emitter-degeneration resistors, R2 and R3. Because these resistors are not equal, the current mirror does not mirror an equal current over both sides of the mirror. The current through R2 is equal to (12V - (V3 + Vbe of Q1)) / R2, with V3 = I2 * 470K. Thus, I1 = 12V - (11.28V + 0.7V) / 1K = ca. 20uA. In this calculation, we neglect the base current of Q1 and Q2, that both are in the range of several tens of nanoamperes. Vout will be I1 * R4 = 20uA * 11K = 220mV. So without a load, Vout will be 0.22V.
Suppose we connect a load RLoad of about 1.1 Ohm, so ILoad = 10A. What happens now, is that we get a voltage drop of about 1V over R1. This means that V2 drops with 1V and will be about 11V. We can predict that this will lower current I2, because with less voltage, we get less current. V2 will be = V1 - (Iload * R1) = 12V - (10A * 0.1E) = 12V - 1V = 11V. Next, I2 will be (V2 - Vbe of Q2) / (R3 + R5) = (11V - 0,7) / (10E + 470K) = 21.9 uA. We can also predict that, because of the voltage drop over R1, that with the lower V2 and thus lower V3, the voltage over R2 will be higher, so the current I1 will be higher. I1 will be (V1 - (V3 + Vbe of Q1))/ 1K with V3 = V2 - (I2 * R3) - (Vbe of Q2) = 11V - (21.9 uA * 10E) - 0.7V = about 10.3V. When I1 =(V1 - (V3 + Vbe of Q1)) / 1K = (12V - (10.3V + 0.7V)) / 1K = (12V - 11V) / 1K = 1 mA. Vout = R4 * I1 = 11K * 1mA = 11V. We again neglected the base currents of Q1 and Q2 that will also flow through their emitters, so the result is an approximation of reality. So with a load of 1.1 Ohm, causing a load current of 10A, Vout will be 11V
By varying ILoad from 0 to 10A, we see that Vout varies proportional with ILoad from 0.22V to 11V. So we converted the current ILoad to a voltage Vout.
The advantage of this method is that it does not need a precise and stable voltage reference to compare the sense resistor voltage drop against.
Another interesting circuit that uses a similar approach to convert a current into a voltage is shown below. In this case, an OPAMP is used to form a current mirror in combination with Q1.
Let's concentrate on the left circuit below. The right circuit again is the "upside-down" version of the left circuit and using an NPN transistor instead of a PNP transistor, but the functionality is the same.
In the left circuit below, the OPAMP is connected in a configuration where the output is fed back to the inverting input, thereby enforcing negative feedback : when the OPAMP output is high, it will cause the transistor to conduct less, meaning that the voltage on the inverting input will increase. Negative feedback also means that the OPAMP will try to make the voltage at the inverting input equal to the voltage at the non-inverting input. Thus, the OPAMP will try to make the voltage difference between both inputs equal to zero, so V2 will always be equal to V3. The currents going into both OPAMP inputs can be neglected, so the current ILoad through R1 is equal to the current ILoad through RLoad. Because the OPAMP will make V2 = V3, the voltage over R2 will be the same as the voltage over the current sensing resistor R1.
Suppose that no load is connected, so RLoad is infinite and ILoad = 0. In that case, the voltage over R1 will be 0, so V2 = V1 = 12V. The OPAMP takes care that V3 = V2, so V3 will also be 12V. Since the voltage over R2 is 0V, I1 will be 0A. If I1 = 0, then the current through R4 will also be 0. That means that the voltage over R4 will be 0, so Vout is equal to ground, thus 0V. So without a load, Vout will be 0V.
Suppose we connect a load Rload of about 1.1 Ohm. Then ILoad will be 10A, causing a voltage of 1V over R1. That means that V2 = 12V - 1V = 11V. The OPAMP takes care that V3 = V2, thus V3 = 11V. The voltage over R2 will be 12V - V3 = 1V, thus the current through R2 will be 1V/1K = 1 mA. When we neglect the base current of Q1, the collector current of Q1 will be equal to the emitter current, so the current through R4 will also be 1 mA and causes a voltage of 1 mA * R4 = 1 mA * 10K = 10V over R4. So with a load of 1.1 Ohm, the load current is 10A and Vout will be 10V.
By varying ILoad from 0 to 10A, we see that Vout varies proportional with ILoad from 0V to 10V. So we converted the current ILoad to a voltage Vout, similar to the circuits above.
The OPAMPS are powered between a positive and negative rail, so the OPAMP inputs and output work down to 0V. When using a rail-to-rail input-output (RRIO) OPAMP, the OPAMP can be powered between ground (GND) and the positive rail.
The transistor can be replaced by a MOSFET (P-MOSFET in the left circuit and N-MOSFET in the right circuit).
The figure below shows the complementary configurations with the same functionality.