# Arduino as a heating monitoring and control unit



## MrEd (Nov 6, 2009)

I have been spending a lot of time starting to think about my control system now that the basic system is running like a charm and reading alot of the older threads here. I feel quite confident that I could do all the basic controls I need to using just a few relays and aquastats, but in addition to my control logic, what I really would like to be able to do is having detailed monitoring and logging functions that I can view from my PC (and possibly the web or on my iPhone).

From the little I have read about the Arduino board, it would definitely be an OK choice to use as my basic control system building block(maybe not the best, but seems to offer a lot for a little bit of money), I am less clear if it has the capabilities (built in or add-able) to allow it to log data from a dozen or more temp sensors, as well as all the other things I  might like to monitor(zones open/closed , circulators on/off, outside temps etc). 

Anyone know off hand if that Arduino is up to the task for that type of thing(monitoring and getting the data into my PC)? or is it then asking too much of such an inexpensive unit? In an ideal world the data it collects would be funneled into my PC in near real-time where I could built the rest of the reporting interface I need.


----------



## Nofossil (Nov 6, 2009)

I don't have first-hand experience with the Arduino, but I've done a couple of embedded systems in my time. There are three limitations to what you can do with any embedded system:

1) The limitations of the hardware itself (processor horsepower, RAM, etc.)
2) Limitations on how much time you want to spend
3) Limitations on how much money you want to spend

There are tradeoffs among all three. As far as limitation #1, at the data rates necessary for heating systems I'd expect that you can do everything you want with the Arduino. It may require a good deal more of your time than it would with a more expensive platform. I chose the Technologics boards because at $200 they come out of the box with a complete operating system including full network support, telnet, ftp, and a web server. That allowed me to focus on the details of my software. I wrote it in C to minimize the resource consumption on the bitty little processor.

A full-blown PC or PLC would cost more and require less time to get running. It's all tradeoffs. I'll admit to some satisfaction from doing as much as possible for as few dollars as possible. Find the challenge that you want and go for it. Whatever choice you make, there's support here.


----------



## twitch (Nov 6, 2009)

I am using an Arduino as a controller, currently 6 sensors and 4 relays.  It doesn't have built in datalogging, but I have a C# program I'm working on to store the temps and to manually turn on / off the relays.  The only problem with this setup, is that the Arduino has to be connected to the PC all the time, and the PC would need to run constantly.  I'm planning on setting up a web server on my PC to be able to monitor and control the system, but that is a long way off.

If you google Arduino datalogging, there are quite a few projects out there.  Some use a flash memory card. Nofo's control system has all the capability you are looking for and is much more robust than what I'm doing.


----------



## MrEd (Nov 6, 2009)

As far as learning curve, any guess as to whether the TS-7260 is more or less of a challenge then the Arduino to learn? One thing that attracted me to the the Arduino is not only the low price but the wealth of resources available on the web.


----------



## kabbott (Nov 6, 2009)

MrEd said:
			
		

> As far as learning curve, any guess as to whether the TS-7260 is more or less of a challenge then the Arduino to learn? One thing that attracted me to the the Arduino is not only the low price but the wealth of resources available on the web.



I am learning to work with the Technologics boards so it can't be to hard. I will admit the initial curve is steep but the pieces begin to fall together. Having
prior knowledge of Linux is a big plus. It had been quite some time since I had done anything "under the hood" with Linux. Had to use the cheat sheet
for everything I did, It's now becoming much easier. Nofossil's forum will help with this also as more DIYer's get there hands on the hardware.

Either one is a fun project, The Arduino looks like a cool piece of hardware for the price and yes there seems to be more info on the web for it.

One thing I will add, I have not used the TS-7260 but the TS-7800 is one awesome little workhorse. I am shocked with the horsepower the little 
board has for 8 watts input. I think I could use the thing for web surfing/email if it had graphics, even has two sata II connectors for hard drives.Thought 
about using it for NAS but the drives would use more power than the board. hh:


