Powering Electron via Solar power

Hi there,

Is there a reason the Solar shield is no longer available for purchase? Is it simply not necessary if you want to deploy the Electron powered by battery and solar panel charging it?

EDIT: Wanted to add a few more questions:

  1. Voltaic’s panels seem to be fairly popular, but I can’t help but notice they are also much more expensive per Watt. Is there a reason for that? Comparing with e.g. 100W panels that can be found on Amazon for about $130.

  2. Does anyone have any example projects for running an Electron 24/7/365 in an outdoor environment? Are there any reasons this would not be possible?

Thanks!
Or

4 Likes

The Electron can be charged using one of the Voltaic 6v solar panels without the need for the solar shield.

I’ve been running an Electron off the 2000mAh battery + a 6v - 3w solar panel for many months now with custom code to optimize the setup.

I use code to put the Electron to sleep when the battery hits 20% Soc to keep it from draining empty and possibly damaging the Electron.

I also use code to prevent the solar panel from operating below 4.8v which keeps the solar panel from working too far below its maximum power point. It’s a crude form of MPPT solar tracking and it works great.

Here is my current custom code if your interested in using any of it.

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

#define TOKEN "123456"  // 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. 

ApplicationWatchdog wd(660000, System.reset); //This Watchdog code will reset the processor if the dog is not kicked every 11 mins which gives time for 2 modem reset's. 

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. 
  
  }
}    

The reason the price for the Voltaic solar panels are so expensive is because they are non glass and rugged. Supply and demand. They are the best solution for charging the Electron directly in my opinion. You can use smaller 3-20w glass panels for the lower price but the Voc voltage of that solar panel needs to be below 12v ideally.

13 Likes

This is great! Thank you so much.

I think I’m going to proceed by buying an Electron and getting a Voltaic panel.
I’ve noticed some setups use the usual 2Ah LiPo but also use one of the Voltaics battery packs. So they connect the panel to the Voltaic battery and then the Voltaic battery is used to power the Electron and charge the LiPo.

Is there a specific reason for that?

Thanks again!

They probably use the Voltaic battery pack because it has a larger lipo battery in it and they don’t know how to optimize the Electron to work directly with the Voltaic solar panels.

Skip the Voltaic battery pack and start with the standard 2000mAh battery that comes with the Electron. If you need a bigger battery then you can just add a bigger LiPo to the Electron.

Here is my Electron reporting back from outside it’s battery status over the course of a week +. It goes into sleep mode if the battery hits 20% and comes back alive once the solar panel charges the battery back over 20%.

What are you looking to do with the Electron?

Thanks, that sounds reasonable. I will forego the VS battery.

I couldn’t tell from the picture you posted in your first post whether that is a Voltaic Systems panel or was it something else?

