The red light goes out even though the Electron is still plugged into the usb port

The red light goes out even though the Electron is still plugged into the usb port. It will be on for some time but then will go out. I have the battery plugged in. I have never had an issue before with the charger or the cable so I don’t think that is causing the problem.

How do you know the battery is “still charging”? The red light going out should indicate that it isn’t still charging.

2 Likes

I left it plugged in all light and when I woke up the Electron was off so that means it is not receiving power. I was using a 2 amp usb charger. When I said charging I meant plugged into the usb port.

When I removed the battery the led blinked red and the electron worked but when I plug in the battery it does not charge. I have switched out the power supply and switched out the usb cable twice and I am still having this problem.

Can you flash a simple program to check the fuel gauge? Here are the docs on the FuelGauge on the Electron. Let’s see what voltage and state of charge the Electron thinks the battery is at.

I ran the code but it gave me this error

// EXAMPLE
FuelGauge fuel;
Serial.println( fuel.getVCell() );

fuelgauge.cpp:3:1: error: 'Serial' does not name a type
 ^
make[1]: *** [../build/target/user/platform-10fuelgauge.o] Error 1
make: *** [user] Error 2

I guess you have got this functional call outside of any function.

1 Like

So what should I do?

Put it inside a function.

1 Like

So how do I do that?

https://cdn.meme.am/instances/55553362.jpg

FuelGauge fuel;

// Serial.println( fuel.getVCell()); // <-- NOT here

void setup()
{
  Serial.begin(115200);
}

void loop()    // this is a function
{
  // and here is INSIDE of the function
  Serial.println(fuel.getVCell());  // but here!!
  delay(1000);
}

Thank you!

I got 4.03 when I ran this code and for Serial.println( fuel.getSoC() ); I got 92.60

    FuelGauge fuel;

// Serial.println( fuel.getVCell()); // <-- NOT here

void setup()
{
  Serial.begin(115200);
}

void loop()    // this is a function
{
  // and here is INSIDE of the function
  Serial.println(fuel.getVCell());  // but here!!
  delay(1000);
}

So are those number good or and they a tell tail sign of something wrong?

It simply means that the battery is 92.6% full. Or in plain words, charged.

What about 4.03?

So when it is done charging the light turns off?

It means 4.03Volts.

Yes the led turns off after charging is completed. Reading the documentation might be good https://docs.particle.io/datasheets/electron-datasheet/#led-status :slight_smile:

2 Likes

Thanks!