Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi,
You used a N-CH Mosfet. It needs higher voltage at gate than at it's source. (Positive V_gs) to become conductive.
The higher the V_gs, the higher the current.
Let's consuder the battery voltage to be constant, then: the higher the gate voltage (w.r.t. GND) the higher the current.
Now the Opamp inverting_input is the battery voltage.
On the non_inverting_input there is a current source trying to pull down the voltage.
Thus - without charging current - the voltage at the non_inverting_input is less than the voltage at the inverting input.
This is called "negative differential input voltage" ..... with the gain of the Opamp ... the output tries to go negative.
But you want the opposite. You want the output to go positive ... to make the mosfet conductive ... to make charging current flow.
*******
I think the circuit is wrong.
* either use a P-ch Mosfet
* or flip the Opamp inputs
Klaus
Added#1:
While the Opamp is rail-to-rail output it is not rail-to-rail input. Read the datasheet.
Datasheet says V_cm is up to 3.0V with 5V supply. You use 6V supply and 3.8V V_cm. Not sure if this is within specification. Mind that the battery voltage will rise higher than 3.8V.
To avoid oscillation of the Opamp circuit I recommend to use local capacitive feedback...from output to inverting_input ... with a useful series resistor at the inverting input from battery.
Added#2:
The Mosfet is not suitable.
It seems to be obsolete.
And it is optimized for high switching frequency - which you don't have.
It is optimized for high currents at low R_ds_on - which you don't have ... because you operate the Mosfet in linear (high ohmic) region.
V_gs_th is 1V...2.2V for a tiny current of just 250uA.
With 3.8V battery you need at least 4.8V to make this 250uA to flow ... typically you need a higher voltage.
In worst case you need 6V for 250uA... this is your power supply limit.
Your Opamp output voltage is much less than the supply voltage, I assume this is because you exceed V_cm range. As mentioned in added#1.