The project is to track the number of people passing through different points in a bike trail. Up until now I’ve spent most of my time building a platform based on the Arduino, detecting motion using a PIR sensor and saving the events to an SD card. My next step was to examine reporting metrics once a day via cell service (so the units can report from the field without operator intervention). Wish I’d known about the Electron earlier (-:

One thing that might be detrimental to this project is that I need to be running the sensor (PIR or possibly something else) constantly in order to detect passer bys. So supposedly the unit will have to be constantly running (rather then periodically waking up from sleep to do its thing).

1 Like

Just wanted to update that I ordered an Electron as well as the 6W VS panel (along with a few other accessories/adapters, etc).

Thank you for all the advice!

The 3w solar panel in the picture was something custom and not quite the same as the Voltaic panels.

With the PIR sensor, you can let the Electron Sleep and only wake when the PIR sensor is triggered. This will keep from needing the Electron to be ON 24/7.

I recently tested some Panasonic ultra-low power PIR sensors, and they ended up being way to sensitive to be reliable. Ideally, you need some of the PIR sensors that have sensitivity adjustments on them, so they do not trigger all the time. Or maybe some sort of Laser Trip Wire sensor?

Ubidots is an excellent free online platform to push this data to so you can have a nice dashboard for all the data you generate. You can even paste the dashboard to webpages to share with others if you desire. www.Ubidots.com

With a little work you should have your bike trail detection system up and running better than you ever expected probably :smiley:

2 Likes

Why do you @RWB call this function in your example code?
pmic.setChargeCurrent(0,0,1,0,0,0);

If I understand correctly, it is meant to limit the charging capabilities of the solar panel unless the current from it is 1024 ma. Am I correct? If that is the case, than I would definitely like the Electron to start charging even when the current is like 60-80 ma. It’s winter where I live, and we don’t see the sun that often, so the perfect conditions might never happen, but the solar panel should be able to produce “some” power, and I would definitely like to harness it.

Am I right, or missing something. Sorry for reviving such an old topic, but I think many people use your code above, and there is not enough info in the documentation to understand PMIC calls from that source.

P.S. After reading your code once more, and than my own response: Maybe the function does’t change the lower limit but some maximum limit? Please clarify.

Thanks a ton!

It sets the charging current to 1 amp max, this essential raises the charging current from the default charging current which is around 100mA I think, but don’t quote me on that one.

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

Oh - so it changes the maximum level from 100 mA to 1024 mA. Now I get it.

Could you please also clarify why do you make the 4,84 V limit?

I understand that the MPP makes the solar panel less effective in lower voltage range, but it still should be able to produce some energy, and this “some” energy might be enough for the Electron in Deep Sleep (or even deep sleep with “network standby”)- so why limit that?

If the VIN accepts Voltage from 3.9 and the Electron in Deep Sleep needs “unmeasurable” current - maybe that would be enough?

It’s understandable that it would be not enough to CHARGE the battery, but for the operation during sleep time? We would conserve some battery life (minus the natural battery discharge).

Are the statements above correct, or am I missing something?

Correct.

Because I use 6v solar panels and limiting the solar panel from operating below 4.84v keeps the voltage of the solar panel from dropping out and keeps it producing as much current as possible when the sunlight levels are low. This basically will get more power from the solar panel when the Electron is needing more power than the solar panel can supply. It keeps the solar panel operating closer to its peak output voltage (Vmp) which is where the solar panel will produce the most current. It’s a cheap form of Maximum Power Point Tracking.

Wrong, it makes the solar panel more effective and it produces more charging current.

The PMIC needs at least 4.2v to charge the LiPo to full so limiting the input current to 4.8v gets more power from the solar panel and keeps the input voltage high enough to bring the battery up to full charge voltage of 4.2v.

l charge the battery quicker and better than what your suggesting because it will maxamize the power / current output of the solar panel.

I just think you don’t understand fully how solar panels work and how their voltage and current levels fluxuate based on if they are under or overloaded. They are unique power sources.

5 Likes

Hi,

Will the code that manage the solar charging:

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); //S

also work if i put the Electron in:

System.sleep(SLEEP_MODE_SOFTPOWEROFF,SLEEP_MODE_SOFTPOWEROFF_SECONDS);

mode.

?

Yes as long as its charging before going into sleep mode.

Thanks

In my setup (deep sleep mode and large solar panel) i can easily overcharge the battery. Is there a setting that i can add to protect the battery from this or is it already been done ?

The PMIC regulates charging so no need to worry about over charging.

Thanks again.

Which solar panel are you using in the image you posted above (on 3/17)? I don’t see any panels that look like that on Voltaic’s site.

It’s a special 3w panel I had made for some other projects a few years ago.

The Voltaic panels are better suited for outdoor use so I would go with those for best long-term reliability.

Thanks for the info. Do you have any problems with your method of keeping the solar panel from supplying the charger if its voltage drops below 4.8? I would think that as soon as the panel is no longer supplying any current, that its voltage would go back up above your cutoff, causing the pmic to once again allow the panel to try to start charging. Do you see any evidence of this?