I built a slightly more complex version of that circuit, and yes it will work, with some changes. There's some risk in using a MOSFET as a voltage-controlled resistor because of the negative temperature coefficient of Vgs(th). A safe current when pulsed may not be a safe current when run constantly. You have a fair chance of frying the MOSFET if you're using it to dissipate power rather than switching. A safer bet would be a darlington power transistor, like the TIP10* family (with a heat sink). But when you use that transistor, the LM358 won't be able to fully turn it off because the output can't go low enough--you can drop the output voltage by adding a couple diodes or LEDs after the op amp. I also suggest adding a resistor after the op amp output or a diode after the battery to protect the battery from being charged to a high voltage by the op amp output whenever you disconnect the sense resistor. A resistor will also protect the op amp from high output. (The exact problems that will occur depend on where you put the "off" switch.) But if you keep the MOSFET, you need a resistor on the op amp output since it's not nice to use a puny op amp to drive a capacitor. (You can think of a MOSFET gate as a capacitor.)
Next, your inputs will be outside the common mode input range of LM358 if you want to test a low current. This is easiest to solve by switching to a rail to rail op amp. You don't need a super fast one. The cheapest I could find is by Microchip. I think the model was MCP6001/MCP6002 or MCP6022. If you have a dual voltage supply, you can solve both problems (input and output voltage ranges) by the LM358 negative input with a negative voltage rail.
And is the max current you can drive 3.7 A? Yes, but it will be a bit higher when the battery is full, and lower (perhaps 3.3 A) when the battery is near empty. Don't drive it further than that. But a 5 W resistor won't work. Since power is I*V
or I²*R
, the resistor power will be around 15 W.
Something else to think about: is the positive voltage rail stable? You wouldn't want variation on the voltage rail to change your reference voltage. If it's not stable, you can use a 3.3 V LDO regulator on top of the potentiometer where you wrote "+5V".