ok, so far i have managed to select the Uno board and have been successful with using the TMP36 temperature sensor to read and display though the serial monitor. Additionally, I purchased a Relay shield, which I am going to use to run a small pump off one of the 4 relays. (relay board http://www.robotshop.com/ca/productinfo … lang=en-US)
I have plans for the other relays on the board for a later addition to my project. But first things first, I want to have two temperatures compared and based on the difference, the pump will cycle when a max collector temperature has been achieved and there is a suitable difference between the holding tank and the collector. (please see operational description below)
Just so you don’t think I am a slacker, I have been doing the lessons on adafruit http://learn.adafruit.com/search?q=simon+monk but things are moving too slow for me as my system needs implementation asap as the summer approaches.
Here is a brief outline of my project.
I have built a solar collector for heating water which gets pumped to a holding tank. The holding tank is then used several ways. At the moment I am sending my household cold water line through the holding tank via a high density heat exchanger and raising the temperature of the water prior to it`s entry to my house domestic water heater. This reduces the work the water heater has to do, saving me $$$. The temperature sensors will go on the holding tank and on the solar collectors. When the collector hits 50 deg C, and the tank is say at 20 deg C the programming should have the pump cycle until the collector reaches within 1 degree of the tank temperature.
Typically, I am seeing the tank increase about 2 degrees C on each pumping cycle. So, in this example it would end up at about 22 deg C. (It is a 150 gallon tank so each cycle I only get a marginal increase.)
At this point the solar heated water will have dropped and when it reaches the 23 deg C mark (1 deg diff) it should stop the pump and wait for an increase in collector temperature back to the high target of 50. *I havent given any thought to what happens if it only reaches a point less than 50.* The gist of it is that I don
t want to exceed 50 deg but want to cycle when it has a decent difference in temperature between the tank and the collector. Also once the tank is heated fully, I may have to cycle a different pump to divert the extra hot water so the collector does not overheat. So far it has hit 70 deg C which is getting near the upper limit of the plumbing I have.
Here is where I am with trying the relay shield:
I have tried to operate the relay shield but have not been successful with the code I have found from the website.
/*
This Sample code is for testing the Relay shield V2.1 for Arduino.
Editor : Phoebe
Date : 2013.2.28
Ver : 0.1
Product: Relay shield for Arduino
SKU : DRI0144
Hardwares:
-
Arduino UNO
-
Relay Shield For Arduino V2.1
3 Power Supply:7~ 12V
*/
byte relayPin[4] = {
2,7,8,10};
//D2 → RELAY1
//D7 → RELAY2
//D8 → RELAY3
//D10 → RELAY
char input=0;
int val;
void setup() {
for(int i = 0; i < 4; i++) pinMode(relayPin*,OUTPUT);*
Serial.begin(57600);
delay(100);
Serial.println(“Press 1-4 to control the state of the relay”);
Serial.println(“waiting for input:”);
for(int j = 0; j < 4; j++) digitalWrite(relayPin[j],LOW);
}
void loop() {
if (Serial.available())
{
char input= Serial.read();
if(input != -1)
{
switch(input)
{
case ‘1’:
Serial.println(“Relay1”);
val=digitalRead(relayPin[0]);
val=!val;
digitalWrite(relayPin[0],val);
break;
case ‘2’:
Serial.println(“Relay2”);
val=digitalRead(relayPin[1]);
val=!val;
digitalWrite(relayPin[1],val);
break;
case ‘3’:
Serial.println(“Relay3”);
val=digitalRead(relayPin[2]);
val=!val;
digitalWrite(relayPin[2],val);
break;
case ‘4’:
Serial.println(“Relay4”);
val=digitalRead(relayPin[3]);
val=!val;
digitalWrite(relayPin[3],val);
break;
default:
if(input != ‘\r’ && input != ‘\n’)
Serial.println(“invalid entry”);
break;
}
}
// else unablerelay();
}
}
When I upload this to the uno with the shield attached, I get it to display the lines “Press 1-4 to control the state of the relay” and
“waiting for input:” I don`t have any buttons connected but would like it to cycle from the programmed output of the temperature sensors.
Any help with online lessons or sites to find some code would be appreciated.
:?
Qbit