Help with li-ion solar charging with load-sharing

I need some help regarding my project. I have made a dog feeder with Arduino Uno, which is powered with a 3000mAh Li-Ion battery. I want the system to be charged with a solar panel (more solar panels can be wired in parallel to increase current output), so I am using THIS module. However, I need load-sharing based on this thread. My example circuit is the following (note: SOURCE will be connected to Load, not DRAIN):

I need help choosing the P-Mosfet. I want the mosfet to be ON when the voltage from the solar panel drops below 4.4V, thus allowing the load to use the battery as a power source and the mosfet to be OFF when I have above 4.4V, so that it will charge the li-ion and power to load.

  • Correct me if I am wrong, do I need VGSth to be minimum -0.6V to turn ON the mosfet, when the voltage at GATE drops to 4.4V (4.4V - 5V at SOURCE = -0.6V )? I am thinking of THIS if so.
  • Can I use a silicone diode instead of a schottky like 1N4007, in order to drop the voltage at the load with -0.7V ensuring that I won't fry the Arduino and the other 5V peripherals such as 16x2 LCD Display, when the solar voltage is higher than 5V? The issue is then just before the solar voltage at the GATE to drop to 4.4V to turn ON the mosfet, the voltage at the load won't be enough to power the arduino ( lets say the Vsolar is 4.6V - 0.7V from the diode = 3.9V )
  • The the other option I am thinking of that could be much easier to implement is to measure the Vsolar from the Arduino's analog pin and when it drops below 4.4V to turn ON a logic level P-Mosfet and possible another P-Mosfet (switched ON by the Arduino) to allow the Vsolar to go through MT3608 booster when the voltage is less than 5V in order to power the load. Can this work ? I have found that the same thing was asked for the same charge IC (CN3609) in this thread and the solution is to use a comparator, but if the Arduino voltage measure at the analog pin can be implemented wouldn't it be much easier overall?

I would really appreciate your suggestions on how I can achieve the load-sharing with the solar panel!

A MCP73871?

Hi,
How do you mean "load sharing"?

Tom.. :slight_smile:

TomGeorge:
Hi,
How do you mean "load sharing"?

Tom.. :slight_smile:

I want the mosfet to be ON when the voltage from the solar panel drops below 4.4V, thus allowing the load to use the battery as a power source and the mosfet to be OFF when I have above 4.4V, so that it will charge the li-ion and power to load.

Idahowalker:
A MCP73871?

I want to design it with the charging module I have shown, because modules with MCP73871 are available from Adafruit, but cannot afford to spend 2x the price of the module for shipping or buy chinese module and wait months to arrive.

The orientation of the mosfet usually has the drain connected to the battery so the internal body diode of the mosfet will block current from coming back into the battery from the solar source when the mosfet is off. Also, the mosfet won't just turn on and off at a particular voltage. It will begin to conduct at its GS threshhold voltage, but won't be fully on until the differential is several volts higher. So if it's partially on, you will have a voltage drop across it, which makes it no better than a diode. In fact, you could just have a diode in each path and it would work ok - the higher voltage would always supply the load. But of course you would have the diode drop in the battery output, which is what the mosfet is intended to avoid.

I've tried to figure out the comparator option, but with no success. It seems to me that you would have to compare the battery voltage to the solar output voltage, but since both voltages would sag under load, it seems it would oscillate.

I'm unable to find the datasheet for the CN3609, but if it works like the TP4056, and if your load current is really only 50mA most of the time, I think you should look at doing it the "wrong" way, without any load sharing at all, and just have everything come through the charger. As long as charging reaches termination, you would be ok. The only disadvantage is that the battery would cycle back and forth between 4.2V and about 4.05V even when the sun is shining.

Another possibility is to run the solar output through a buck/boost regulator to produce a fixed 5V output. Then you could just use a standard load sharing circuit.

I think oscillation is a big problem with this, even if controlled by the Arduino. The solar voltage might be high if there's no load on it, but very low even with a light load, and that's a problem. If only we knew how the MCP73871 deals with all of this.

