Solar Water heater
WORK IN PROGRESS
some more notes to aid my memory
- not likely of interest to others but -
please email me if you do similar
Background
I am interested in solar electric power.
But I calculated that a photovoltaic system offered to me by a local company would only pay back my investment after 130 years!
And due to regulations you cannot have a home made mains connected system :-(
I built a solar water heater some years ago with old radiators painted black in glass fronted boxes.
It worked well but was hard to keep full. Eventually the wooden frame went rotten.
So I looked into pressurised loop solar tube systems - some kits were £1500, but I found one for £500 from here
It came with 20 tubes, controller, expansion vessel, pumping station - good quality components.
But the company is just an importer and cannot offer technical support - learn the technology elsewhere.
You also need an existing tank, some pipes and fittings, thermal paste and a non return valve after the pump.
Objectives
1) Just out of interest - monitor the solar water heating system tank temperatures and the solar light level and display the results as a graph on a web page and also on a graphical display in the kitchen Sweex router box.
2) For my old system I fitted two hot water tanks in series. The system as delivered works for just one tank.
So build a controller to switch the system between tanks so I can get two tanks of hot water and have enough water (in summer) to provide water for cloudy days.
Method
Build electronics that via an i2c (long line) bus can be controlled by a Sweex router or NSLU2 (Slug) etc.
Circuit notes
1) I want to detect when the as-delivered controller feeds mains voltage to the auxiliary electric water heater and the water pump.
A CMOS gate in a CD4050 detects mains as picked up via the capacitance between two wires of a 15cm length of twin mains cable.
Resistor R is adjusted to get the switching level right. The pulse train created is changed to logic levels to feed an input pin of a PCF8574 8 port i2c chip.
2) A pin of the PCF8574 is set as output to drive a relay to switch mains to a two way water valve that sets which tank receives the hot water from the roof.
3) LM75 i2c thermometers are positioned on the tanks and the solar tube manifold on the roof. These connect to the local SDA/SCL lines above.
4) The master controller detects the tank temperatures with NTC resistor thermometers. I sourced a similar one from Farnell
(B57861S0103F45: SENSOR, MINIATURE< NTC, 10K)
for the bottom of the second (feeder) tank. The relay above connects the appropriate thermometer to the master controller - (not shown).
5) The solar light level is measured using a PV panel within a cheap garden night light unit. The voltage is measured across a load resistor to give some measure of photon power - on no load the volts stay at 3V. It gives about 1 volt across 1Kohm.
Software
i2c drivers for a Slug
/* */ int i2c; int rc; int main(int argc, char *argv[]) /* address is the first number after the program name */ i2c = open("/dev/i2c-0",O_RDWR); /* open the device dev/i2c-0 */ rc=ioctl(i2c,I2C_SLAVE,address); /* set the i2c chip address */ write(i2c,data,1) ; /* send the byte */ byte = data[0]; i2c = close(i2c); |
/* #include <stdio.h> int i2c; int rc; int main(int argc, char** argv) address = atoi(argv[1]); /* decimal address is the first number after the program name */ i2c = open("/dev/i2c-0",O_RDWR); /* open the device dev/i2c-0 */ channel = channel + 64; /* control register - enable the D/A output */
//printf("%d", AD_input); //save AtoD byte to ramdisk i2c = close(i2c); |
solar_display.bas
The Debian Slug monitors the solar heater thermometers using solar_display.bas
It acts to pull together various scripts and other Blassic basic programs.
It does the following in a loop and saves the data every 2 minutes ready for the webpage graphical report
Clear the 4x20LCD03 screen every 2 minutes after a data save.
Run LM75-Deb-slug (72 to 77) to save five LM75 thermometer values to the Slug ramdisk as T72.txt etc
Run the ash script wget_bee_count.sh to grab the byte stored in the file bee_count.dat stored in the Kitchen Sweex website.
- this is normally displayed on the bee activity 128x64 display in the kitchen.
Get the T72.txt values and display them on the Slug LCD03 using print_word.bas
See if the a key on the key pad has been pressed using LCD03_keyboard_get_key_once.bas
(you have to hold the key down till there is a response - The Slug speaks the result using espeak)
Key 1 = (switch solar hot water to feed-tank) | Key 2 = (main tank) | Key # = (close this program)
Run solar-set_tank-read_pump_heater_lightlevel.bas to switch the PCF8574 to switch the relay that connects the tank-bottom NTC thermometers to the main control unit and also turn the motorised water valve that switches the solar hot water to either tank.
The PCF8574 also reads the status of the solar pump and the immersion heater by detecting whether their mains leads are live.
port_5_status.txt holds the solar pump status and
port_6_status.txt holds the immersion heater status. They are numbers like 430 etc in readiness for the web plot - a "square wave" shows the on/off status of pump and heater.
Save comma delimited data every 2 minutes in /var/www/solar_data/datafile where data file is a name like 20091129solar
Also every 2 minutes run make_page.bas to create the graphical page using "Canvas" that is seen from the browser.
Display the data on a web page