----------



## Nofossil (Nov 6, 2009)

kabbott said:
			
		

> I am shocked with the horsepower the little
> board has for 8 watts input.



8 watts? What a power hog!

The 7260 uses 1 watt. In my book, that's amazing. My off-grid customers love it for that. The whole NFCS typically draws less than 5 watts.

As far as learning curve, I think it's fair to say that any solution will have a learning curve. the less expensive and/or more powerful, the steeper the learning curve is likely to be. I'm hoping that part of the value of the 'standard' NFCS is that users can get it running without having to ever see a command line. Of course, it's WAY more expensive than the Arduino.


----------



## kabbott (Nov 6, 2009)

nofossil said:
			
		

> kabbott said:
> 
> 
> 
> ...



Ha Ha........ I say no fair. That actually is the the draw @ the wall, everything but the relays. But I was a little disappointed, I was hoping for under five watts.
I built a dual core system for a server with an eye towards low power and ended up with a system drawing 55 watts so by comparison I am pretty happy.
Everything is relative........


----------



## cguida (Nov 8, 2009)

The Arduino literature says the contoller was developed to be a cheap, simple way for non-technical people to do digital logic control.  The two key words here are "Cheap", and "Non-techincal."   And I think they have succeeded on both accounts.  Digital logic control these days is just amazingly cheap -- like Nuclear Power... "too cheap to meter."   Think of it: you can run your whole system with very fine-grain control for maybe less than the cost of an aquastat.

(And I intend to do just that -- just as soon as I install a spare aquastat to run a pump that I now have to toggle by hand....)

Twitch, can you tell us more about your control system, e.g. what kind of sensors; what kind of "actuation"; maybe post program for us to use as a model...

For a really great example of an Arduino in action, see WoodNotOil's Set Point differential temperature controller.

https://www.hearth.com/econtent/index.php/forums/viewthread/33463/

Woodnotoil has a web page that describes the system in more detail.  Very clever!


----------



## cguida (Nov 8, 2009)

This is from a link supplied by WoodnotOil about the Dallas Semiconductor digital thermometer/thermostat.  Souinds pretty cool -- and cheap! 3 or 4 bucks.  WoodNotOil's Google Page has the programing details.  http://woodnotoil.googlepages.com/arduino 

The DS18S20 digital thermometer provides 9-bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18S20 communicates over a 1-Wire® bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. In addition, the DS18S20 can derive power directly from the data line ("parasite power"), eliminating the need for an external power supply.

Each DS18S20 has a unique 64-bit serial code, which allows multiple DS18S20s to function on the same 1-Wire bus. Thus, it is simple to use one microprocessor to control many DS18S20s distributed over a large area. Applications that can benefit from this feature include HVAC environmental controls, temperature monitoring systems inside buildings, equipment, or machinery, and process monitoring and control systems.


----------



## sgschwend (Nov 9, 2009)

The one wire temperature probe does look good. 

There was a comment about the Arduino requiring a full time PC.  I thought the source code was downloaded then the Arduino  should run stand alone?

I like the remote capability idea, to me that is worth the $s to have that.

How about standardizing on one or two controllers? Would you folks be interested in that approach?


----------



## cguida (Nov 9, 2009)

The Arduino requires a PC for programing, but once it is loaded up via the USB cable, you can disconnect the USB cable and run it as a stand alone item.  You need a PC for more complicated tasks of data logging and such.  But it can run by itself for normal controller type applications -- just not much of a user interface that way.


----------



## mwk1000 (Nov 19, 2009)

I'm going to setup a set point controller and data logger with arduino as well. I was curios about how the temp sensors (Maxim  DS18B20) have been mounted by others that have used them.

I have 1" copper on my flat plate HX and I was thinking thermal paste and a pipe clamp ? 

What is the accuracy of this type of approach ? Is it within a degree or two of the actual water temp ?