ShermanP:
The orientation of the mosfet usually has the drain connected to the battery so the internal body diode of the mosfet will block current from coming back into the battery from the solar source when the mosfet is off. Also, the mosfet won't just turn on and off at a particular voltage. It will begin to conduct at its GS threshhold voltage, but won't be fully on until the differential is several volts higher. So if it's partially on, you will have a voltage drop across it, which makes it no better than a diode. In fact, you could just have a diode in each path and it would work ok - the higher voltage would always supply the load. But of course you would have the diode drop in the battery output, which is what the mosfet is intended to avoid.

I've tried to figure out the comparator option, but with no success. It seems to me that you would have to compare the battery voltage to the solar output voltage, but since both voltages would sag under load, it seems it would oscillate.

I'm unable to find the datasheet for the CN3609, but if it works like the TP4056, and if your load current is really only 50mA most of the time, I think you should look at doing it the "wrong" way, without any load sharing at all, and just have everything come through the charger. As long as charging reaches termination, you would be ok. The only disadvantage is that the battery would cycle back and forth between 4.2V and about 4.05V even when the sun is shining.

Another possibility is to run the solar output through a buck/boost regulator to produce a fixed 5V output. Then you could just use a standard load sharing circuit.

I think oscillation is a big problem with this, even if controlled by the Arduino. The solar voltage might be high if there's no load on it, but very low even with a light load, and that's a problem. If only we knew how the MCP73871 deals with all of this.

Thanks for the reply. So as I have understood, the option to use the Arduino's analog pin to read the solar panel's voltage and turn ON/OFF the mosfet won't work? The solar input to the battery charger is not an issue as the charger outputs fixed 5V, so I can't figure out how using a boost regulator to produce fixed 5V for the situation when only the solar panel supplies the load can be implemented? When the solar voltage is above 5V and also if I have a fixed 5V in that path how then can drive the GATE of the mosfet, as I would like to switch to battery supply when the solar panel's voltage drop below 4.4V ?

  • I have tried with this charger charging the battery with the USB input while the load was connected and the charge did not terminate.

As far as I know, there are no readily available modules for Li based cells that charge correctly under "load sharing" conditions. You really must isolate the battery, charge it properly, then reconnect it to the circuit. The Li cell must also be protected from over discharge.

The MUCH BETTER alternative for hobby projects (especially solar powered projects) is to use lead acid or NiMH batteries, as they are far more tolerant of abuse.

Hi,
Have you got the PV cell and actually measured its performance?

I hate to burst your bubble but PV specs are derived in laboratory conditions so you will probably get 60 to 75% of the energy in normal conditions.
PV cells are current generating devices and you are going to try and use it as a voltage potential generator.

Better to just keep charging the battery and using power off it. That is what the charger module you have is designed for.

What is the 5V 50mA load?

Thanks. Tom... :slight_smile:

TomGeorge:
Hi,
Have you got the PV cell and actually measured its performance?

I hate to burst your bubble but PV specs are derived in laboratory conditions so you will probably get 60 to 75% of the energy in normal conditions.
PV cells are current generating devices and you are going to try and use it as a voltage potential generator.

Better to just keep charging the battery and using power off it. That is what the charger module you have is designed for.

What is the 5V 50mA load?

Thanks. Tom... :slight_smile:

as I stated in my first post the Arduino is the load demanding 50mA with a 16x2 LCD, and the charger as also stated in my last post doesn't terminate charging when under constant load.

garabetov:
Thanks for the reply. So as I have understood, the option to use the Arduino's analog pin to read the solar panel's voltage and turn ON/OFF the mosfet won't work? The solar input to the battery charger is not an issue as the charger outputs fixed 5V, so I can't figure out how using a boost regulator to produce fixed 5V for the situation when only the solar panel supplies the load can be implemented? When the solar voltage is above 5V and also if I have a fixed 5V in that path how then can drive the GATE of the mosfet, as I would like to switch to battery supply when the solar panel's voltage drop below 4.4V ?

Ok, I was confused by your reference to a CN3609. I finally found a schematic for the DFR0559 module you're using, and it has a CN3065 charger chip directly connected to an MT3608 5V boost converter, with no load sharing circuit in between. I need to think more about how load sharing might be done. The issue I'm having trouble with is that you need to disconnect the battery from the load when solar voltage under load is greater than 4.4V, but the load might or might not include 900mA charging current, so the difference between unloaded solar voltage and loaded solar voltage could be quite large. And I don't know how to deal with that.

