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.
Thanks,
Chip