Tuesday, June 29, 2010

Solar Controller

I've been working on a simple solar heating controller based on an Arduino open source hardware microcontroller.

The design was inspired by Tristan Lea's unit on his openenergymonitor blog, and it was a project that I had been meaning to get around to doing on return from China.

Trystan's unit used PT1000 sensors and an analogue multiplexer and op amp circuit to scale the sensor readings. I decided to use 10K NTC thermistors because they are cheap and easy to use and accurate enough for this sort of application.


It started with a nice blue LCD from Moderndevice, which comes with a LCD117 PIC based controller kit which makes displaying text as simple as serial.print statements from the Arduino.


It connects via a 3 wire interface, making it easy to have the display some distance away from the Arduino board. There are 3 spare outputs on the PIC for driving LEDS, and one can drive a piezo buzzer. The PIC allows the brightness of the display to be controlled using pwm.

It took about an hour to assemble the kit and get the display to show analogue readings from the Arduino. I also wrote a bit of code to display the time, counting in seconds and displaying leading zeros where required.

The next thing was to interface the analogue input channels to the temperature sensing thermistors. I had some pipe clip thermistors from Rapid Electronics, which will clip directly to 15 or 22mm copper pipe.

Using code on the Arduino forum to linearise the signal from the thermistors, I soon had them displaying in degrees centigrade. The linearisation uses the Hart-Steinhart equation which is simple in C, but previously had been stumping me to try to write it in assembler.


The Arduino will read up to 6 thermistors on its analogue inputs, but I chose to fit 3 and a variable resistor "pot" which allows me to define a set-point.

I'm not quite ready to fit the controller onto my solar panel system, so I thought I'd use it to monitor the various temperatures of my hot water tank. The Arduino outputs its thermistor readings to the display once per second, and also via the serial/USB interface to the laptop. They are generated as a CSV delimited file which can be read in and stored using the likes of Hyperterminal and then manipulated and graphed using Excel. The graph shows temperature of my hot water tank (red) heat up when hot water from the gas boiler (blue) is pumped through the heat exchanger coil.

I've realised for sometime that the Arduino could be much improved with the addition of a dedicated Real Time Clock and data storage using a SDcard interface. I learnt this week that NuElectronics have recently released a new shield combining RTC and SDcard. It also has 6+2 connectors allowing 1-wire or 2-wire sensor devices to be connected to it. More details here:

Similar products combining SDcard and RTC are also available from Lady Ada and Seeeduino Studios.

This new shield will transform the Arduino into a datalogging hub forming the basis of an integrated energy monitoring system - along the lines of Trystan Lea's openenergymonitor. With an ethernet gateway, the real time and logged data could be made available to the net via such services as Pachube.

Here are a few ideas how it could be used:

1. Solar Water Heating Controller - simple control with circulation pump relay
2. Central Heating / woodburner controller - determines best usage of hot water
3. Electricity Monitor - whole house electricity consumption
4. Gas consumption monitor - pulse counter on optical sensor on gas meter
5. pV / battery charge controller/datalogger
6. Gasifier controller
7. CHP controller - engine start/stop, rpm, voltage monitor etc
8. Battery management system for wind or solar pV.
9. General purpose sensing, datalogging and control tasks
10. Temperature, climate and weather monitoring and datalogging.

What is needed now are some standardised communication protocols to allow Arduino based hardware modules to communicate with one another, and the central hub and thus via the ethernet link to the web.

1 comment:

Steve Snorex said...


Can you tell me where i can found code for this solar controller and more detailed information?