Also found a clever package for a relay to try this out with. http://powerswitchtail.com/default.aspx


----------



## Nofossil (Nov 19, 2009)

mwk1000 said:
			
		

> I'm going to setup a set point controller and data logger with arduino as well. I was curios about how the temp sensors (Maxim  DS18B20) have been mounted by others that have used them.



I don't use the DS18B20 sensors, but the sensors I use have the identical form factor. I've had really good luck strapping the sensor to pipes with pipe insulation and a velcro strap to slightly compress the pipe insulation and hold the sensor firmly against the metal. You want enough pipe insulation so that the pipe near the sensor is not appreciably cooled by the room air.

Should work fine on a flat surface as well.


----------



## twitch (Nov 19, 2009)

Smee,
    Sorry for the late reply.  I'm using the same components that twofer used in the thread below:
https://www.hearth.com/econtent/index.php/forums/viewthread/44038/
I used a 16x2 LCD instead of the 20x4.  Below is the component parts list, of course there’s also the enclosure, cat 5e cable, and a few buttons for the lcd enclosure.  I have it set up to do datalogging to a pc through a USB port, but I don’t have it running.  I need to get an old PC or laptop to put in the boiler room for that.  Let me know if you have any other questions, and if you go with the arduino board, I’ll gladly share my source code.

Arduino USB Board
Serial Enabled LCD
1-Wire Temperature Sensors
Solid State Relay Board

I'm using the relay board to control these:
Circulator pump
Only allow air handler to turn on if source temp is high enough
Open dump zone automag if source temp gets too high
Turn on air handler if dump zone doesn't bring the temp down

As far as mounting the sensors, I used thermal paste, wrapped the top in tin foil, used a hose clamp to hold it in place, wrapped it all in insulation, then used aluminum tape.  I have found that the sensors read about 6 degrees cooler than my infrared temp sensor.  The boiler guage is another 2 degrees higher, but I think that is because the guage sensor is about half way towards the front and on top of the boiler.


----------



## mwk1000 (Nov 19, 2009)

Thanks,

I think I'll combine both, I have the thermal compound from CPU cooling fans and Ill wrap the whole thing with insulation.

The plan is to leave the controller by the PC and run 1 UTP cat 5 cable down to the tank area. One pair for the sensors one pair for the relay, extra pairs for the future. I'll put one sensor on each leg of the HX. Anybody have an Idea what I could dip them in/paint them with to stick one right in the tank ? I might be able to use the Taylor digitals that I have now, I though there was an option to read from them externally.

It will be enough for some more intellegent control of the tank charging pump. Next I'll want a variable speed pump to control the flow rate from the tank to the HX so I can smoothy load the boiler without killing it. Right now it is still peaking at night and back heating the boiler until it gets down to 154 and the boiler pump shuts off. This way I'll set the boiler to 140 and get a better tank charging shedule in place and stop the backwards heating. Looking forward to it, I have computers everywhere around the house since thats my job. This will be fun - plus getting more mileage out of my wood. Total out of pocket 65$ seems like a no-brainer.


----------



## kabbott (Nov 19, 2009)

I have tried ds-1820s, 1822, 18B20 sensors. I have found the 18B20's to be the best of the lot, The parasite powered sensors are no
good at high temps, start to give read errors at high end of range.

As far as attaching the sensors I use a method similar to Nofossil and find they do read a few degrees lower than a sensor mounted in a well, but
all sensors strapped to the pipes read within a degree or so of each other. If you want to cement them directly to pipe check out thermal cement
for attaching heat sinks. Google Arctic Silver for a start, You should be able to find some info on there website. Here I will add a link.

http://www.arcticsilver.com/products.htm look at the thermal adhesive...


----------



## mwk1000 (Nov 19, 2009)

