Electron not charging on VIN/LI+ (Solar power)

Hi,

I’m in the midst of building a solar-powered probe with the Electron and the Sparkfun Sunny Buddy MPPT charger, however I’m having difficulties actually getting the Electron to charge from the Sunny Buddy board (now refered to as SB). As far as I can tell, the sunny buddy uses the same chip as the former Solar Shield for Electron, but it’s difficult to tell how the solar shield actually powers the electron. According to the solar shield schematic (https://github.com/spark/shields/blob/master/electron-shields/solar-shield/pdfs/solar-shield-sch.pdf) , it seems to be powered off the 3V3 port, but that leaves the PMIC (and therefore the GSM module) out of the loop, which can’t be the case - I’m guessing LI+?

I’ve tried hooking up the solar panel to the SB, then from SB to VIN with a battery connected to the Electron, but it’s not powering, nor drawing any current. I’ve tried hooking up a battery directly to the SB, which works, but the Electron still does not power on using VIN pin.

Also, can the solar panel damage the battery by being connected directly to the LI+ pin? Or does it charge it, as it was connected to VIN?

Hopefully somebody can make sense of this, all in all, I’m just trying to power the electron off a 3.5W 6V solar panel (which will be increased to multiple panels later), but I’m failing in getting the Electron to charge off VIN, LI+ and so on.

All the best,
Chris

Hi @claursen,

Good Questions! Definitely don’t directly connect a lithium polymer battery to anything other than a special li-po charging circuit. Those batteries have uh, lets say, explosive chemistries ( https://www.youtube.com/watch?v=coX0SwubG4A ), but are perfectly safe when using the correct equipment.

The Electron likes to draw a lot of current when it’s starting up and charging the battery, and your 3.5W 6v panel is probably only supplying a few hundred mA’s of current at best. Try throwing a bunch of supercaps or something on the supply line before it hits the VIN of the electron to ride out that current spike. That’ll also make it happier when shade rolls over your panel. You might also want your firmware to startup the electron in MANUAL mode with the radio off to save power, and wait until the battery is above say, 30% before getting online, etc, etc.

(Hopefully someone who knows more about EE and solar can chime in and add some wisdom. :slight_smile: )

Thanks,
David

@RWB might have some advice here.

@claursen

The Electron never used the same Linear Technologies chip that the Sunbuddy is based on.

The Sunbuddy has an adjustable Maximum Power Point setting that basically keeps the solar panel from operating below a certain voltage and that setting usually is set to 70% of the solar panels VOC rating and Voc stand for Open Circuit Voltage. The VOC is the voltage that the solar panel provides in good sunlight with no load attached.

The Sunbuddy is not working probably because you do not have the MPPT setting set correctly which is keeping it from charging. If the MPPT setting is set above the voltage of your connected solar panel, then it will not begin charging.

I read that Sparkfun added a potentiometer to the board to make it easy to adjust the MPPT setpoint but they do not show this in the current product images.

Ideally, the Sunbuddy will connect to the LiPo battery, and the battery will power the Electron as normal.

If you use a 5v solar panel, you will have no need for the Sunbuddy since the built-in charging chip can charge at the same rate and you can get the same type of MPPT setting to keep the 5v solar panel from operating below it’s Maximum Power Point which is what I do. I just set the solar input limit to 4.8v, so the solar panel will not operate below this voltage which keeps it in it’s maximum power point range which provides maximum charging current under all conditions.

Can you let us know what type of solar panel your working with?

1 Like

Hi all,

Thank you so much for taking the time to explain how it can be done. I’m going to skip the Sunny Buddy for now, trying to do the same as @RWB - this way, I can control the input voltage limit dynamically without having physical access to the device and I can use the fuel gauge. Currently I have one 3.5W 6V Voltaic solarpanel, however within next week I will upgrade to 3 x 3W 6V panels. I’ve set a 1000 uf capacitor in place on VIN+GND, but due to an especially gray week with overcast, I’ve tested it indoors where it almost charges (the red LED blinks one time a second). Do you recommend a larger capacitor, e.g. a 10F 2.7V? or does the voltage need to be larger? Hopefully, with the three panels It can generate enough current during overcast days to charge the electron just a little bit. Denmark sadly does not have that many hours of sun during winter time.

Currently I’ve employed a adaptive publishing approach, the less power on the battery, the more it sleeps with NETWORK_STANDBY and the less it publishes the SoC. During startup it turns off the cellular modem until a certain battery percentage has been reached.

Again, thank you all for providing much needed feedback and help - looking forward to put it outside and watch the SoC graph going upwards :wink:

@claursen I’m pretty sure you can not use a Cap instead of a battery on the Electron because the PMIC is not designed to manage capacitors but LiIon batteries instead. The fuel gauge would not work correctly either with a Cap.

I have a setup like this with a 3w solar panel for testing:

Here is my latest code for keeping the battery from going to far below 20% which prevents the Electron from completely loosing power and possibly failing. It’s been working for weeks during very cloudy weather and it always comes back online once the battery recharges:

SYSTEM_MODE(SEMI_AUTOMATIC);
//SYSTEM_THREAD(ENABLED);
// This #include statement was automatically added by the Particle IDE.
#include "Ubidots/Ubidots.h"

#define TOKEN "YoruToken"  // Put here your Ubidots TOKEN
#define DATA_SOURCE_NAME "ElectronSleepNew"

SerialLogHandler logHandler(LOG_LEVEL_ALL);  //This serial prints system process via USB incase you need to debug any problems you may be having with the system.

Ubidots ubidots(TOKEN); // A data source with particle name will be created in your Ubidots account


int button = D0;         // Connect a Button to Pin D0 to Wake the Electron when in System Sleep mode. 
int ledPin = D7;         // LED connected to D1
int sleepInterval = 60;  // This is used below for sleep times and is equal to 60 seconds of time. 


void setup() {
 //Serial.begin(115200);
 pinMode(button, INPUT_PULLDOWN);  // Sets pin as input
 pinMode(ledPin, OUTPUT);          // Sets pin as output

 ubidots.setDatasourceName(DATA_SOURCE_NAME); //This name will automatically show up in Ubidots the first time you post data. 
 
 PMIC pmic; //Initalize the PMIC class so you can call the Power Management functions below. 
 pmic.setChargeCurrent(0,0,1,0,0,0); //Set charging current to 1024mA (512 + 512 offset)
 pmic.setInputVoltageLimit(4840);   //Set the lowest input voltage to 4.84 volts. This keeps my 5v solar panel from operating below 4.84 volts.  
}

void loop() {
    
FuelGauge fuel; // Initalize the Fuel Gauge so we can call the fuel gauge functions below. 
 
    
if(fuel.getSoC() > 20) // If the battery SOC is above 20% then we will turn on the modem and then send the sensor data. 
  {
   
   float value1 = fuel.getVCell();
   float value2 = fuel.getSoC();
   
  ubidots.add("Volts", value1);  // Change for your variable name
  ubidots.add("SOC", value2);    

  Cellular.connect();  // This command turns on the Cellular Modem and tells it to connect to the cellular network. 
  
   if (!waitFor(Cellular.ready, 600000)) { //If the cellular modem does not successfuly connect to the cellular network in 10 mins then go back to sleep via the sleep command below. After 5 mins of not successfuly connecting the modem will reset.  
    
    System.sleep(D0, RISING,sleepInterval * 2, SLEEP_NETWORK_STANDBY); //Put the Electron into Sleep Mode for 2 Mins + leave the Modem in Sleep Standby mode so when you wake up the modem is ready to send data vs a full reconnection process.  
    
}  
  
     ubidots.sendAll(); // Send fuel gauge data to your Ubidots account. 

     digitalWrite(ledPin, HIGH);   // Sets the LED on
     delay(250);                   // waits for a second
     digitalWrite(ledPin, LOW);    // Sets the LED off
     delay(250);                   // waits for a second
     digitalWrite(ledPin, HIGH);   // Sets the LED on
     delay(250);                   // waits for a second
     digitalWrite(ledPin, LOW);    // Sets the LED off
  
     System.sleep(D0, RISING,sleepInterval * 2, SLEEP_NETWORK_STANDBY); //Put the Electron into Sleep Mode for 2 Mins + leave the Modem in Sleep Standby mode so when you wake up the modem is ready to send data vs a full reconnection process.  
    
  }
  else //If the battery SOC is below 20% then we will flash the LED 4 times so we know. Then put the device into deep sleep for 1 hour and check SOC again. 
  {
      
  //The 6 lines of code below are needed to turn off the Modem before sleeping if your using SYSTEM_THREAD(ENABLED); with the current 0.6.0 firmware. It's a AT Command problem currently. 
  //Cellular.on();
  //delay(10000);
  //Cellular.command("AT+CPWROFF\r\n");
  //delay(2000);
  //FuelGauge().sleep();
  //delay(2000);
  
  
  digitalWrite(ledPin, HIGH);   // Sets the LED on
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, LOW);    // Sets the LED off
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, HIGH);   // Sets the LED on
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, LOW);    // Sets the LED off
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, HIGH);   // Sets the LED on
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, LOW);    // Sets the LED off
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, HIGH);   // Sets the LED on
  delay(150);                   // Waits for a second
  digitalWrite(ledPin, LOW);    // Sets the LED off
  
  System.sleep(SLEEP_MODE_DEEP, 3600);  //Put the Electron into Deep Sleep for 1 Hour. 
  
  }
}    
    
1 Like

Thank you for showing the code @RWB . Regarding the capacitor, I did like Dave wrote, adding a capacitor on the VIN+GND for dealing with spikes, when charging the LiPo battery.

You wrote: “*… from going to far below 20% which prevents the Electron from completely loosing power and possibly failing. *”. However, is there anything wrong with letting the battery hit 0% if we have a especially grey/overcast week? Shouldn’t it be able to start charging and if programmed, start the cellular modem when it’s hit around 15-20% SoC, deep-sleeping until that point?

Really appreciating learning solar!

All the best,
Chris

That makes sense and is perfectly fine.

People have had issues with letting the Electron drain to 0% SOC where the Electron fails for some reason and is no longer functional for good, and we have no solid reason why it happens. So leaving 10-20% in the battery allows you to get through mutiple days of inclement weather without the battery draining to 0% while waiting for the next sunny day.

If you set the SOC cutoff to low, the Electron has more of a chance of hitting 0% and causing a unrecoverable failure. 20% has gotten me through 5 days of dark cloudy winter weather in deep sleep mode waking up every hour to check SOC.