Devkit Solar Controller

Chapter 1 - DevKit Solar Controller

Deployable Generic Wireless Controller

The DevKit Solar Controller is a powerful, low cost solution to monitor and control a wide variety of things. It has also been successfully tested with a solar hot water system. This little device has Built-in-Functions for fast deployment, is easily programmable in BASIC, has an LCD display (3 buttons, 3 LEDs), comes with an External Antenna with a range of over 100m, and has a customizable sensor board. It is powered by household current, as well as from Solar Power. The solar power enables the battery to remained charged in case all power is lost.

SolarController2.gif

Figure 1: Wireless Controller

Simplicity and Diversity

The AIRcable http://www.aircable.net/ DevKit is designed with two major points in mind: simplicity, and diversity. Simplicity comes with the deployable, ease of use design. Diversity is inherent within the device’s programmable options that suit individual needs. In other words, thes controller can acommodate both the novice who simply wants to install a solar hot water system in their home, as well as the engineer who wants to build a custom system with specialized sensors.

Programmable Data Sensing

The diversity lies within the ability to program the device utilizing the easily programmable BASIC, for a virtually unlimited range of data sensing applications. Additionally, the Sensor Interface can be customized since the board itself is customizable. With these two features: a modifiable Sensor Interface, and programming ability, there are an almost unlimited number of applications where the DevKit can “sense” the necessary data, retrieve it, display it, and even perform automatic data logging using the AIRcable Server http://www.aircable.net/server-xr.html with pre-installed Linux, and interpret the results.

Customizable Sensor Board

The housing itself is a generic piece that fits over the customizable sensor board. The board iteslf allows for virtually any type of data sensing for a multitude of applications.

SensorBoard.gif

Figure 2: Sensor Board

Controller Hardware

The DevKit is comprised of the following pieces of hardware:

Hardware Description
ADC converter 3 channel, one common ground, 1.8V pull up for each channel.
Battery Voltage Converter Battery voltage to analog input 1 of the AIRcable controller.
Flow Sensor Frequency to voltage converter, reference voltage for the sensor, analog output to analog input 2 of the AIRcable controller. Has a little turbine inside with magnets on the fan blades. The blades turn when water flows through which measures the amount of water passing through the pipe.
Heat Exchanger Does as the name states, exchanges heat, in this case, lowering the initial temperature of the water coming out of the main water tank before it continues on up to the solar tubing on the roof. This will only run if the Water Tank Temperature Sensor indicates that the water is too warm. When the Heat Exchanger is triggered, the heat is transferrred to an external source. In Figure 4, “Flow System,” on page 12, the Heat Exchanger triggers the pool pump to begin flowing water through the system in order to transfer the heat away from the solar cold water pipe.
Sensor: Light Sensing voltage from the solar cell to run the pump as well as to charge the battery in the controller.
Sensor: “overheat” The “overheat” sensor measures the water temperature after it passes through the heat exchanger on the solar cold water line. This is the water temperature that will go up on the roof into the solar panel. If the water is too hot to be allowed into the solar coils on the roof, it will trigger the Heat Exchanger to cool the water temerapture down further and transfer the heat onto another external source such as a pool.
Sensor: Solar Water Temperature Provides a temperature reading of the water after it has been heated through the solar tubing.
Sensor: Water Tank Temperature Provides a temperature reading of the water initially coming out of the water storage tank.
switch for pump #1 New MOSFET switch with TTL level gate. This pump works off of full pressure house water supply. Note: Pump runs off of solar energy which means that the pump only runs when the solar panel is converting sunlight to energy.
switch for pump #2 (pool: used in this case as an external place for transferring excess heat to) A low power pump using low pressure water from the external water source (the pool). Note: Pump runs only when the Heat Exchanger triggers it to run water in order to transfer heat away from the solar cold water pipe.

Long Range Wireless Communication

The External Antenna provides a range of over 100m allowing for sensory data retrieval in areas where wired communication may either be unfeasible or impractical.

Solar Applications

By using a flow sensor to determine how much water is going through the pipe, and multiple temperature sensors that provide temperature differences, the device is able to display the following bits of data on its LCD screen:

SolarController.gif

Figure 3: DevKit tied to Solar Panel

LCD Display Description
Solar Temperature
SolarTemp.gif
Reads water temperature in the pipes on the roof. Measures in °C.
Overheat Temperature
OverheatTemp.gif
Reads the temperature of the water in the cold water line after the water has run through the Heat Exchanger. If the water is “sensed” to be too hot, the heat exchanger will be prompted to pull more heat away from the water to cool it down further. Measures in °C.
Tank Temperature
TankTemp.gif
Reads the water temperature that flows from the main water storage tank. Measures in °C.
Solar Power (BTU)
SolarPower.gif
Measures the total kW that the solar panels are producing.
Flow Sensor (Energy)
FlowSensor.gif
Has a little turbine inside with magnets on the fan blades. The blades turn when water flows through which measures the amount of water passing through the pipe. Measures enegry in Wh (Watt Hours).
Heat Exchanger
HeatExchanger.gif
Does as the name states, exchanges heat, or transfers heat from one place to another. In this case, if the water coming from the main water tank is too warm, the heat exchanger will cool the water by transferring heat to another source external to the flow system. Measures in BTU/Day or Wh (Watt Hours). Note: Shows up only if the solar temperature is less than the tank temperature.

Flow System Basics

The flow system on its most basis level works in the following manner:

  1. Water from the storage tank is pumped out into the cold solar pipe.
  2. The water reaches the solar coils on the roof where the sun heats the water.
  3. The heated water runs back down into the water storage tank.
  4. The AIRcable Solar Controller monitors the entire process.
  5. The Solar Controller is monitored by the PC and accumulates data throughout the day.
SolarWaterSchematic-2.gif

Figure 4: Flow System

Utilizing Existing Hot Water Tank

WaterTank.gif

Figure 5: Connection to Existing Water Tank

Web Display Basics

Your PC will display the accumulated data as it communicates with the controller. The data can be displayed showing daily information as well as information that has been stored into the database showing information over a longer period of time.
The following graph shows a single day of activity. Approximately every minute a reading is taken from the sensors within the flow system thereby providing a temperature difference that can be charted throughout the day. Additionally, the Flow Sensor reads the flow of water throughout the day. This combined data produces a chart showing the total Kw hours produced during the day between sunrise and sunset. The graph will resemble the example in Figure 2 showing the maximum energy being produced at the middle of the day when the sun is at its peak.

FlowChart1.gif

Figure 6: Energy Production Graph

The next graph details the type of reading taken throughout the day with flow and temperature difference that gives rise to the graph in Figure 2 showing total accumulated watt hours. This is why a reading is taken before and after the water enters the solar coils.

ntc2.jpeg

Figure 7: Flow and Temperature Difference Chart

We wire it like this:

+1.8V reference voltage from the AIRcable SMD
|
resistor 4.7k Ohm (attached curve shows 3 values: 4.7k, 2k and 1k Ohm)
|
+— connected to the Analog Voltage input
|
standard 10k NTC
|
GND
This way we have a pretty good linear approximation of the sensor.
The formula used to calculate Celsius from Voltage is:

C = 105.1 - V * 0.06957

or approximate: C = 105 - ((V * 3) / 43)

This is one of those design decisions to intelligently attach analog sensors (NTC) to the AIRcable dev kit

Examples

Solar Side

Coming Soon

slave-linkth-monitor example code

run the parser
./parser.py slave-solar-monitor > AIRcable.bas

sort the number of lines, report duplicates
./clean.py

file content: slave-linkth-monitor

#*
    Example usage, this will generate
    monitor ambient testing code as MASTER
*#
#set global $stream="slave"
#include "base/AIRcable.bas"
#include "shell/AIRcable.bas"
#include "monitor/AIRcable.bas"
#include "LinkTH/AIRcable.bas"

Chapter 2 - DevKit - Mechanical and Electrical Layers

Sensor Board

