Dumb Question? Solar Panel Charging - Limit Current or Voltage or Both?

So, I was looking at my code the other day and something about the way we are configuring the Power Configuration API struck me as odd.

First, a little context for those who are new to this topic:

  • Boron LTE, run-in deviceOS@2.2.0
  • 6V / 3.5W Voltaic Solar Panel
  • Panel is connected directly to Vin with a 470uF electrolytic cap

There is a complex relationship which I am not an expert on (leave that to @Rftop ) between the voltage and current that a solar panel can put out in order to deliver “max power” for a given light level. Large solar systems use a dedicated controller to manage this called Maximum Power Point Tracking of MPPT..

The good news is that MPPT is likely overkill for a Boron and you can achieve acceptable results using the by-pass cap (see above) and the right power configuration:

// Power Management function
int setPowerConfig() {
  const int maxCurrentFromPanel = 550;                                // Set for implmentation (550mA for 3.5W Panel, 340 for 2W panel)
  SystemPowerConfiguration conf;
  System.setPowerConfiguration(SystemPowerConfiguration());  // To restore the default configuration
  if (sysStatus.solarPowerMode) {
    conf.powerSourceMaxCurrent(maxCurrentFromPanel) // Set maximum current the power source can provide (applies only when powered through VIN)
        .powerSourceMinVoltage(5080) // Set minimum voltage the power source can provide (applies only when powered through VIN)
        .batteryChargeCurrent(maxCurrentFromPanel) // Set battery charge current
        .batteryChargeVoltage(4208) // Set battery termination voltage
        .feature(SystemPowerFeature::USE_VIN_SETTINGS_WITH_USB_HOST); // For the cases where the device is powered through VIN
                                                                     // but the USB cable is connected to a USB host, this feature flag
                                                                     // enforces the voltage/current limits specified in the configuration
                                                                     // (where by default the device would be thinking that it's powered by the USB Host)
    int res = System.setPowerConfiguration(conf); // returns SYSTEM_ERROR_NONE (0) in case of success
    return res;
  else  {
    conf.powerSourceMaxCurrent(900)                                   // default is 900mA
        .powerSourceMinVoltage(4208)                                  // This is the default value for the Boron
        .batteryChargeCurrent(900)                                    // higher charge current from DC-IN when not solar powered
        .batteryChargeVoltage(4112)                                   // default is 4.112V termination voltage
        .feature(SystemPowerFeature::USE_VIN_SETTINGS_WITH_USB_HOST) ;
    int res = System.setPowerConfiguration(conf); // returns SYSTEM_ERROR_NONE (0) in case of success
    return res;

Notice we limit three things:

  • There is a command to limit charging current
  • There is a limit on the max current from the power supply
  • There is limit on the min power source voltage which has the following effect: It stops charging if the voltage from the pane drops below 5.08V (this allows the voltage to recover and avoids the voltage “crashing”).

Perviously, I had left the current limit at the default 900mA and this has weeks well. But it occurred to me that the 3.5W panel can only supply 550mA so I tried changing the limit. The result is a bit unexpected - the most current the device will accept is not 550mA but only 440mA at 6V. This is surprising as I expected the value to be over 550mA as this is the charging limit and the Boron itself will draw current.

All this raises some questions:

  • With these settings, why won’t the Boron draw the full 550mA when I am supplying it at 6V from a bench top supply?
  • Should I leave the powerSourceMaxCurrent and batteryChargeCurrent values at their default of 900mA? Am I slowing down my charging unnecessarily?
  • Is limiting the powerSourceMinVoltage sufficient?

I plan to do some more testing but wanted to validate my thinking and see if this is already explored territory.



The API chooses the next valid value and uses that to charge - 550mA is not a valid value.

The register table attached should help figure out the valid values. 512mA should work, I’m not sure why 440mA is set as it’s below the minimum.

@no1089 ,

Thank you. That makes sense and I remember some of this now. Still, if the charge current was 512, I would have expected the Boron to draw an amount equal to or greater and that is not the case. I will change this value to 512 and repeat the experiment to eliminate this as a factor.

The second part of the question may require more testing, if I am already limiting the min charge voltage, does the max charge current setting even matter? For example, if too much current was attempted to be drawn, the voltage level from the panel would drop. Once it got to 5.08V, I believe the charge controller would start to back off on the current allowed to keep the voltage dropping further. Am I thinking about this right?



You are correct.
It’s my feelings that batteryChargeCurrent is really only a factor if you’re using a Li-Po size other than the standard’ish 1800-2200 mAh. You’ll want to typically limit charging current to 0.5C, or 1/2 the capacity rating of the Li-Po…so 900 mA is a good default setting for the Li-Po’s that ship w/ Particle devices.

I seem to remember some squirrely test results when using USE_VIN_SETTINGS_WITH_USB_HOST, but all my testing was performed with the USB connector (not Vin).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.