Home Heating Monitor Version 2: December 2011 - February 2012
As described on the main page, Version 1 of this project was a failure due to my choosing a crummy controller.
I finally decided to reboot the project with a pretty substantial redesign using open-source projects.
Additionally, I wanted to add some monitoring of the Outdoor wood boiler that we installed between V1 and V2 of this project.
- Distributed sensing using the Arduino ($30) and Teensy ($20) controllers connected via RS485.
- Uploading measurement data in real-time to my webserver (v1 stored the data on the microcontroller until it was retrieved)
- Viewing the crunched data in a web browser (v1 used a custom Windows app, which has limited utility)
To see a live display of the data, go to http://www.dlwrr.com/hhm/
Dataflow is right to left:
While it may initially seem more complex to have multiple devices connected via RS485, it's actually simpler to construct and debug because each controller (Teensy and Uno) runs a simpler program.
- Simple devices based on Teensy controllers (running as Teensyduinos) monitor the heatpump relays and various system temperatures, then send measurements to the main controller (an Arduino Uno) via RS485.
- The Uno acts as an RS485-to-Ethernet converter (via an Arduino Ethernet shield), forwarding the data (via an HTTP POST) to the webserver.
- The webserver stores the data and formats it when a browser loads a webpage.
Additionally, storing the data on a webserver is easier than storing it in an embedded device, and rendering the display in HTML is more flexible than doing it in a Windows app.
For the heat pump monitors I recycled the PVC optocouplers from V1. However, instead of running long wires to a central CPU, I co-located a Teensy on the board:
There are two of these devices, one mounted on each relay unit. The PC board and program are identical for both.
The Teensy's A/D converters monitor the IR Xstr outputs to detect when a particular LED is on or off.
Here's the final installation:
The blue/white wires are the RS485 pair; the black wires are 12v power which is regulated on board to 5v.
These devices were actually the hardest part of the whole system to get working correctly. The hardware was pretty straightforward, but I went thru over 20 revisions of the firmware before I got it right.
The most challenging part is that it was surprisingly hard to accurately monitor the LEDs. At first I ran the processor inputs as digital, but they were continuously flipping on and off. So I changed to analog mode, which reads the sensors' voltage on a scale of 0 to 1024 (0v to 5v).
But even then I found that, wehn the LED was on, the A/D readings would fluctuate, almost as of the LED's intensity were varying. This was the cause of the digitl inputs' craziness, but was hard to interpret in analog mode. I finally evolved into an algorithm that provides hysteresis and that solved it.
One other variable that I found is that the IR transistors were sensitive to the lightbulb in the heater room. Even though the sensors are embedded in the PVC tubes, when the room light is turned on the sensors see that light and their readings drop by about 5%. So I made a light shroud by encasing the PVC optocouplers in black electrical tape :)
Here's the master unit, based upon the Arduino Uno:
This is actually a stack of three boards:
- At the bottom is the Uno, which manages everything (the Uno is hidden by the Ethernet shield).
- In the middle is the Arduino Ethernet shield (notice the CAT5 cable plugged into it)
- On top is my custom RS485 and power board. This converts the differential RS485 signal to TTL which is fed serially to the Uno.
As noted above, the Uno POSTS the sensor data to the webserver. Here's what the server receives:
This received data is parsed by a PHP script which stores the data in a MySQL database for retrieval when the data-display page loads.
A new addition for V2 is a temperature sensor which watches:
Just for fun, I added an LCD display to the temperature sensor:
- OWB: The temperature of the water coming in from the outdoor wood boiler.
This typically ranges from 170 to 190 degrees F. If it falls below 170° that means that the boiler is out of fuel.
- OIL: The temperature of the water leaving the oil boiler.
This will fall as the house draws heat and causes the heat pumps to turn on.
- AIR: The outdoor air temperature.
This is an indicator of how much heat the OWB will need to generate.
It has a cool backlight so you can read it in the dark:
Here you can see that the OWB is 163°, the OIL is 133°, and the AIR (outdoor) temperature is 45°
I got the LCD for $10 at adafruit.com.
As a bonus, Adafruit has a step-by-step tutorial for using the LCD with an Arduino!
Here's the temperature board with the LCD removed, showing the Teensy and wire connectors:
The board is about 1.5" tall and 3.5" wide, the exact same footprint as the LCD.
The temperature sensors are TMP36 parts in a that I also bought for $2 each from Adafruit.
I soldered the TMP36 leads to ribbon wire and shrinkwrapped the connections.
As usual, Adafruit has a tutorial for using the TMP36 with an Arduino.
I attached the OWB and OIL sensors to copper pipes:
I drilled a small hole in the house wall (!) for the AIR temp sensor:
I lined the hole with a small PVC tube in order to make it easy to thread the wire and sensor thru the drill hole.
Here you can see the wire and sensor sticking out of the tube.
The green thing above it is the fresh air intake for the oil furnace.
Here's the AIR sensor in it's final position:
Ever since I first saw the temperatures on the LCD (which was long before I could see them online), I've been bothered by the fact that my OWB temp was much lower than the temperature displayed on the wood boiler itself, and by the 20° differential between the OWB and OPL temps.
Whay was I seeing such big dropoffs? Were my sensors and/or my firmware reliable? Was I really losing 15° of heat between the OWB and the house? Was the heat exchanger really so inefficient that I was losing 20° of heat between the OWB and the OIL?
In this graph, the OWB temp should be higher and the difference between the OWB and OIL should be much less than 20°:
I guessed the cause might be that while the OWB and OIL sensors were tightly strapped to the pipe, there was some heat loss due to the backs of the sensor being exposed to air.
As an experiment, I encased the sensors in pipe insulation:
I instantly saw a jump in both temps.
OWB increased 15° (now only 5° less than the boiler's display) and the OIL jumped 20° (now only 8° less than OWB, a much more plausible value).
The next thing I need to solve is the volatility of my AIR sensor.
Notice how the temperature varies from 73° to 49° in the span of 18 minutes:
This is due to the sun.
My sensor is mounted on the south-facing wall of the house; when it's cloudy or dark, the sensor measures the air temp accurately. But when the sun comes out, it shines directly on the sensor and the measured temperature jumps dramatically.
The solution would seem to be adding a shroud over the sensor. I'll get to it eventually :)
That's about all there is to the hardware and firmware part of the project. It took a while to get it all working correctly, but now it just hums along, continuously sending data to the webserver.
More stuff! - December 2012
I'm somewhat obsessed with monitoring the system - I found that I'd lie in bed at night wondering if the boiler was functioning or if the fire had gone out. The fire actually does die once in a while, particularly when it's warm out and the house doesn't draw much heat, and it's a bummer to be surprised by a lukewarm shower on a cold winter's morning.
My solution was to build a temperature display box (sorry for the blurry pic):
Of course it's just not any old box this uses WiFi to fetch the current OWB temperature every 30 seconds!
The small box sits on the windowsill, where I can easily see it lying in bed.
Here the temp is 178° - normal operating range seems to be between 156° and 182° (see the green line here). The underline at the left shows that the temp has fallen since the last reading (the top bar is lit when the temp is rising).
Additionally, the box has an audible alarm (a piezo buzzer, like in a smoke detector) that sounds when the temp falls below 150°, which is a certain sign that the fire has died. While developing this, I had the threshold temperature too high and there were a few false alarms at 3AM... I eventually got it right, and my wife is very patient. The switch on the top-right disables the alarm :)
Finally, the circle to the top-left of the display is a light sensor: the display is bright when the room is bright and dim when it's dark.
Here's what's inside the box:
From left to right: Arduino Uno, Arduino WiFi shield, my custom shield for the display, and the box. This was an early design: the pushbutton has been replaced by a switch.
Also note the red tape on the display: This thing is BRIGHT even at it's lowest setting. The first night our room was lit up like a blue candle (again, my wife is patient...)
My solution was to put a few layers of automovie lens repair tape over the display... the stuff is pretty thick and semi-opaque. Thru several nights' of experimentation I found that 3 layers of tape was the right amount.
So now I sleep soundly at night, able to check how things are working with a quick glance whenever I roll over.
Still more new stuff! - December 2014
The OWB occasionally dies, either due to the fire going out or because I didn't load enough wood. When this happens, the OWB temperature drops, causing the house to demand more heat, which causes the OWB temperature to drop even faster. If the OWB temperature drops below 150° the house can't maintain it's temperature: all the zones turn on!
When this happens, I turn on the oil burner to bring the system back up to temperature, then relight the OWB, then wait a few hours for the OWB to get back up to 190°, then I can turn the oil burner off. I can't turn the oil off until the OWB gets up to temperature because the house would steal all the OWB heat and it takes FOREVER to get the OWB back up to full temperature.
I was originally doing this by disconnecting the oil controller's AC power.
But it's not a good thing to do when the furnace is running. You need to wait for the furnace to shut itself off before disconnecting it.
It sure would be nice if the system could automatically switch between oil and wood based upon the OWB temperature; that would allow me to not have to scramble in the middle of the night when the fire goes out, and even go away for a few days without needing to do anything to the system.
After some experimentation, I discovered that this terminal strip on the oil burner's control panel enables the oil burner:
It comes from the factory with a jumper wire: the oil is permanently on.
I found that it's safe to disconnect this when the burner is running, as the oil controller will gracefully shut down.
It occurred to me that since I already know the OWB temperature, I could rig up something to automatically connect and disconnect these terminals, and here's what I created:
This doohickey puts a relay across the oil controller's terminals and is controlled by a toggle switch and the temperature sensor:
And if the HHM power fails, the relay automatically closes, setting the furnace to oil.
- When the OWB falls below 165° it automatically turns on the oil burner (yellow LED)
- When the OWB rises above 185° it automatically shuts the oil burner off (green LED).
- Putting the switch in "MAN" position forces the oil burner on (red LED), useful for when the furnace serviceman is here.
And of course it has LEDs to tell you what it's thinking.
I updated the main HHM page to show the current heat source (same as the LED on the little control board):
- indicates the the system has automatically selected the OWB as the heat source
- indicates the OWB temperature is low and the system has automatically enabled the oil burner
- indicates the the Manual Oil switch is enabled, forcing the system to burn oil regardless of the OWB temperature
Here's a graph of the system switching to auto-oil mode then back to auto-wood mode:
When the boiler is low on wood (1st thing in the AM) and it's really cold out (2° at the time), the OWB takes a while to get back up to temperature (the load of wood is 2°, plus it takes energy to start it burning).
So the system detected the low OWB temp and switched to oil for about 2 hours in order to help the OWB heat back up. Without the oil, it would take at least 6 hours to get back up to temperature.
Questions? Comments? email me!