I have a 7S lithium 18650 Battery Bank (28.7V total, 4.1 each) and an Arduino Uno to control the solar charge. Pin10 as the PWM into a BJT (2n3904) that triggers the gate of a MOSFET (IRF640N) that connects or disconnects the ground from solar cells.
So far so good, PWM regulates charging when 0 and no charge when 255 and all in between those values.
But my Problem start after all that before:
When it reaches 28.7 the charging method (PWM = 0 which is máximum charge) turns into PWM variable, and doesn't stop charging fast enough.
Cheking the Voltage values of the GATE of the MOSFET:
pwm-pulse = 0, maximum charge , Gate Voltage = 12.5 V
pwm-pulse = 255, minimum charge, Gate Voltage = 0 V
So you would soy "evething's right!" but no.. if pwm 212 I get 2,06V on Mosfet-Gate and if pwm 172 I get 4,03V on Mosfet-Gate.
How should I simulate/adjust/make a curve for the MOSFET to stop charging or work faster and really make use of the pwm instead of just turning the MOSFET on and off
NOTE: I used a Voltage divider with 100K y 18K to read on A0
pin10 (pwm) goes to a 1K resistor into the base of BJT (2N3904), BJT emiter and Mosfet Source to ground, BJT colector to Gate-Mosfet and all of them with a 10K to 28.7V BatteryBank. Finally Mosfet Drain to the (-) of solar panel
and you're right, all measured with a multi-voltmeter
Hi,
Can you please give us a complete circuit diagram, showing all battery and solar panel connections?
A pen(cil) and paper drawn diagram will be fine, just make sure all pins and components used are labeled.
Your MosFet is not of the correct polarity. It will look like a diode when used in that ckt.
I think wiring it a different way. Maybe the MosFet has to be flipped around, which will change the drive circuit. On the way out and can't check the details right now. But the mosFet has to be connected so current goes from drain to source. And the gate voltage has to be positive relative to the source.
So you mean the Mosfet, when using it to switch the ground/(-) connection of the solar panel, makes the current flow from Source to Drain which makes the internal body diode conducts even when no positive voltage is on Gate (compared to Source)????
Yes, the body diode is actually a parasitic portion of the MosFet structure.
I think there is a way to use this Mosfet if you reverse the drain and source but I would have to go through it again to be sure.
You could of course use a P-Channel Mosfet.
What is your charging current?
I'm really puzzled by this. The problem is that it seems the lowest point in the circuit is the solar panel negative terminal. It's not the system ground. So the mosfet needs to control current flowing from ground back into the solar panel.
But I think there's also a problem that if the mosfet is off, the solar panel somehow becomes de-referenced from the rest of the circuit, including the Arduino and the NPN. Well, I shouldn't pretend to understand this. I've always had trouble with low side switching when there are multiple power rails.
@ShermanP you are exactly correct. I'm embarrassed I missed that (was focusing on the MosFet function.)
The OP will need to common the circuit and Solar panel grounds. Switch the high side with a PChannel Mosfet and move the divider going to A0 directly to the solar panels.
I was trying to make "things work" with what I had available in my box of parts
Now I'm buying a bunch of P-channel mosfet to change everything and have a better desing, with no loss, and with controlable charging and "NO CHARGING" to avoid overcharging the 18650 which they hate!