Close

Moar Power

A project log for Off-Grid Solar Internet

Is it really off-grid if it has the Internet?

dan-maloneyDan Maloney 05/27/2019 at 19:020 Comments

In order to size the solar array needed to run this thing, I have to know how much power it draws. Should be simple - put an ammeter in line with the POE connection and see how much current it draws. Right?

Maybe not. Maybe the router pulls a lot of power intermittently, like when it's first making a connection to the LTE tower. Or maybe it changes over time for other reasons. I'd rather see the average over time, and to do that I need to capture data over long periods. But that's not something I'm set up to do.

I thought maybe I could use my oscilloscope as a sort of trace recorder and look at voltage drop across a shunt resistor. But then I thought, "I've got a bin full of Arduinos. Surely there must be something that can capture current readings in real time." And there is - the INA219 Current Sensor Breakout. Picked one up off Amazon for a couple of bucks, wired it up to a Nano, and came up with this janky test setup:

The Nano and the INA219 are in the middle, just in front of the 12V power supply. I'm sending 12V up the Cat5 cable using a cheap POE injector. That required a little modification of the router - had to cut the power conductors (pins 4 and 5 and pins 7 and 8) off the RJ45 and jump them over to the coax connector for 9-24V power. I wanted to put a right-angle coax plug on, but there's not enough room inside the enclosure. So, I soldered right to the coax jack.

This of course means I can't use the 48V POE wall wart that came with the router, because 48V might damage the lower voltage connection. I need to put that thing away and make sure it never gets used again.

Back to testing. I modified the example program for the INA219 board and uploaded it to the Nano.

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;


void setup(void) 
{
  Serial.println("Start PuTTY - 30 seconds...");
  delay(30000);
  Serial.begin(115200);
  while (!Serial) {
      // will pause Zero, Leonardo, etc until serial console opens
      delay(1);
  }

  uint32_t currentFrequency;
    
  // Initialize the INA219.
  // By default the initialization will use the largest range (32V, 2A).  However
  // you can call a setCalibration function to change this range (see comments).
  ina219.begin();
  // To use a slightly lower 32V, 1A range (higher precision on amps):
  //ina219.setCalibration_32V_1A();
  // Or to use a lower 16V, 400mA range (higher precision on volts and amps):
  ina219.setCalibration_16V_400mA();

  Serial.println("Bus Voltage (V),Shunt Voltage (mV),Load Voltage (mV),Current (mA),Power (mW)");
  //Serial.println("-------------------------------------------------------------------------------------");
}

void loop(void) 
{
  float shuntvoltage = 0;
  float busvoltage = 0;
  float current_mA = 0;
  float loadvoltage = 0;
  float power_mW = 0;

  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);


  
  Serial.print(busvoltage);Serial.print(",");
  Serial.print(shuntvoltage);Serial.print(",");
  Serial.print(loadvoltage);Serial.print(",");
  Serial.print(current_mA);Serial.print(",");
  Serial.println(power_mW);
  

  delay(2000);
}

It creates a CSV output that will be easy to import to Excel or something for charting. I used PuTTY to monitor the serial output and log it to a file. Been running for about an hour and the overall trend is somewhere around 1.8 to 2.4 watts(ended up averaging to 2.2 watts over a four-hour test), with occasional excursions past 5 watts. None of those spikes seem to last more than two seconds, though, so they're probably the radio(s) doing some housekeeping. It'll be interesting to see it it happens regularly or randomly.

I'm using this handy guide to planning an off-grid solar system for my sizing calculations. Not 100% applicable - it's geared to inverter-based systems - but the basics are there.

For now, I'm going to assume the average over a 24 hour period will be something like 2.2 watts, which means I'll use the stated 3 W draw as my design point. That means 72 watts a day, or maybe I'm better off shooting for 100 Wh/day, to give myself a little extra for other things - charging an RV, running a few monitoring dongles, etc. I'm also going to shoot for a full week of autonomy, which will let me have the freedom not to go to the site to recharge the batteries with a generator if we have no sun for a week. I'm also assuming 25% depth of discharge and an average temperature of 70°F, but since I have no idea what the temperature compensation values are for the batteries I'll be using, I'll leave that out for now.

Plugging in my numbers for an average daily of 100 Wh, the battery bank capacity needs to be 2800 Wh. For a 12 V battery bank that's 233 Ah, or 116 Ah for 24 V. I could cut that in half by setting the discharge limit to 50%, and for cheap Walmart batteries that might be acceptable. So figure a pair of Everstart group 29D deep-cycle marine batteries, which are $100 each. They work out to 87.5 Ah each (divide the reserve capacity by 2.4, according to this page), which is, more than the 56 Ah bank needed to support 100 Wh a day at 50% DoD. Yeah, nice Trojan batteries would be better, but this is a quick and dirty system.

As for the array, assuming 100 Wh/day and an average of 4.5 hours of sun per day throughout the year, a 67% efficient array will need to deliver 33 watts. I'll bump that up to 50 watts to build in a little reserve. So since I need to charge a 24 volt bank, that's two 25-watt panels in series. Something like these should do the trick. Or these - a little smaller, but better connections.

Finally, a charge controller. The short-circuit current on those panels is only 1.5 amps, so a 10 amp controller is more than enough. Nothing fancy, just a PWM controller will be fine. This one is cheap and claims to have Bluetooth control, which could be handy for remote monitoring.

So, $200 for batteries, $100 for panels, and $20 for a charge controller. Add some incidentals and that's most of $400.

Discussions