DC current sense using Opamp

Thread Starter

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.
1630479881374.png

i want to understand if this circuit missing anything?
 

AlbertHall

Joined Jun 4, 2014
11,594
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.
 

crutschow

Joined Mar 14, 2008
28,166
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,754
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.
 

BobTPH

Joined Jun 5, 2013
4,032
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
189
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,754
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)
 
Top