# DC current sense using Opamp

#### ep.hobbyiest

Joined Aug 26, 2014
199
I want to measure a current consumption for DC fan. I am using OPA2197 opamp for the same. Following is the circuit diagram.

i want to understand if this circuit missing anything?

#### AlbertHall

Joined Jun 4, 2014
11,610
If the 3.3V is used as the op-amp supply then the circuit will not work. Pin 3 will be at 24V but the inputs need to be within the supply voltage. You can run this op-amp at up to a 36V supply so if the supply is is between 24V and 36V the circuit will be fine.

#### Ian0

Joined Aug 7, 2020
3,783

#### crutschow

Joined Mar 14, 2008
28,224
It would work better if you detect the current in the ground lead by putting R4 between pin 2 of the fan and ground.

As shown, you must keep the op amp input voltage below the supply voltage and the input common-mode offset voltage will depend upon how well the resistor values are matched.

#### Ian0

Joined Aug 7, 2020
3,783
If you really want to use the op-amp (if, for instance, you have a dual op-amp and half of it is spare) then is there a good reason why you can't sense the current in the negative supply, as @crutschow said, where the voltage at the pins will be within its common mode range?
What is the supply voltage to the op-amp? If you must sense in the positive rail, then that would determine how difficult it might be.

#### ep.hobbyiest

Joined Aug 26, 2014
199
Thanks @Ian0 @crutschow @AlbertHall .
i was thinking to use Opamp based approach because of availability and price. Supply voltage was +48V.
i am planning to connect output of opamp to micro controller which runs on 3.3V.

#### BobTPH

Joined Jun 5, 2013
4,053
Now answer the other half of their question. Is there a reason you cannot measure the current on the ground side rather than the supply side? This simplifies the circuit significantly.

Bob

#### RPLaJeunesse

Joined Jul 29, 2018
193
To level shift down you want R6 and R7 quite large while R9 and R10 are relatively quite small. To keep R4 power down it needs to be in the 10s to 100s of millivolts maximum while the output swings ~3.3V. So that calls for a significant gain, which dictates for a given R6 and R7 that R9 and R10 are relatively quite large. It is impossible for R9 and R10 to be both "relatively quite small" and "relatively quite large" at the same time, the circuit as shown cannot be made to work. Sorry.

#### Ian0

Joined Aug 7, 2020
3,783
Supply voltage was +48V.
But what is the op-amp supply voltage? The OPA2197 won't run on 48V!

#### crutschow

Joined Mar 14, 2008
28,224
If you won't answer all of our questions, then how can we answer yours?

#### ep.hobbyiest

Joined Aug 26, 2014
199
Yes i am considering to add current sensing on the other side of the fine.

#### ep.hobbyiest

Joined Aug 26, 2014
199
But what is the op-amp supply voltage? The OPA2197 won't run on 48V!
There was confusion. i will recheck my design for power input.

#### Ian0

Joined Aug 7, 2020
3,783
There's one thing that application note doesn't tell you: those three black triangles represent "earth" and assume some miraculous zero resistance connection between them. If you have any pcb track down which the fan current flows between the negative end of Rshunt and your microprocessor ground or between the end of Rshunt and the ground connection of Rg, then you have an error, and that error is amplified by the gain of the op-amp (x50).

Even the 4-resistor circuit you have on post #1 would be an improvement, but INA180, AD8418 etc. is the best way to go if you want to do the job properly. (AD8418 could do either high-side or low-side connection of Rshunt)