Tuesday, April 4, 2017

Even Geekier

If you thought the last post was rather geeky, this one may be through the roof. I guess this must also mean that I was really bored today. I had been using RRD (Round Robin Database) written by Tobias Oetiker for a couple of decades for network monitoring using his freely available MRTG (Multi Router Traffic Grapher) package. The RRD seemed like a natural fit for storing and graphing the output from the charge controller but I didn't know how to do it. I've only used the RRD with his application. This is my first attempt to use it for non-network data. It didn't take too long and I'd put it into the "fun" category.

I'm reading data from the charge controller every 30 seconds and every five minutes I write out the values into the RRD. 288 records of the five minute data are stored which should be one day. Every hour, the five minute data is averaged and stored and 168 records are stored which should be one week's worth. 365 daily averages are stored. Since only the summarized data is stored, the database never gets that large. After I get a couple of weeks worth of data I might add an yearly graph.

The table on the page shows the most current data and is updated every minute. "Array Voltage" is what the charge controller is seeing from the solar panels. The "Reference Voltage" is the target battery voltage for the charge controller. At this point that is the temperature compensated absorption voltage. "PWM Duty Cycle" is a measure of how much of the current is actually being used to maintain the battery at the absorption voltage. I still need to add some credits to the bottom of the web page.

Where the array and the battery voltage lines diverge in the graph on the upper left around 1:30pm is where the charge controller switched from bulk to absorption charging. At 3:55pm, I started the rice cooker running on the inverter so it switched back to bulk charge. The power is just the current and the battery voltage multiplied together. So it's sort of the same info. I'm not sure which one I'll keep. 

Raspberry Pi 3 model B
Image is from the Adafruit site
The plan is for the Raspberry Pi to be running continuously straight off of the battery using a DC-DC converter. At least for awhile, I want to log the data.  Even with all of these processes running, the CPU utilization on the Pi is under 3%. I wonder what else I can use it for....

9 comments:

  1. I like the idea of being smart enough to be geeky but the fact is that if I can hit it with a hammer and it breaks, it was too geeky for me to understand.

    ReplyDelete
    Replies
    1. I've seen Ti and Lexan cases for the Raspberry Pi. They may be a little more impact resistant. ;-)

      Delete
  2. Haha, I love Scott's comment! That applies for me too, mostly. 😁

    ReplyDelete
    Replies
    1. Your BMW probably doesn't need a hammer very often. But a large hammer is a frequently used tool with the Ural.

      Delete
  3. I do find it interesting, but have to admit it is over my head. I guess retirement can take the geek out of the work force, mostly, but doesn't take him out of his natural environment. Now, if you'll excuse me, I have to go hang some doors.

    ReplyDelete
    Replies
    1. Sigh. So this must be my natural environment…

      Time for a ride to clear out some cobwebs.

      Delete
  4. It all runs on the Pi. Database, data logging, graphing program and I'm running an Apache web server to serve up the data. Simply connect to the web page with phone, tablet or computer. The Pi is running "headless" i.e. no monitor and all programming is being done through ssh. The whole process is automated with the logging and data presentation running as soon as it's booted up. BTW, the boot process takes a mere 35 sec. I'm running a Linux distribution called Raspian.

    ReplyDelete
  5. oy....I'm a geek and that's beyond me.

    ReplyDelete
    Replies
    1. If you've worked in the public sector, e.g. public university, you look for tools that are free and preferably open source. That doesn't work on the corporate or commercial side as they generally would prefer to use tools that are supported.

      Delete