Electron PMIC Settings Question

I have two ways I power my Electron, with a 5v/2A DC power supply and with a 6V / 3W Solar panel. I would like to have a Particle.function that allows me to select the mode of power at installation and without flashing the device.

Here is the function I call to set the two modes:

void PMICreset() {
  power.begin();                                            // Settings for Solar powered power management
  if (solarPowered) {
    power.setInputVoltageLimit(4840);                       // Set the lowest input voltage to 4.84 volts best setting for 6V solar panels
    power.setInputCurrentLimit(900);                        // default is 900mA
    power.setChargeCurrent(0,0,1,0,0,0);                    // default is 512mA matches my 3W panel
    power.setChargeVoltage(4112);                           // default is 4.112V termination voltage
  else  {
    power.setInputVoltageLimit(4208);                       // This is the default value for the Electron
    power.setInputCurrentLimit(1500);                        // default is 900mA
    power.setChargeCurrent(0,1,1,0,0,0);                    // default is 2048mA (011000) = 512mA+1024mA+512mA)
    power.setChargeVoltage(4112);                           // default is 4.112V termination voltage

The Solar side of this works and the non-Solar side is simply meant to put the values back to the default as defined here.

However, when I run this, my non-Solar Electrons stop charging unless I switch them to a 6V power supply.

What am I doing wrong? These Electrons charged without issue before. I know this is an advanced topic but any help would be appreciated.



So they will not charge unless you feed them 6v, anything under 6v and the PMIC will not charge the battery?

Also, I can’t remember exactly, but what does power.disableDPDM(); actually do?

Right, which made me think it was an issue with the set charge threshold. But, changing that value did not seem to help.

The DPDM is, I believe, they way that a device can communicate with a USB connected power source to determine the appropriate charge rate. This is not important to my uses as I don’t ever charge / power the Electron with the USB connector.

Any ideas? It seems that once this function is run, the Electron is changed and even if you reset the device and reflash the system firmware, these settings persist.

Thanks, Chip

At this point, I have no helpful advice other than remembering that when you originally disabled DPDM didn’t it do this exact same thing and prevented charging in some fashion?

I can’t remember where we talked about this but I did look up the PMIC commands that allowed you to reverse it.

Looking at your function to do this I don’t really see any benefit to even messing with this since all that’s changing is the voltage at which the PMIC starts dropping the charging current to keep the input voltage from dropping below 4.2v. Why not just leave it at 4.8v / 1.5 amps for both sources?

That would work for both sources charging sources just fine and should eliminate the issue you just caused somehow.


Thanks for taking a look. I would like nothing better at this point than to find a solution that works and leave it alone. The reason I built this function is because the settings that worked for Solar were not working for the 5v/2A charger. I thought it might require me to go back to the defaults and, thus, the function you see. These settings do work for Solar but I think because the solar panel often times creates higher voltages.

I could switch out all my chargers with 5V models but that is painful. Also, since it is winter here, there could be some factor from the cold such as the DC power supply sagging under load. At this point, I will keep playing with it and if I find a combination that works, I will share it with everyone.

Given how important power is for outdoor applications (Electron’s sweet spot) it would be great if there was better documentation. Everywhere else in the Particle reference, there are examples of how to properly use the functions - but not for PMIC.

Thanks, Chip

The only reason the solar settings shouldn’t work for the DC charger is if the AC charger was outputting a voltage below 4.8v, and if that’s the case then I would just use a different charger that with a higher output voltage.

The chargers usually need some gap between the charging voltage and the input voltage anyways.

Take one of the AC to DC chargers your using and plug it in outside and test the output voltage once it’s cold and see what it’s providing with and without a load on it. This way you would at least know what you’re dealing with.

If you’re seeing less than the 4.2v which is what you’re trying to limit your AC / DC charger from providing then that does not seem right from a 5v rated power supply. Maybe some blocking input diodes are causing voltage drops?


OK, I was able to do some cold testing today. With the adapter at 30 degrees, the voltage at Vin dropped to 4.74V which is not low enough to explain why the device is not charging.

Still need to figure this out but, like my sensors, I am out in the cold on this one.

Thanks, Chip