Have you identified a place to hack into the module to insert the mosfet?

  • I have tried with this charger charging the battery with the USB input while the load was connected and the charge did not terminate.

Was the voltage on the battery 4.2V after charging for a long time?

I'm stumped on how to make load sharing work with solar. But I have a possible solution to the basic problem you have, which is that charging does not terminate. If you desolder the TEMP pin (pin 1) on the CN3065 chip from ground, and instead connect it to an Arduino GPIO pin, then connect the positive battery terminal to an analog read pin of the Arduino, you could program an algorithm which would begin counting once the battery voltage reaches, say, 4.15V. Then after accumulating perhaps two hours above that level you would raise the TEMP pin high, which will suspend charging. Then you would leave it high until battery voltage falls to 4.1V. You would have to experiment a bit to find voltage points and timer value that work best.

You would not need any diodes or mosfets, and solar would never directly power the load. But the system would behave as it would now if the load current was low enough to permit termination. It will cycle between 4.2V and 4.1V while the sun is shining, and discharge further when it is not. But there will be a time limit on how long it will charge after reaching approximately the terminal voltage.

And of course we haven't considered what you might do to reduce the load current, at least part of the time, such as going into sleep mode, which might be enough to allow termination to take place.

garabetov:
as I stated in my first post the Arduino is the load demanding 50mA with a 16x2 LCD, and the charger as also stated in my last post doesn't terminate charging when under constant load.

Have you measured the PV current and voltage when this is occuring?
Have you measured the current at your battery when this is occuring?
If you have a 50mA load, the current from the battery will be higher than 50mA.

What makes you think you have extra current from the PV available in normal conditions under load?
Tom... :slight_smile:

ShermanP:
I'm stumped on how to make load sharing work with solar. But I have a possible solution to the basic problem you have, which is that charging does not terminate. If you desolder the TEMP pin (pin 1) on the CN3065 chip from ground, and instead connect it to an Arduino GPIO pin, then connect the positive battery terminal to an analog read pin of the Arduino, you could program an algorithm which would begin counting once the battery voltage reaches, say, 4.15V. Then after accumulating perhaps two hours above that level you would raise the TEMP pin high, which will suspend charging. Then you would leave it high until battery voltage falls to 4.1V. You would have to experiment a bit to find voltage points and timer value that work best.

You would not need any diodes or mosfets, and solar would never directly power the load. But the system would behave as it would now if the load current was low enough to permit termination. It will cycle between 4.2V and 4.1V while the sun is shining, and discharge further when it is not. But there will be a time limit on how long it will charge after reaching approximately the terminal voltage.

And of course we haven't considered what you might do to reduce the load current, at least part of the time, such as going into sleep mode, which might be enough to allow termination to take place.

Hi, after some experiments I have come up with this circuit:


The following voltages were measured with my DMM, when the logic level p-mosfet (AP4435GJ) was turned off, so that the charger module ( and the battery ) were disconnected from the load and only the solar panel was providing power to the load. Till this moment I still haven't made the voltage reader from the Arduino's analog pin to monitor the panel voltage and decide whether to turn ON or OFF the mosfet through the digital pin.

  • Is it absolutely necessary to connect the DRAIN of the mosfet to the charger output, instead of SOURCE? As I have understood when the mosfet is off the body diode will prevent current going back to the charger from SOURCE TO DRAIN ? I have checked the schematic of the charger module and I didn't see any diode implemented to block that current, but the battery is firstly connected through the battery protection IC then to the voltage booster. Will this cause problems if I leave the SOURCE connected to the charger? When I tried to wire it the opposite way - DRAIN to charger, SOURCE to load the mosfet didn't respond to whether the gate was HIGH or LOW, it seemed it was always ON - letting the charger to be connected to the load no matter if the VGS was -4.5V for turning it ON or 0V for turning it OFF. When it was connected SOURCE to charger it worked as it should. I also tried with another unit from the same type mosfet and got the same results.
  • I cannot understand how the LI-Ion charging stops. So I have made a test to see at what voltage the charger's charging LED turns OFF. Below 4.2V at SOLAR IN the charging stops, when the mosfet is OFF and the measured current at SOLAR IN was 0, but as soon as the mosfet turns ON, the voltage of the solar panel tend to rise above 4.2V and the charger's LED turns ON with measured current at SOLAR IN 30mA for that test. Is this charging process turns on when there is a voltage greater than the battery voltage (at the moment) or there is an input current threshold that needs to be satisfied in order to charge? Here is the datasheet. I am asking this as my concern is that if I turn ON the mosfet to allow battery supply at Vsolar < 4.1V ( when there is clouds or not enough current is produced from the panel to supply the load) the voltage of the panel rises and the charging starts which will charge and in the same time discharge the battery ( not sure if there is going to be issue if the charging current is less than the current drawn from the battery, as no overcharging could occur)

