Home Heating Automation

For $40 you can get a stand alone servo controller like the ssc-32 (32 servos) to attach to the arduino.

So I've found some worm gear boxes over at Pololu:

They are pretty cheap, in both respects, but I think they just might work. I wanted to just buy my own worm gears, but they get pricey really quick and having to make my own gearbox doesn't sound fun.

I think I'm gonna get this servo

Its the highest torque one that I could find at a low price point.

I'm thinking I should be able to get these things before the end of the week. Any other ideas are welcome.

For $40 you can get a stand alone servo controller like the ssc-32 (32 servos) to attach to the arduino.

Do you know of a good sensor shield, something with 32 I/O pins. I still might just make my own servo with the arduino and a pot on each motor.

Better servo pricing. I suggest you make one damper and get it working before making up a big parts order.

Thanks for the link, they have much better pricing. I plan an spending ~$50, to do a proof of concept, doing a reality check then going on from there.

So I got the Arduino, and battery packs and I'm just waiting for the servo. I've been looking into the making my temperature sensor wireless nodes. At first I was thinking that the xbee was going to be my best bet, but after doing some more research, and messaging a few members, I'm thinking that RF will work out well. I have seen a lot of people using the RFM12, or RFM12B, but I think that I can use the RF-2400 for a good amount less money. What do you guys think.

I have attached a schematic of what I think should work for a nice low cost, low energy usage RF node. Is it alright to use the reset pin, P1, for reading the data from the temperature sensor?

Another question that I have is how long can you sleep the ATTINY85 for, I believe I saw somewhere it was 9s.

Lastly jeelabs uses a p-mosfet to shut down the RFM12. Would it be worth it to use the ATTINY84 to have more output pins for adding a p-mosfet?

Thanks for taking the time to read my silly questions.

remote_sensor.bmp (1.01 MB)

remote_sensor.sch (225 KB)

I just noticed that the RF-2400 is supposed to be flipped 180°. I'll fix it when I get home.

Fixed

remote_sensor.bmp (1.02 MB)

remote_sensor.sch (225 KB)

So I finally got the servo motor in the mail today. I couldn't wait to hook it up. The setup was really simple, the only thing I found odd was that when I started I was able to drive the servo off of pin 13. After a couple of demos I couldn't use pin 13 any more. So I've been using pin 2 to drive the servo now instead. Any ideas about that?

This is my very simple code. I used java to communicate with my COM4 port to test out the servo. It works great so far. I'm currently trying to figure out what the range of this servo is, and I haven't found a datasheet for it yet. I have the TowerPro 9805BB.

So the next step is going to be making this thing wireless I think. I may even just use my laptop now to take commands over the LAN and send that data over com to the arduino. That way I can program up an android app for my tablet.

After that I'm gonna start hooking up more servos. To control all the servos I think I'm gonna buy one of these Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface [PCA9685] : ID 815 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits. Has anybody used this breakout board before? Any suggestions for what gage wire to used for the 6v and signal wires for 20-30ft before I go look it up? Also does anybody know what would be a good 6v power supply. Adafruit sells a 5V 10A power supply but I'd kinda like to supply 6V so I can get the most out of my servos.

#include <Servo.h>

Servo myServo;

int incomingByte = 0;

int nPulseWidth = 1500 ; // 1500, defined in servo.h


void setup()
{

  myServo.attach(2);
  
  // the library sets all servos to 1500 ms pulse width by default, this is center for a steering servo
  Serial.begin(9600);
  Serial.println("Completed setup");  
}

void loop()
{
  
  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    if(incomingByte>0 && incomingByte<180){
      nPulseWidth = (int) (incomingByte/90.0*1000 + 500);
      myServo.writeMicroseconds(nPulseWidth);
      Serial.print("Sending Servo: ");
      Serial.println(nPulseWidth,DEC);
    }
  }
  
  
}

Servo test code for use with the serial monitor that can be used to find the hard stop servo control limits. I've operated servos over four conductor cat3 telephone wire (control, +6v, ground, and spare wire).

// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control 
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n);
    }

    readString=""; //empty for next input
  } 
}

laadams85:
the only thing I found odd was that when I started I was able to drive the servo off of pin 13. After a couple of demos I couldn't use pin 13 any more. So I've been using pin 2 to drive the servo now instead. Any ideas about that?

Perhaps you have overloaded the pin by exceeding it's current capability, and the driver has burned out. Does that pin work at all now?

Perhaps you have overloaded the pin by exceeding it's current capability, and the driver has burned out. Does that pin work at all now?

That's what I was thinking but I'm not sure how that would happen, its just the signal wire. What is an easy way to test that pin? Can I wire that pin as an output and wire it to pin 12 to test it?

Also do you think its the circuitry that's shot or just the chip. I should be able to just replace the chip for cheap.

What is an easy way to test that pin?

The "blink" code example in the IDE uses pin 13.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

The blink code works fine. Maybe its something else then. Hmmmmm, maybe I need to set that pin to something before I attach the servo to it.

Be advised that if you have installed an ethernet shield, pin 13 will not be available for other uses while the ethernet shield is in operation.

No shields, pretty much bare bone right now.

I just fabbed up a bracket for attaching the servo to a round duct. I figured I'd share :smiley:
Jump ahead to 25s in the mpg

230_8717.mpg (2.51 MB)

Pic of the hardware

I made some small progress on this, but for me it was really exciting. I hosted a Apache server on my laptop and created a simple php script

<?php $fp = fsockopen("localhost", 5334, $errno, $errstr, 30); if(!$fp){ echo "$errstr ($errno)"; } else{ fwrite($fp,$_POST["angle"]); fclose($fp); } ?>

This sends data to the arduino running this sketch.

#include <Servo.h>

Servo myServo;

int incomingByte = 0;

int nPulseWidth = 1500 ; // 1500, defined in servo.h

String readString;


void setup()
{

  myServo.attach(2);
  
  // the library sets all servos to 1500 ms pulse width by default, this is center for a steering servo
  Serial.begin(9600);
  Serial.println("Completed setup");  
}

void loop()
{
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }
  
  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 
    incomingByte = readString.toInt();  //convert readString into a number
    nPulseWidth = (int) (incomingByte/90.0*1000 + 500);
    myServo.writeMicroseconds(nPulseWidth);
    Serial.print("Sending Servo: ");
    Serial.println(nPulseWidth,DEC);
    readString="";    
  }  
}

It was just exciting being able to control the servo from my tablet over our intranet.

Some additional resources that may be useful for your project:

The DIY Zoning Project

Manual Zr - Residential Zoning
http://www.contractorresource.com/manual-zr-residential-zoning.html?gdftrk=gdfV27686_a_7c1308_a_7c3363_a_7cACCA_827&gclid=CMHv8aqc3bsCFclQOgodHX0AAg

Just some more information to either help or confuse.

heating and cooling is one of the absolute worst processes to attempt to control . if you measure an increase in heat, you are only measuring the BEGINNING of the avalanche of heat that will soon follow. oil burners, gas heater, hydronics, an the like heat up in a remote location and do not start to send the heat until the heat exchanger has reached a temperature. and once it has reached that temperature, it will run and send that heat, no matter what you do.

if you think of controlling heat, think more of managing a sluggish chaos of parameters.

as for damper control. forget all the fancy feedback, you really cannot use that in ducted air flow. if you move one damper partway, then the system pressures change and every other damper will have a new pressure and the flow will change in each.

some tips. first, do not try to turn your gas or oil heater on and off in any sort of fast duty cycle. you will wear out the motor, the blower, the gas valve or other parts. they are meant to operate about 3 to 5 times per hour at maximum and then only for a few weeks of extreme outside temperatures.

second. think of controlling half way. open a damper for a room that wants more heat and close the damper for one that has too much, but only move them half way to full open or full closed from where they are now. or move in 10% increments.

you can use a simple clock motor to move the damper. an AC synchronous motor is what the commercial HVAC companies use.

Since you really do not need to know the actual damper position, only if you need more or less heat, you can test your damper to get a speed of movement. then use a simple time-of-flight signal. if it takes 30 seconds to go from full open to full closed, then 3 seconds should move it about 10%

if you really want to get potions control, put a pot on the shaft.

also, the entire control system changes over the season. in the spring and fall you have occasional heat, in the deep freeze, you have continual heat. once you have data logged some of the operation, consider two different control strategies based on the outside air temperature.