Fuelly

Thursday, May 20, 2010

The Story So Far... (part 3)

Having gotten bored of running up the stairs to turn on and off the water heater, I started looking around for a way to do this automatically.

The answer came in the form of a Velleman kit from Maplins called snappily a K8055 USB experiment interface.  It allows a PC to read switches and sensors and then output signals or turn on / off relay switches.  You can get them either pre-made or in kit form and you have to solder it together yourself.  I chose the kit version as it's £10 cheaper.


After putting it all together, it looks something like this...

The inputs are the terminal blocks on the left (two analogue inputs of 0-5V and four inputs for switches).  The kit actually included little press buttons to test it with but I didn't bother installing them.  On the right are the outputs (8 on/off outputs with LEDs and two analogue outputs of either 0-5V or PWM of 0-100%).

The latter could be used to dim a light or even a heater by varying the duty cycle of power to the load and using thyristor to chop the power.

A CD comes with the board that has the Windows DLL that makes it work and an example program in various languages.  I had an old copy of Visual Basic 6 sitting around and it works fine with this.  To make my program to control the heater, I just took the demo program and modified it a bit.

In order to control the heater so that it only used spare solar power and not battery power, I needed to measure several things:

  1. The voltage of the battery bank.
  2. The mode of the charge controllers (whether they are charging or finished).
  3. How much power the system is generating for loads (including the battery bank).
  4. How bright the sunlight is (to estimate how much solar power is available).
Most of this information is available via the Morningstar charge controllers.  They record this information and it can be read as data via their communications port.  The TriStar MPPT-60 additionally has an Ethernet port so it can be networked.  The main computer in the house is upstairs (conveniently near the water heater) but the solar stuff is downstairs on the other side of the house.

I didn't want to run Ethernet cable all over the house so I used a pair of Ethernet over Power plugs.  These just plug into spare power sockets and then carry data over the house wiring.  Very handy.  This then plugs into an old 10Mbit hub as I also have a couple of computers in the living room and an IP CCTV camera outside.


One of the computers is an old Toshiba laptop that I bought at a car boot sale a couple of years ago for £5.  It works and with a new battery bought off the internet, it even runs better than new.  It only has Windows 98 but I managed to find an old Ethernet card for it - would you believe from another pair of laptops I bought at a car boot sale for £5.  Those laptops were a bit broken but work now and the Ethernet card was free.  The Toshiba can't use modern cards as it isn't Cardbus compatible so I had to find an antique card to use in it.


The Toshiba is plugged into the two charge controllers.  The Ethernet of the TriStar and directly into the serial port on the MPPT-15.  The Morningstar data logger software then records the output and battery state from both controllers and saves it in a CSV file on a network file share (on the PC upstairs).

This data file is read by the program I wrote using the K8055 demo software.  I combine the two sets of output figures for charge Amps from the two controllers and then multiply that by the battery voltage to give a figure for total power generated.  The system records these values every 15 seconds so a graph can be drawn (again by the Morningstar logger software) like this:

The load manager program then takes an input from a light sensor to measure how strong the sunlight is.  The power graphs above only tell you how much power was used, not how much was available.


At first I tried using a light dependent resistor to measure the light but it was too sensitive (they are commonly used to measure how dark it is for dusk to dawn lights).

I tried to cut down the light reaching the sensor by putting it inside a sea shell as these are white and nearly opaque so that they cut out most of the light.  I sealed the sensor inside two such shells with waterproof polyfilla.

Unfortunately, after a couple of weeks, the sensor broke and stopped working so I had to come up with another idea...

This time I used an old miniature solar panel from a AA battery charger and put it in a waterproof box.  I connected it to a 100 Ohm resistor as a load so that the USB A/D input would read the voltage produced as a measure of the power produced and so the strength of the sunshine.

Finally, the K8055 program reads the charge state from the charge controllers (MPPT, Absorption, Float, Equalize, or Night) and uses all this information to try and estimate when there is enough solar power available to charge and keep the batteries full while turning on the water heater.

Here you can see all the information about the solar input (sun strength), power produced by both charge controllers combined and the battery status, along with the information that the water heater has been running for a total time of just over two hours today (it was a bit cloudy).

The output of the K8055 interface card drives a miniature 12V mains relay that just fitted inside an extension lead socket so that the heater (via its 230V to 115V transformer) just plugs into the controller.

I installed a digital thermometer on the water tank (cutting though the foam insulation to glue the sensor on the tank itself about 1/3rd the way down from the top).  For every 10 minutes the water heater runs on solar power, it conveniently increases the tank temperature by 1'C.  Some days in May, the heater can run for almost 6 hours, raising the water from 15'C to over 50'C.

No comments:

Post a Comment