Is it absolutely necessary to connect the DRAIN of the mosfet to the charger output, instead of SOURCE

Yes, if it is to be used as a high side switch.

There are many problems with that circuit, and I think you are just wasting your time. The CN3065 (still mislabeled on your diagram) is specified to operate ONLY for Vin in the range of 4.4 to 6.0V. Boost converters generally don't work well or at all with small solar panels.

There a far fewer problems with simply charging an NiMH or lead acid battery, directly from a solar panel through a blocking diode.

jremington:
Yes, if it is to be used as a high side switch.

There are many problems with that circuit, and I think you are just wasting your time. The CN3065 (still mislabeled on your diagram) is specified to operate ONLY for Vin in the range of 4.4 to 6.0V. Boost converters generally don't work well or at all with small solar panels.

There a far fewer problems with simply charging an NiMH or lead acid battery, directly from a solar panel through a blocking diode.

How boost converters don't work with solar panels? I did many tests and it worked as you can see with the direct sunlight at noon I was getting 4.98 volts from the boost converter. And I am not asking for lead-acid or NiMH solution. Right now my question was simply about the operation of the mosfet and if someone could explain me whether the charging terminates at voltage lower than the battery voltage ( e.g Vbat = 3.9V, voltage at SOLAR IN < 3.9 charging stops) or at some input current threshold.

I explained about the operation of the MOSFET.

The CN3065 charger DOES NOT WORK AT ALL if Vin < 4.4V.

Concerning the mosfet orientation, the way you have it is the normal orientation if you are using the mosfet to switch off current flowing from the module to the load. The body diode is forward biased from gate to source, so current flowing in the opposite direction would be blocked, and when the main mosfet is also off, all current would be blocked.

But the problem is that current CAN flow through the body diode in the other direction even if the mosfet is off. I don't know if that's happening in your circuit. Even if the solar voltage is too low to charge the battery, the battery itself would still power the boost converter on the module, so you would still expect the output would be at 5V. And even if the body diode would let current flow back into the module, there would still have to be a diode voltage drop before any current would flow. If it's 5V on both sides, there would be no flow.

For testing purposes, you could add another mosfet in the same place, with the opposite orientation, and with both gates tied together. That would give you a complete cutoff when the mosfets are off.

As for the overall circuit, I finally understand what you are trying to do, but am not sure how you would decide when to turn the mosfet on. It seems to me that you want to turn off the mosfet and use the upper path going through the extra boost converter as long as that path can provide 5V to the load. But since both outputs should be 5V most of the time, I don't think that's a good place to measure. Maybe compare battery voltage to solar voltage.

Also, I don't think you can just connect the two ultimate outputs together.

Attached is the circuit I found for the DFR0559, in case it may be useful.

DFR0559 (V1.1) Schematic.pdf (614 KB)

Also, with respect to charging termination, it occurs at the end of the constant voltage mode when charging current drops below 10% of the constant current charge rate. It's only when the current needed at the input of the module's boost converter is greater than that level that you even need to worry about load sharing. And actually, the load current only needs to go below that level long enough for the CN3065 to terminate charging because once it does that it won't resume charging until the battery voltage drops below 4.1V.

So it might be more useful to get your load current requirements down, or perhaps introduce some sleep periods, instead of messing with the circuit.

HI,
OPs circuit, you would be best to post in as an export in jpg rather than pdf.


Using the appropriate MOSFET symbols will help, your MOSFETs have protection diodes in them, and may have an effect on your power switching operations,

Tom... :slight_smile:

Hi,
Internal Diodes added;


Tom.. :slight_smile: