Friday 21 August 2015

Raspberry Poo

Re-format the micro SD card.

Copy Raspbian to it.

Boot in RPi and set up.

Uninstall loads of unwanted stuff, and prepare to make it a read only FS.
https://hallard.me/raspberry-pi-read-only/

Set up WiFi static connection.
http://omarriott.com/aux/raspberry-pi-wifi/

Install required stuff (after finding out what it is again).
http://hertaville.com/interfacing-an-i2c-gpio-expander-mcp23017-to-the-raspberry-pi-using-c.html
plus installing libi2c-dev

Get VisualGDB connecting and building to the RPi again.
(different version of Raspbian so need to resync libs and include files)


Call it a good days work, reboot the RPi before shutting it down to backup the SD card.

Kernal panic... unhandled exception in interrupt handler... can't boot it at all...

Yet another trashed FS, this time it didn't even take a power cut, just a reboot.

<sigh>


That micro SD card has now been stabbed and thrown in the bin. Faulty card? Poor micro SD to SD card adapter? RPs just don't like micro SD cards?


Time to investigate which Arduino has 16 analog inputs, one PWM output (they all have) and another 11 digital outputs.

For now I've dug out an old 4GB proper SD card, see if that will work for more than 48 hours.

Monday 10 August 2015

10th August 2015 Update - Software, micro controllers, solar panel incidence angles.

Been a while but I'm back working on this now.

Didn't have enough time to dedicate to this so I'm now working a 4 day week at my main job and working on this on day 5.

What's happened since my last post?


Software

Finished for now! Ready for soak testing. Incorporates a full status screen and diagnostic screen when run from a terminal. Still Todo: LCD screen status + LCD screen button control.


Raspberry Pi

Every time I have a power cut the filesystem on the RPi gets corrupted and I have to flash the SD card back to the stock image. Looking into using a read-only file system with /tmp and /var on a ramdisk - I was intending to have my software keep a log of past data but this can't happen with a read only filesystem. I could put the log on a USB stick, or create a remote log server (that could additionally host a web page, etc). Another alternative is to give up with the RPi and use an Arduino.


Power Sensing

I designed and built a little PCB that used a couple of 100A current clamps that read the power being used and produced a simple DC voltage that indicated how much "spare" power there was which would be fed into the RPi.

Designed and tested the circuit using the LT Spice software, worked great in that. Unfortunately I forgot that the current waveform isn't a nice sine wave and is as ugly as heck, which means that the premise that I used to design the circuit was wrong and it doesn't work at all.

So plan B is to use a current sensor and an AC to AC power brick transformer and an Arduino to calculate the power accurately and feed the "spare power" DC signal to the RPi.


Other thoughts

Looking at the data from the Wattson meter I'm wondering just how much charge the battery will get in a normal day. During the day when no one is in, there is approximately 500W load, white goods, fish pond pump (on a timer), Dell server PC (being tweaked to hopefully draw less power), all the little things on standby, etc.

And during a typical overcast day the solar panels generate between 200W > 700W. If I get 250W spare power it'll take 16 hours to charge the 4KWh battery.

So my guess is it'll get 50% charge on a typical overcast day, 100% on a nice sunny day, and 0% on a horrible rainy day.

Leading on from this I've been looking at making brackets + small motors + a simple driver driven from an annual timer for the solar panels (on a panel by panel basis) that can tilt the panels side to side to optimise their angle to the sun. This will create a small shaded area on each panel (apart from the leading edge), but I think the generation falloff caused by the angular error will be greater than 0% to maybe 10% shaded area.

Will probably buy a couple of small solar panels of the same technology that my main installation uses and implement the brackets (manually controlled) on these and take some measurements to see if it'll be worth doing it on the main panels.