The thermal compound used for attaching heat sinks to CPU's is what I have and will use. It is perfect for this since it does the same function in a computer. Creates a direct physical contact to a silicon ship tp a metal haet sink to conduct heat at roughly the same temps. Its easy to find at many stores in the computer components section. It makes a measurable diffrence in the efficency of the heatsink so I am hoping it will do the same here.

It is not cement in an adhesive sense so you can remove and replace as often as you need , it does get stiff like putty but thats about it.


----------



## kabbott (Nov 19, 2009)

mwk1000 said:
			
		

> The thermal compound used for attaching heat sinks to CPU's is what I have and will use. It is perfect for this since it does the same function in a computer. Creates a direct physical contact to a silicon ship tp a metal haet sink to conduct heat at roughly the same temps. Its easy to find at many stores in the computer components section. It makes a measurable diffrence in the efficency of the heatsink so I am hoping it will do the same here.
> 
> It is not cement in an adhesive sense so you can remove and replace as often as you need , it does get stiff like putty but thats about it.



True, But I was referring to actual thermal cement, an epoxy that would eliminate the mechanical fasteners.Used for attaching heat sinks without fasteners.


----------



## Nofossil (Nov 19, 2009)

Not to be pedantic here, put from a thermal point of view there's a huge difference between a sensor on a pipe and a heatsink on a CPU. The difference is this: There is an enormous delta T and resulting heat flow in the case of the heatsink and CPU. Properly installed, there is virtually NO delta T or heat flow in the case of the sensor and pipe.

The CPU's heatsink is continually transferring heat to the air, so it's critical to minimize the resistance to the flow of heat. The sensor shouldn't be transferring heat anywhere. With insulation over it, it should happily sit at the exact same temperature as the pipe. If you don't have a good mechanical connection, then the sensor might take a few seconds longer to respond to a sudden change, but it should still very quickly reach equilibrium. The pipe insulation is important. Without it, the sensor will act as a very ineffective heat sink, trying desperately to cool the pipe by transferring heat to the surrounding air. Since it's a poor heat sink, it won't be very effective and will still be pretty close to the pipe temperature.


----------



## kabbott (Nov 19, 2009)

nofossil said:
			
		

> Not to be pedantic here, put from a thermal point of view there's a huge difference between a sensor on a pipe and a heatsink on a CPU. The difference is this: There is an enormous delta T and resulting heat flow in the case of the heatsink and CPU. Properly installed, there is virtually NO delta T or heat flow in the case of the sensor and pipe.
> 
> The CPU's heatsink is continually transferring heat to the air, so it's critical to minimize the resistance to the flow of heat. The sensor shouldn't be transferring heat anywhere. With insulation over it, it should happily sit at the exact same temperature as the pipe. If you don't have a good mechanical connection, then the sensor might take a few seconds longer to respond to a sudden change, but it should still very quickly reach equilibrium. The pipe insulation is important. Without it, the sensor will act as a very ineffective heat sink, trying desperately to cool the pipe by transferring heat to the surrounding air. Since it's a poor heat sink, it won't be very effective and will still be pretty close to the pipe temperature.



Agreed...for the most part

One thing I will add though. The copper conductors that are soldered to the sensor are great way to dissipate the heat. On my sensors that are mounted on a circuit board 
"Nofossil style" this does not seem to be a problem. However the 1-wire sensors that are soldered directly to the wire show an amazing tendency to dissipate the heat and lower
read temps. I have cured this to some extent by zip tie the cable to the pipe for the first several inches. It may be a good idea to mount 1-wire sensors on a small circuit board
also.

My comment on the thermal epoxy was more for the "epoxy" than the "thermal", I think that many epoxies have poor thermal conductivity and may not work so well when eliminating 
the mechanical fasteners.


----------



## mwk1000 (Nov 20, 2009)

Sounds like I'm going to have to try it both ways to satisfy my curiosity! But I take your point , better to expect some minor improvments than something dramatic. Good advice.


----------

