EcoRenovator

EcoRenovator (https://ecorenovator.org/forum/index.php)
-   Appliances & Gadgets (https://ecorenovator.org/forum/forumdisplay.php?f=21)
-   -   Daox's diy arduino thermal differential controller (https://ecorenovator.org/forum/showthread.php?t=1503)

Daox 04-06-11 08:58 AM

1 Attachment(s)
Still doing a little refining on the circuit. I added a pull down resistor as I had some issues with my SSR activating when it shouldn't. I also added a supression diode in case you're actually using a relay versus SSR. Here is the updated schematic.

http://ecorenovator.org/forum/attach...1&d=1302098203

AC_Hacker 04-14-11 01:37 PM

Source Code?
 
Quote:

Originally Posted by Daox (Post 12874)
Still doing a little refining on the circuit. I added a pull down resistor as I had some issues with my SSR activating when it shouldn't. I also added a supression diode in case you're actually using a relay versus SSR. Here is the updated schematic.

This looks great. Good that you are addressing both SSR and electro-mechanical relays, as they each have their own advantages, no arcing and longer life for the SSR, higher efficiency and lower cost for the electro-mechanical.

I was looking at your 'attic heat' thread, and it looks like you have the code working.

Will you be posting the source code for your differential controller here?

I am asking because there is a modified form of the differential controller, such as you have here that incorporates change/time. This type is used for controlling radiant slabs. With this type of controller, indoor temperature is monitored as well as outdoor, and when a change in outdoor temp exceeds a certain rate of change, the heat to the slab is increased or decreased, thus minimizing the 'time-lag' that usually accompanies a thermal mass. So, in a way it is a PID controller.

Am I explaining this in a clear way?

Regards,

-AC_Hacker

Daox 04-14-11 03:04 PM

Yep, I gotcha. As I mentioned earlier, I was thinking of adding an outdoor sensor.

I will definitely post code once I have everything working.

Daox 04-17-11 12:19 PM

1 Attachment(s)
So, I think its finally ready to go. I made some final tweaks and everything appears to be working perfectly. I had to add a capacitor to the signal line on the kitchen sensor because I was getting noise on the line. I pulled a 10uF capacitor off some circuit board I had laying around and it seems to work great. It wouldn't hurt to put one on the attic temp sensor too, but it didn't jump around much at all, so I just left it. Also, I've removed the 10K pull down resistor on my setup. It seems to be working fine without it.

Anyway, here is the new schematic.

http://ecorenovator.org/forum/attach...1&d=1303060150


Here is the code. I added another check in the program. If the kitchen temperature gets up to 80F/27C, the relay will turn off and stay off. Also, if you uncomment the serial parts of the code, you can very easily log the temperatures.

Code:

/* Thermal Differential Controller

  The program monitors two temperature sensors and
  activates a relay when one sensor is warmer than
  the other.
*/

int SsensorPin = 4;  // the pin to input attic temperature
int TsensorPin = 5;  // the pin to input kitchen temperature
int RelayPin = 2;  // the pin to operate the relay
int ledPin = 13;  // led pin (verify fan on condition)

int Ssensor = 0;  // variable to store the value of the attic temperature
int SensorDiff = 0;  // variable to store the Ssensor value plus differential (Diff)
int Tsensor = 0;  // variable to store the value of the kitchen temperature
int Diff = 3.0;  // temperature difference that must exist between attic and kitchen before relay enables (degrees C)


void setup() {
  pinMode(SsensorPin, INPUT);
  pinMode(TsensorPin, INPUT);
  pinMode(RelayPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
 
  // Serial.begin(9600);
 
  digitalWrite(RelayPin, LOW);
 
}

void loop() {
 
  // read sensor inputs and assign to variables
  Ssensor = analogRead(SsensorPin) / 2;
  Tsensor = analogRead(TsensorPin) / 2;
 
  // add temperature difference to Ssensor value
  SensorDiff = Ssensor - Diff;

  // send temperature signals back to computer
  /*
  Serial.print(Ssensor);
  Serial.print(", ");
  Serial.print(Tsensor);
  Serial.print(", ");
  Serial.println(SensorDiff);
  delay(1000);
  */

  // if attic is warmer than kitchen sensor, enable relay
  if (SensorDiff > Tsensor  && Tsensor < 27) {
      digitalWrite(RelayPin, HIGH);
      digitalWrite(ledPin, HIGH);
      delay(1000);
    }
 
  // if attic sensor is cooler than kitchen sensor, disable relay
  if (Ssensor < Tsensor || Tsensor > 27 ) {
    digitalWrite(RelayPin, LOW);
    digitalWrite(ledPin, LOW);
    delay(1000);
  }
}


Daox 04-21-11 08:58 AM

I suppose its time to make a parts list in case anyone would like to replicate the controller (easily). I'll work on that soon and post it up.

I just got my break out board that'll allow me to datalog with the RBBB (really bare bones board) arduino since it has no onboard USB converter. The code is already there, its just commented out, so no real changes will be needed except setting up a delay so it only datalogs every 5 minutes or so.

I'm also thinking an LCD display would be really nice, add a few buttons and you can cycle through data, manually set the differential temperature, even turn the unit on and off all from a 'control panel'. Unfortunately, I've never used an LCD before. But, it'll be another learning experience. :)

strider3700 04-21-11 10:46 AM

do some research on the LCD's and get one that only uses a few pins. The one that came in my package seems easy enough to use but it takes 10 or 12 pins if I remember correctly. there are others out there that need closer to 4.

I ordered a kit with my ardunio mega with the intention of doing similar. A remote display with a button to cycle through some of the data. It's sitting there waiting for me to have some time.

Daox 04-21-11 10:58 AM

I have the book Practical Arduino which is a collection of arduino projects and it steps through the design and explains everything. In it is a DIY water meter tutorial with a LCD and a couple buttons for resetting the display. I'll have to re-read that, but I'm pretty sure there are 3 ways to wire the LCDs up. One method uses tons of pins, 12 wires sounds about right, the other uses 8 or so, and the last uses 5 or 6 I think. I'll look it up and report back.

Thankfully, this project doesn't require many pins, so if I did need 10 pins it wouldn't be a problem.

Daox 04-22-11 12:43 PM

Here is a quick parts list of what you'll need. I've linked to a few places where I've bought things from before.
  • Arduino - your choice in what one to use, there are many
  • 5V power supply (cell phone charger) - probably have one of these laying around
  • AC solid state relay - can use other forms of relay, solid state relays just work well/easy with the Arduino and doesn't require the diode in the schematic
  • (2) LM35 Temperature sensors
  • 10uF capacitor - could probably get away with a smaller capacitor and probably a bit larger one too, easy to salvage out of any old electronics.
  • telephone wire - make sure to get enough to put both temperature sensors where you need them


The total for these items comes to ~$40 plus shipping which shouldn't be too bad. It can definitely be done cheaper if you go with a cheaper arduino or find parts to use.

skyl4rk 04-22-11 04:51 PM

Looks good, this system should be usable on any solar heated box of air.

Daox 02-10-12 04:29 PM

I think its time for an upgrade here. The current version of the thermal differential controller has been working great for over a year in my attic. However, I am planning on putting together a solar hot water setup this spring and I'll need another controller for it. I'd like to enhance the current functionality and add some additional features.

New features:
1) LCD display
2) adjustable on/off temperature differential via the LCD display (instead of having to edit the program)
3) maximum tank temperature adjustment via the LCD
4) control a heat dump load for if the tank and panels get too warm to prevent coolant degredation


I've already started programming the LCD display and interface for adjusting the temperature differentials and max temperature. I just need to figure out how I want to deal with the heat dump load.


All times are GMT -5. The time now is 06:43 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger