EcoRenovator (
-   Appliances & Gadgets (
-   -   Daox's diy arduino thermal differential controller (

Daox 03-29-11 09:54 PM

Daox's diy arduino thermal differential controller
1 Attachment(s)
We have a great thread that contains lots of info on thermal differential controllers here. However, I wanted to start a thread dedicated to my own development of a thermal differential controller that I'll be using for my attic heat reclamation project.

Tonight I setup a simple circuit that tested the operation of the differential controller and it worked great. Its very simple and adding features later on won't be a big deal at all. I am using the arduino since I know how to use it, its cheap, and it can do everything I'd ever want to be able to do with a thermal differential controller. The temperature sensors are LM35 sensors. They cost a bit more than the thermistors ($1.70 vs $.20) I had planned on using on the controller before, but they are much easier to use while programming and will probably give a better signal over long wire runs. The 120V relay I'm planning on using is a solid state relay (SSR) that the arduino can power directly. The 5V power supply is an old cell phone charger.

As for the operation of the controller, for now its a very simple setup. When the temperature of the attic gets 3C/5.4F higher than the house, the relay kicks on whatever is connected to it. In my case right now, that is two bathroom vent fans. Once the temperature of the attic drops down below the temperature of the house, the relay powers down the fans. There is also a 30 second minimum on time just in case to prevent any odd start/stop situations.

I'm also thinking about adding a LED that indicates that the fans are on, but I'm not sure if that'll be needed as you'll probably hear the air rushing out of the vent.



Parts List:

Here is a parts list of what you'll need. I've linked to a few places where I've bought things from before.

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.

Arduino program 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(", ");
  Serial.print(", ");

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

Daox 03-30-11 08:12 AM

One feature I am thinking of adding is a way to keep track of how long the fans are on. This will allow me to see how well it is working, and get an idea of what kind of weather it takes to get heat out of the attic. Ideally, this would be from an LCD, but I don't know how to program one yet. :)

Perhaps for now, I'll just keep the laptop connected to it for the first couple days and it can log the on time directly with the serial connection.

AC_Hacker 03-30-11 02:45 PM

1 Attachment(s)

Originally Posted by Daox (Post 12725)
One feature I am thinking of adding is a way to keep track of how long the fans are on.

How about this?


Daox 03-30-11 10:33 PM

Yes, that is exactly the type of thing I was thinking about. Perhaps I'll pick one up. I searched on the electronics sites I go to and all their time meters were much more expensive.

Edit: And now I see why its so cheap, item located in China. :) Not sure I want to wait that long.

A friend of mine suggested I use a few LEDs and output the time (perhaps in 1/2 hr segments) in binary. Doable, and easy enough, but not so easy to read at a glance, haha. I do have a couple LCD screens laying around. Perhaps its time to learn to use them.

Daox 03-31-11 08:15 AM

Last night I picked up the next thing I need for the controller, wire! It seems simple enough. I needed something with 3 conductors (wires) for the temperature sensor at least 25 ft long to make the run from the attic to the kitchen, and I wasn't exactly sure what I was going to use when a friend suggested network cable. That had way more wires than needed, so I found myself a 50ft length of telephone wire with 4 conductors. I even found it in a color that'll somewhat match the color of the chimney brick. :)

strider3700 03-31-11 08:57 AM

that's what I used for all of my wire runs. 25' should be no problem.

Daox 04-02-11 09:48 AM

1 Attachment(s)
Here is a bit of an updated schematic specific to the attic heat project.

In addition to this, I'm considering adding an outdoor temperature sensor. This will allow me to program logic that will see the outdoor temperature, and if its warmer than the kitchen to not kick in the fans. At some point I'll want to stop heating the kitchen, and it would be nice if it was automatic to squeeze a bit more heat out of things when the temperatures are swinging to and fro.

Piwoslaw 04-02-11 01:32 PM

An outdoor temp sensor is a good idea. It will let you program the Arduino to pull warm air from the kitchen in the summer when it starts to cool in the evening. Can the fans work in reverse, or maybe they can be seasonally turned around?

Daox 04-02-11 01:56 PM

That would be a great idea. However, I would have to find a way to reverse the fans. They only blow in one direction.

Piwoslaw 04-02-11 02:38 PM


Originally Posted by Daox (Post 12818)
That would be a great idea. However, I would have to find a way to reverse the fans. They only blow in one direction.

I think you could conjure up some summertime adaptors for the ductwork. Something that will allow the fans to be laid on their sides, pulling air from (instead of pushing it into) the chimney.

All times are GMT -5. The time now is 04:24 PM.

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