Smart attic fan controller

I'm trying to get started on my first project, but before I get too far into it, I'd like to know what is safe/standard for control and sensor wiring.

For starters, I am building a smart controller for my attic fans that will use temperature and humidity for inside the attic and outside ambient for inputs. I have two sections of attic separated by a vaulted section that I have located a path to run wiring between the two. What I'm planning on doing is putting an Arduino controller in one section and use DHT11/DHT22/Honeywell 4000 thermo-hygrometer sensors. If the attic humidity gets above a set value (probably in the 50-60%RH range) and the outside humidity is less, I'll turn on the fan. If the temperature gets above the set point (probably 90 degrees F), I'll turn the fan on. Since these are relatively small volumes, I may also add logic to only have the fan run for xx minutes per hour maximum, but that will require a bit of testing to see if that's really needed. Also, the two fans will be controlled independently since one is north facing and the other south and they have poor communication in-between.

So, with that setup as the baseline, I need some advise for running wires:

Sensors - My initial thought was that I could use some CAT5 cable to run the sensor to the opposite attic. Any suggestions on running a couple feet of CAT5 outside? It won't be exposed to the weather directly since it would be under the eves and facing north (the weather generally comes from the south around here).

Powering the fan -

  • Run control over CAT5 to a relay next to the fan (can this be in the same run as the sensor wire?)
  • Run power wire from a relay at the Arduino directly to the fan
  • Control the fan via X10. I already use X10, but I'm not sure how easy it is to connect to and control with an Arduino. Also, I suspect this would be more unreliable and more expensive.

So, I'm hoping someone can answer some of these questions before I run the wrong wiring or order the wrong parts. The cost isn't the concern so much as the shipping time for most of the components. It seems like most of the parts I'm looking at for sensors are sourced from Hong Kong or China resulting in up to a month lead time.

You can get thermo-hygro sensors for Arduino, so I think that side is reasonably easy.

I'm not clear whether you have mains power available on one or both sides of the loft. I think that will mandate how you power the fans.

I can envisage two approaches:

  • Use a low voltage mains switch to turn the fans on. This would probably be the simplest approach because you'd be using standard mains voltage fans. Combining mains voltage and low voltage electronics is potentially dangerous and you will need to spend some money to get a proper switch, but they're readily available.
  • Use a 12V powered fan, for example you may be able to find something suitable for RVs / caravans. Switching 12V is much less dangerous and would mean you can use an ordinary switch/relay shield.

I don't see any problem running cat5 or mains cable under the eaves, if that is the most convenient route. The only problems I foresee are cosmetic.

DHT11/22 check - Arduino Playground - DHTLib -

Thanks for the link. I've seen a few DHT11/22 libraries, so I'm not too worried about incorporation of the sensor. I'm mainly interested in other people's opinion about powering the A/C fan over a bit of a distance and best practices.

I missed the second post by PeterH the first time. I guess I failed to describe my current setup that I'm trying to improve. I currently have an A/C fan in either end of the attic. The contractor installed a temperature and humidity switch in series so the fans would both cool the attic when too hot and reduce the humidity to eliminate potential mold growth. This wiring resulted in poor performance since the fan would not function unless the temperature AND humidity were above their set values.

I rewired the switches a few months back so that they were in parallel such that the fan would run if either the temperature OR the humidity were above their set point. I found that this worked better, but the fan ran too much and tweaking the set point didn't really give me the desired run times.

That brings me to the smart controller. I found one that's already available, but it does not do everything I want and it's a bit expensive since it would require modifying to work with a standard fan (not their brand).

To answer the other question about power...yes, I have A/C in both ends of the attic. I will probably wire the smart controller in parallel with the current setup so I can easily use the current setup as a fall back in case the Arduino fails for some reason.

The main reason I was asking about X10 vs remote relays vs running A/C lines was that I thought controlling relays was difficult (based on some reading). Now that I've done some more reading, it appears that they are really pretty easy to use. The added components in the circuits that use relays are primarily for protection of the Arduino. After that reading I've also realized that the circuits are not that complicated anyway.

I think I'm just going to run a control wire and the sensor wires in the same CAT5 cable since they are both 5v as well as ground and the signal line back from the DHT11/22. Oh, and I found some direct bury CAT5 cable that I can buy by the foot at the local hardware store, so I may just use that for the exterior sensor to avoid any potential issues with insulation degradation.

Here's the link for the relay control I found that was most useful:
http://www.glacialwanderer.com/hobbyrobotics/?p=9

FWIW, I decided to just order a few relay circuits off ebay. I'll just run the control wiring from one end of the attic to the other where I'll install the relay in some kind of a small project box. I think I'll consider this a closed issue unless I have problems with implementation.

Thanks!