Customizable Sensor Board

The housing itself is a generic piece that fits over the customizable sensor board. The board iteslf allows for virtually any type of data sensing for a multitude of applications.

SensorBoard.gif

Figure 1: Sensor Board

Controller Hardware

The DevKit is comprised of the following pieces of hardware:

Hardware Description
ADC converter 3 channel, one common ground, 1.8V pull up for each channel.
Battery Voltage Converter Battery voltage to analog input 1 of the AIRcable controller.
Flow Sensor Frequency to voltage converter, reference voltage for the sensor, analog output to analog input 2 of the AIRcable controller. Has a little turbine inside with magnets on the fan blades. The blades turn when water flows through which measures the amount of water passing through the pipe.
Heat Exchanger Does as the name states, exchanges heat, in this case, lowering the initial temperature of the water coming out of the main water tank before it continues on up to the solar tubing on the roof. This will only run if the Water Tank Temperature Sensor indicates that the water is too warm. When the Heat Exchanger is triggered, the heat is transferrred to an external source. In Figure 2, “Flow System,” on page 18, the Heat Exchanger triggers the pool pump to begin flowing water through the system in order to transfer the heat away from the solar cold water pipe.
Sensor: Light Sensing voltage from the solar cell to run the pump as well as to charge the battery in the controller.
Sensor: “overheat” The “overheat” sensor measures the water temperature after it passes through the heat exchanger on the solar cold water line. This is the water temperature that will go up on the roof into the solar panel. If the water is too hot to be allowed into the solar coils on the roof, it will trigger the Heat Exchanger to cool the water temerapture down further and transfer the heat onto another external source such as a pool.
Sensor: Solar Water Temperature Provides a temperature reading of the water after it has been heated through the solar tubing.
Sensor: Water Tank Temperature Provides a temperature reading of the water initially coming out of the water storage tank.
Switch for pump #1 New MOSFET switch with TTL level gate. This pump works off of full pressure house water supply. Note: Pump runs off of solar energy which means that the pump only runs when the solar panel is converting sunlight to energy.
Switch for pump #2 (pool: used in this case as an external place for transferring excess heat to) A low power pump using low pressure water from the external water source (the pool). Note: Pump runs only when the Heat Exchanger triggers it to run water in order to transfer heat away from the solar cold water pipe.

Interface

Flow System Basics

The flow system on its most basis level works in the following manner:

  1. Water from the storage tank is pumped out into the cold solar pipe.
  2. The water runs through a flow sensor which reads the amount of water flowing through the pipe
  3. Next, the water runs through a temperature sensor which reads the temperature of the water (storage tank temperature).
  4. Next, if necessary, the water runs through a heat exchanger which cools the water before entering the roof top (You do not want hot water running up to the solar coils).
  5. The water reaches the solar coils on the roof where the sun heats the water.
  6. This heated water from the solar coils goes through another temperature sensor which takes another reading (solar water temp).
  7. The heated water runs back down into the water storage tank.
SolarWaterSchematic.gif

Figure 2: Flow System


Chapter 3 - Server Side

OpenProximity Plugins

Preparser Usage

Description

A templating system for making AIRcable BASIC code creation easier.

Introduction

Templates are everywhere around, and python programming language is no exception. By using Cheetah Template Engine we have been able to create some little functions that allow to easily create code that can talk to any stream: Slave, Master and UART.

Installation

Installation Prerequisites

Before been able to use this template you will need a few prerequisites. You will need to get Python 2.6 and Cheetah 2.x installed. If you're running any Unix based OS like MacOS or Linux then it's quite sure you all ready have python installed, Cheetah can be easily installed by using the package manager from your OS.
For MacOS you find instructions here: Cheetah Darwin Port. You may need py25-hashlib for MD5 function and call python2.5 instead of the installed standard python.
Windows users might have a more difficult time installing these tools, we've found a useful guide at (1)

Setting up

Once you have the prerequisites filled installation is really easy. First you need to get parser.py. And store it somewhere in your path. If you're using a Unix based system then you can mark the file as executable by doing chmod +x parser.py, so then you can call it as parser.py

