The bidirectional current sensor shown takes advantage of the extended common-mode range (greater than 90 dB) of the LT1495 dual op amp, to sense currents in and out of a 12-V battery while operating from a single 5-V supply (see the figure). This is possible because U1 features “over the top” operation—the ability to operate normally with inputs above the positive supply.
During the charge cycle, op amp U1A controls the current in Q1 so that the voltage drop across RAis equal to IL×Rsense. This voltage is amplified at the charge output by the ratio of RA to RB. During this cycle, amplifier U1B sees a negative offset, which keeps Q2 off and the discharge output low. During the discharge cycle, U1B and Q2 are active and operation is similar to the charge cycle. Although a 12-V battery is shown in the diagram, the circuit will operate equally well with battery voltages up to 36 V, the maximum input voltage for the op amp. The circuit has the added advantage of very low power consumption. In the absence of any charge or discharge current, the circuit draws only 2 µA, the quiescent current of the two amplifiers.