Particle Electron Charging troubles

Greetings! I have a Electron where I completely discharged the battery, and thereby “destroying” it. So I replaced the battery with another 1s LiPo 3,7V at 3200mAh which seems to work fine except with charging. I’ve tried numerous of >10W power sources with both Vin and USB, and its only my Macbook that is able to give the battery a net surplus and charging the battery. With all other power sources the electron only draw about ~150mAh, resulting in a net discharge of the battery. The red charging LED however lights up in both cases.

I have a multimeter connected to the battery so that I can monitor the current with my Mac providing a small charge.

Also, when I monitor fuel.getVCell() and fuel.getSoC(), I only get the values 5.00 and 256.00. When measuring the battery with my other multimeter however, the voltage is at 3.77 volts.

Is the charging circuit broken, or does the larger capacity battery create problems?

Thank you!

Try adding this code in your Setup() and see if it makes any difference.

PMIC pmic;
 //set charging current to 1024mA (512 + 512 offset)
 pmic.setChargeCurrent(0,0,1,0,0,0); 

Also, make sure the battery connector is pushed into battery connector jack good cause it can cause slow charging.

Thank you, but there was no difference after running this script. Still only charging from the Mac, like it needs to be a real USB port connected, not only USB power. However it can charge from a USB power source (at ~400mAh), but only when the Electron is powered down (doubletap mode).

Serial logging also still returns the same.

Using that code the max charging rate I see is about 400mA when the Electron is running.

I have noticed the charging slower if the usb voltage is low.

Try these lines of code and see if it helps.

PMIC pmic;
 //set charging current to 1024mA (512 + 512 offset)
 pmic.setChargeCurrent(0,0,1,0,0,0); 
 pmic.setInputVoltageLimit(4840);

Thanks again, but still only charging from the mac. I also tried to log some more values from the pmic but the result is pretty strange.

fuel.getVCell() 5.00
fuel.getSoC() 256.00
pmic.getSystemStatus() 255
pmic.getFault() 255
pmic.getInputCurrentLimit() 1
pmic.getInputVoltageLimit() 1
pmic.getChargeCurrent() 255

All values seems strange, am I doing anything incorrect? I log them like this:

Serial.print( "pmic.getChargeCurrent() " );
Serial.println( pmic.getChargeCurrent() );

Strange. @bdub or @ScruffR maybe able to help with this.

You’d need to look into the implementation of these functions :wink:

e.g.

byte PMIC::getInputVoltageLimit(void) {

    //TODO
    return 1;

}

They are not all there yet but onpen ToDos :sunglasses:

Or don’t return that kind of value that you’d expect from the name

/*
//-----------------------------------------------------------------------------
// Charge current control register
//-----------------------------------------------------------------------------

REG02
BIT
7: ICHG[5] 2048mA   | offset is 512mA
6: ICHG[4] 1024mA   | Range: 512 to 4544mA (BQ24195)
5: ICHG[3] 512mA    | Range: 512 to 2496mA (BQ24195L)
4: ICHG[2] 256mA    | Default: 2048mA (011000) = 512mA+1024mA+512mA
3: ICHG[1] 128mA    | enabling bits 2 to 7 adds the current to 512mA base value
2: ICHG[0] 64mA     |
1: Reserved (should always be 0)
0: FORCE_20PCT (fill this description)
*/

/*******************************************************************************
 * Function Name  : getChargeCurrent
 * Description    : It currently just returns the contents of the register
 * Input          :
 * Return         :
 *******************************************************************************/
//TO DO: Return more meaningful value
byte PMIC::getChargeCurrent(void) {

    return readRegister(CHARGE_CURRENT_CONTROL_REGISTER);
}

Still, the two FuelGauge values at the top should return real values?

Also the Electron draws ~330mAh from the battery when powered down (doubletap mode). That’s only with the battery connected, and all LEDs off.

Drawing 330ma when off and not charging is not right. You may have a bad unit.

Seems so :frowning:

PS. I just got in a new Electron today and uploaded the same exact App. The results are completely different, and normal. Its like the pmic on the old one is broken. Unless there is some way to reset it.

fuel.getVCell() 3.97
pmic.getSoC() 75.86
pmic.getSystemStatus() 108
pmic.getFault() 0
pmic.getInputCurrentLimit() 1
pmic.getInputVoltageLimit() 1
pmic.getChargeCurrent() 0
1 Like