Usage

Usage of the script is easy, you just call the script and pass as argument your template, for example: parser.py slave-monitor where slave-monitor is your template.

Templating

First we recommend that you understand how Cheetah templating works, for this you can read (1), this is a nice and easy to follow tutorial.
Besides the functions provided by Cheetah we have implemented a few more:

  • $PRINT(stream): Renders as PRINTU, PRINTM, or PRINTS depending on the argument stream. Valid stream values are: 'master', 'slave' and 'uart'.
  • $INPUT(stream): Renders as INPUTU, INPUTM, INPUTS, similar to $PRINT(stream)
  • $TIMEOUT(stream): Renders as TIMEOUTU, TIMEOUTM, TIMEOUTS
  • $GET(stream): Renders as GETU, GETM, GETS
  • $STTY(stream): Renders as STTYU, STTYM, STTYS
  • $CAPTURE(stream): Renders as CAPTUREU, CAPTUREM, CAPTURES
  • $DISCONNECT(stream): Renders as A = disconnect 0, or A = disconnect 1 depending on stream. Valid streams are 'master', 'slave'
  • $DEF(variable): Checks if variable is defined or not

Examples

For a full example on how to use the templating system you can check our SensorSDK trunk.

Links

(1) http://www.devshed.com/c/a/Python/Templating-with-Cheetah/

Shell

Description

This document describes the command line implemented in AIRcable SensorSDK.

Introduction

Communication between the SensorSDK and the outside world can be done over Bluetooth or the UART port, for automated access a protocol is needed. We created a very simple to use command line, which allows to do some basic functions like:

  • Add entries to history
  • Exchange files over a string stream protocol
  • Show text on the screen
  • Change state of PIO
  • Listen for button press

Downloading Code

The template can be found in our trunk: latest version.

Including Command Line

Command line is provided as a Cheetah template, you need to define the global variable $stream before including the template, for example if you want to use slave profile then you need this lines:

#set global $stream="slave"
....
#include "shell/AIRcable.bas"

We recommend adding this include after base code and before mode code (monitor, interactive, etc.

Code Example

607 IF A = 0 THEN 650;
## s<file>: send file over spp
608 IF $0[0] = 115 THEN 620;
## u: slave and enable for 20 seconds
609 IF $0[0] = 117 THEN 630;
## S[number][content]: sets line number to 
## content, number is 4 digit long always
610 IF $0[0] = 83 THEN 643;
## L[number]: print content from line 
611 IF $0[0] = 76 THEN 646;
## c<clock>: sets current date and time
612 IF $0[0] = 99 THEN 637;
## d<file>: deletes <file>
613 IF $0[0] = 100 THEN 640;
## l<content> put <content> on the screen
614 IF $0[0] = 108 THEN 680;
## P<timeout>: wait until user does a button press
615 IF $0[0] = 80 THEN 685;
## p<STATE><PIO>: sets <PIO> to either 1 or 0 (pioset/pioclr)
616 IF $0[0] = 112 THEN 688;
## e exit
617 IF $0[0] = 101 THEN 650;

Command Line Functions

In code example section you can see the function dispatcher, there are a few factory functions, but you can modify this to match your needs.

Standard Functions

Expression Variable
s< file > Send < file > over spp. This will print each line after another, waiting for GO before sending a new line.
u Will close the command line, and will enable slave and FTP for a few minutes.
S< number >< content > Sets line < number > to < content >. < number > needs to be 4 digits long always, otherwise you might loose some content. You can fill with 0s and spaces.
L< number > Prints line < number > to the shell.
c< content > Pushes < content > into the device history.
d< file > Deletes < file > from the file system.
l< content > Will display < content > into the LCD screen. There's no scroll with this command.
P< timeout > Will wait until < timeout > for a long or short button press. If there's a timeout then you will get back to the shell.
p< state >< PIO > Will set < PIO > to < state >, < state > can be either 0 or 1.
e Will exit the command line.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License