David Prilutsky JSHS

20
Web-Enabled Programmable Water Heater Controller (Heatduino) David Prilutsky McNair Academic High School Jersey City, NJ January 1, 2013

description

 

Transcript of David Prilutsky JSHS

Page 1: David Prilutsky JSHS

Web-Enabled Programmable Water Heater Controller (Heatduino)

David Prilutsky

McNair Academic High School

Jersey City, NJ

January 1, 2013

Page 2: David Prilutsky JSHS

Abstract Heatduino is a new microprocessor-based technology developed to save energy wasted

by conventional water heaters keeping water warm when it isn't needed.

Whole house water heaters (WH) maintain a given water temperature regardless of

whether or not the water is used. WH temperature controls are mechanical devices; water

heaters can't be programmed to shut down at night or operated remotely (consider you

forget to turn heat off when leaving on vacation). This leads to a not optimal water

temperature control and unnecessary energy waste.

To optimize temperature control and decrease used energy we developed Heatduino –

programmable internet enabled remote control for a WH. Heatduino works in combination

with any existing WH control, safe to use, and simple to install. Heatduino allows

for programming any WH to save energy at night when water is not used, and remotely change

WH's temperature with the use of a smart phone or computer.

Heatduino controls WH with a servo connected to the WH's control. Servo control block

is implemented with Arduino microprocessor. Additional Ethernet Shield is used for

remote connectivity. Heatduino software was developed with C++ language and utilized

Ethernet, Nettime, and servo libraries. Programming included implementation of simple

proprietary web server and control logic. Client implementation is based on HTML, AJAX, and

Java script technologies.

Initial estimates and tests show the Heatduino technology can save up to 19% during

night hours and present much greater savings (70%) when used for vacation properties.

Heatduino is simple to install, costs under $50, can be implemented in a majority of homes.

Page 3: David Prilutsky JSHS

Acknowledgements I would like to thank Mr. Jeremy Stanton for his help, advice, and support during my

research. And most importantly, I would like to thank my parents Dr. Roman Prilutsky and Lilia

Bloch for their continued encouragement and invaluable assistance.

Page 4: David Prilutsky JSHS

Introduction Every private house in the US heats its own water. Conventional tanked whole house

water heaters (WH) maintain a given water temperature set on the WH’s controls. Most WHs

are installed in hard to reach locations (basements, closets, etc) and WH controls are

inconveniently located close to the floor. WH temperature controls are mechanical devices and

can be neither programmed nor operated remotely. This results in most of the installed WHs

operating at a constant temperature set at the install time, needlessly heating water through

the nights and when the houses are not being used.

To eliminate unnecessary energy waste and achieve the optimal temperature

management of the WH, we developed a new microprocessor-based controller that would save

energy wasted by conventional WHs by turning the water heat off if it isn’t needed. Our goal for

this project was to create an easy to install, inexpensive, user friendly water heater controller to

significantly decrease WH energy consumption. To develop this technology we used an Arduino

UNO microcontroller (hence the project is called “Heatduino”).

Methods and Materials

General Heatduino functionality requirements

To achieve maximum energy savings Heatduino needed to have several capabilities.

First, we wanted Heatduino to allow for the programming of any WH to turn OFF at night and

turn ON in the morning automatically. Secondly, we wanted to be able to change WH’s

temperature remotely, with the use of a smart phone or a computer. The later we needed in

case a user forgot to turn off the WH leaving the house for a long period of time. Finally, we

Page 5: David Prilutsky JSHS

wanted Heatduino to have a Manual mode of operation to provide a backward compatibility

with the original control and to be used in case the remote connectivity with the Heatduino

fails.

Since we wanted Heatduino to work with most of available WH models, we designed

the Heatduino to control the WH mechanically. A servo controlled by the Arduino UNO would

change the position of the WH’s control knob changing WH target temperature and switching it

OFF when hot water is not needed.

Estimated energy savings

Before designing and building the new WH controller Heatduino, we needed to estimate

the potential energy saving that could come from turning OFF the water heater at night and

when a property was not used during longer period of time (vacation property).

Night energy savings

The potential energy saving from switching the WH off at night can be estimated from

Newton’s Law of Cooling.

(1)

Where:

- the temperature of the water at a given time,

- the ambient temperature,

- the maximum temperature the water was heated to,

k - the coefficient of thermal conductivity,

t - the time the water was cooling to reach temperature

Since we didn’t know the value of k, we had to determine it from an experiment (Mike

Pauken, 2011. Thermodynamics For Dummies). We heated the WH to the target temperature

Page 6: David Prilutsky JSHS

F, turned the heat off, and measured the water temperature with the use of a cooking

thermometer. Next, after waiting for 3 hours, we measured the water temperature again to

have another point on the water cooling curve. It turned out that with our Rheem 40 gallon

natural gas WH the water cooled down to the level of . The measurements were

taken with the use of two digital household thermometers and the results were averaged out.

Now knowing the two values of the water cooling curve, we could establish the value of

k by solving (1) for k:

After plugging in values t = 3h; ; ; ; the value of k was

determined as 0.0741. While an ambient temperature of 55F seems to be low we’d like to note

that most of the common HWs are installed in basements and 55F is within the ballpark of

basement temperatures during winter time, as it was in our case.

Now, based on (1) we can project the temperature of the water in the WH at any given

time once the water heater is switched off. Given that the period of time when the WH is not

used at night might be around 6 hours, we can calculate that the temperature at the end of the

night will be around 99.8 F.

Now the total heat (energy) loss lost by the cooling water can be calculated based on:

(2)

Where:

m – mass of water in the WH

c – specific heat of water

Page 7: David Prilutsky JSHS

Using 99.8 F as the projected at the end of the night, we can determine that the total

heat lost over night (and respectively heat required to bring the temperature back to the

target) will be 8402.3 BTU. Since the heating process is much faster than cooling we can ignore

the fact that water actually cools while being heated and safely assume that we will need the

same amount of heat to bring the water temperature back up to 125F as the water lost while

cooling down - 8402.3 BTU.

Let compare it with the heat required to maintain the water at the constant

temperature of 125F throughout the 6 hour night. The Total heat lost in BTU/Hr through the

WH (and therefore replaced by the WH’s gas burner) can be modeled by:

(3)

Where:

R - a measure of thermal resistance used in the building and construction industry

A - total surface area of the WH

Since WHs are insulated unevenly, we don’t know the real value of R, but we can

calculate it based on the following:

As shown in [1] R can be estimated as

(4)

Where

A - total surface area of the WH,

m – mass of the water,

c – specific heat of the water

k – Coefficient of thermal conductivity

Page 8: David Prilutsky JSHS

Then, given the surface area of the WH is about 24.73 ft squared and it holds about 40

gallons of water (m = 8.36 * 40 Lb), R = 0.9978 or roughly R = 1. It is interesting to note that the

manual for the WH indicates that the WH tank is insulated with insulation R = 8 (Water

Heater, Use and Care Manual). At the same time the manual doesn’t mention that not the

entire area of the tank in insulated, particularly the area of the tank that gets heated by the

burner is naturally not covered with insulation as well as the area where pipes exit the WH. As

we can see, that substantially decreases the overall effectiveness of the insulation. The same

point may be used to decide whether it makes sense to spend money on premium insulation of

WHs which are generally more expensive but may provide little to no energy savings. It seems

like premium WHs will be prone to the same insulation ineffectiveness due to the reasons

above.

Now we can calculate the amount of heat required to maintain the water at a constant

temperature of 125F in my WH. Plugging the values into (3) we can calculate the amount of

heat will be equal to 10408 BTU. So, at this point, we have two values. The amount of heat

required to maintain the water at a constant temperature of 125 F (10408 BTU) and the

amount of heat we need to bring the water back to the original temperature after night

cooling(8402.3 BTU). With this, we can estimate our savings if we switch the water heater off

for the night.

Savings = (10408 BTU- 8402.3BTU)/10408 BTU

As shown, the estimated savings will be around 19%.

Page 9: David Prilutsky JSHS

Five out of seven days savings

Since our design was focused primarily on vacation residences it made sense to estimate

savings for a typical vacation house used only 5 out of 7 days a week. This ratio was taken from

our own experience of our vacation property use. (Needless to say that the entire work was

inspired by the wasteful energy use of our vacation house)

Following the same logic, we estimated our savings if the WH was used only 2 days out

of seven or, in other words, if it was operational only on the weekends. It has been shown that

over a seven day period, we can save up to 70% of energy comparing to the situation where it

maintains a constant temperature over the entire period of time. Given the average cost of

running a WH is about $400-$500 a year [7], we can expect a saving of at least $280 a year in

total per single water heater with the use of the technology detailed below. This gave a clear

indication that a new intelligent WH control not only would pay for itself but will also result in

significant savings.

Components

In order to build a device that controls a WH automatically or based on remote input,

we are going to need the following components:

1. Microprocessor with the ability to be controlled over the internet

2. Servo capable of turning a WH control knob through a standard push rod mechanism

3. Potentiometer with a knob for operation of the servo in a manual mode

4. LED with a load resistor for mode indication

5. Two position switch for switching the controller’s mode of operation (Manual/Auto)

6. Box and other hardware for the controller installation on the water heater.

Elements of the developed and installed system are shown in Figure 1.

Page 10: David Prilutsky JSHS

To keep the cost low, we decided we to use Arduino as a microprocessor control block, one of

the most popular microprosesors available on the market. One of the biggest advantages of

Arduino is that it can be easily programmed with C++ language (Bjarne Stroustrup, 2000.The

C++ Programming Language) and a significant amount of programming libraries are available as

well under open source license. Additionally, Arduino is very inexpensive and the total cost of

the Arduino board with internet shield was just over $30. Given that the control knob of the

WH is fairly easy to turn, practically any standard RC servo with standard torque is capable of

turning it easily. We opted for a Futaba FP-913H servo that we bought on E-Bay for $5.

Including all parts our total component bill was under $50.

Heatduino Control Module

Potentiometer – Manual Mode

LED – Mode Indicator

Mode Switch Control Servo

WH Mechanical Controller

Temperature Adjustment Knob

Heatduino – WH Controller Linkage

Fig 1. Heatduino Components

Page 11: David Prilutsky JSHS

Heatduino Electrical Circuit and Schematics

The heart of the Heatduino microprocessor system is the Arduino Uno microprocessor

(Arduino web site, http://www.arduino.cc). Arduino is capable of maintaining 15 digital

input/outputs and seven A0-A6 analog inputs (see Fig. 2) (Michel Margolis 2011. Arduino

Cookbook). To indicate the mode of the device, we used an LED diode with a load limiting

resistor which was connected to digital pin 7. By controlling the state of the pin, High/Low, we

could make the LED switch On/Off, blink, etc. The middle terminal of switch SW1 was

connected to the digital pin 7 which worked in input mode. By switching the switch SW1 we

could bring either High or Low voltage to the pin 7. The state of it determined our mode of

operation. The middle terminal of potentiometer P1 was connected to the analog pin A0 while

the other two terminals were connected to the Hot and Ground wires of a power source. This

way the middle terminal of the potentiometer splits the potential difference proportionally to

the position of the potentiometer’s shaft. We use this to control the position of the control

servo if manual operation is required. The Signal wire of the control servo was connected to the

digital pin 9 which provides standard IPCM input to the servo. The other two wires of the servo

are connected to the power and ground terminals of the board. During the development

process we powered the board from the USB port of the computer. The final design is powered

by an independent power adaptor which we made from a cell phone charger.

Page 12: David Prilutsky JSHS

The schematic of Heatduino is presented in Fig. 3 below

P1

SW1

LED1

Fig3. Heatduino schematic

P1

SW1

Servo

LED1

Current limiting resistor

Fig 2. Heatduino electrical circuit

Page 13: David Prilutsky JSHS

Heatduino Software Implementation

Code for the Heatduino implementation is available on http://code.google.com/p/heatduino/

Heatduino operates in the following modes selected by the switch SW1:

Manual mode

Since control knob of the WH is linked to the control servo, user can no longer adjust

the temperature manually and we need to provide the same functionality by forcing the control

servo to turn the WH knob based on a manual input from the user. This might be required in

case if the internet connection is lost. This was accomplished by having the user turn a

potentiometer and using our microprocessor to turn the servo proportionally.

As shown on Fig. 1 and Fig. 2 SW1 is connected to the digital pin 7 of Arduino. When the

value of the pin is HIGH the system considers that the Heatduino is in manual mode. In this

mode, the software constantly monitors the potential difference on the analog pin A0 and

maps it into the appropriate value between Max and Min positions of the control servo. When

the potentiometer is turned the potential difference is changing, forcing the microprocessor to

change the position of the servo proportionally. The same mode may be used to tune the entire

controller for the servo’s Max and Min values since they depend on the length ratio of the

control arms. Since the servo has a lot of power and doesn’t really require any leverage in this

implementation, we tried to make the control horns of the knob and the servo approximately

the same size.

Page 14: David Prilutsky JSHS

Automatic mode

In this mode, water temperature of the WH is controlled remotely from a remote web-

based client application that talks to the Arduino microprosesor over the internet.

To accomplish this kind of communication we had to create our own simple

implementation of a web server that runs as a part of Arduino server software (the web server

implementation was limited to responding only to the GET requests since there is no need for

us to support POST requests). The web server accepts requests from a remote client (Fig. 4)

Heatduino Web Server

Updated STATE

Structure

Control Logic

Servo Postion

Update State Process

User Interface

User Input

Update state API call/Parameter update call

XML file with the current STAE stucture

Change temperature, mode, state

Changes to the system state

Received API call is parsed and STATE is updated

STATE is used as an input for the Control Logic Blockto determine the servo position for the current mode and

temperatures request

Calculated server input is passed the control servo to adjust current temperature

Heatduino Server Heatduino Web Client

Fig 4. Heatduino Client – Server Communications

Page 15: David Prilutsky JSHS

and updates STATE structure which in turn controls logic of server control module (SCM). SCM

analyzes values of the elements of the STATE structure (night mode flag, home/away flag, etc.)

and determines necessary position of the servo arm.

Client software was implemented with HTML technology available from any browser.

This way, we don’t have to redistribute client software and anyone who has a browser, or

mobile phone, will be able to access the Heatduino server.

Since resources of Arduino are very limited we really can’t keep the client’s HTML code

inside the Arduino, we have to use some other repository to download the client’s code into

the browser. Since we keep the client’s code on the Google code server, when the load request

comes to the web server, the Arduino redirects the request to the Google server and the

browser downloads the code from there.

Users provide input via web-based

GUI ( Fig 5).

The request could be temperature

up, temp down, night mode on/off,

home/away. From the user’s perspective,

when we turn the temperature up, the

servo should turn the knob towards a

temperature increase (down - towards

decrease), and when we switch the system

to the AWAY mode we want the servo to

Fig 5. Heatduino Web Client GUI

Page 16: David Prilutsky JSHS

turn the knob to the VAC position (vacation).

Client communicates with the server with the following API string:

http://server_address/state.xml?parameter=value

Where:

parameter - could be any element of the STATE structure (see all the values in the code)

and value is one of the acceptable values for the parameter. For instance

http://server_address/state.xml?nightMode=1

will switch the Night Saving mode ON.

On each API request, the Heatduino web server responds with a XML presentation of

the entire STATE structure, so the client can update the current values presented to the user.

This approach allows us to expand the API in the future in case we want to have more

commands, such as synchronizing our WH with Google calendar or any other outside

scheduling server.

Network Configuration

To be able to communicate with Heatduino outside of the local LAN, we configured

DYNDNS services on the router. We made Heatduino server to listen on port 91 and configured

the router’s virtual server table to pass all the requests that came to port 91 over to the

Heatduino. With this configuration we can access our Heatduino server from anywhere in the

world as long as port number 91 is not blocked by a firewall.

Page 17: David Prilutsky JSHS

Results As a result of this project we created a new technology that allows for an optimal

control of the conventional house WH. The technology was designed to be used with a WH

having a mechanical controller which constitutes the majority of the today’s market. It is

estimated that this may bring savings of at least of 19% for WHs installed in primary residences

and 70% for secondary residences if they are used two out of seven days a week. The three

months of deployment have proven that the system works reliably and comparison of the

monthly gas bills showed some decrease in cost from the similar months last year. Feedback

from the user base (my Mom primarily) was also positive with some constructive suggestions.

Overall cost of the development was under $50 (everything was purchased on eBay) and was

far below the budget number $100 (allocated for the project by my parents). It is expected that

the Heatduino controller will not only pay for itself within the next couple of months but will

also result in significant savings in the future.

Discussion Current WH controllers are built on outdated mechanical technologies and do not allow

for an automated cost efficient control. Most of the WHs are installed in hard to access places,

“out of the way”. WH controls are typically located at the lower parts of WHs which makes it

difficult to use them. As a result, in most of the households no adjustments to the water

temperature are ever made and we suspect that, in most cases, residents would not even know

where the water heater is. Creation of the automated controllers that work as add-ons to the

existing ones has been shown in this paper to bring significant savings in the energy used as

well as decreases in the energy bill. These controllers, as the one described, are inexpensive

Page 18: David Prilutsky JSHS

and require only limited testing since they don’t replace existing certified ones but rather work

as an additional piece of equipment, failure of which brings no harm to entire system. On the

other hand, the use of the described controller improves the user experience, making

adjustments to the water temperature easier, eliminating unnecessary trips to the basement

and getting down on your knees to adjust the WH control knob position. Temperature can be

easily adjusted remotely to accommodate for certain family events such as guests staying over

(hotter temperature setting will provide more water) as well as shutting the water off when the

house is not in use. WHs can also be switched on remotely before residents return back to the

house so they can enjoy hot water right from the start without the necessary wait for the water

to heat up. Night saving mode of the Heatduino is projected to save 19% of the energy just by

shutting WH down at night hours. This is not a feasible option with current mechanical systems.

The field tests of the system proved that mechanical link to the existing controller from

Heatduino are reliable enough for day to day operations. From a user interface point of view, it

was discovered that certain additional features may be required in the future. In particular,

users should be able to adjust hours of the night when the WH is off and, for certain vacation

houses, it might be beneficial to link the system with calendar applications such as Google

Calendar. In this case the user would not have to remember to turn the heat on/off even

remotely when they leave or return to the house.

With the use of the modern WH controllers, such as Honeywell Electronic Water Heater

Controller ( Bradford White 239-46990-01 Icon Natural Gas Residential Control Valve for MI75S,

M2XR75S, MI100T. http://www.completeplumbingsource.com/bradford-white-239-46990-01-

icon-natural-gas-residential-control-valve-for-mi75s-m2xr75s-mi100t), the need for moving

parts and control servos may be eliminated by interfacing Heatduino directly with COM port of

WH controllers. Unfortunately details of COM protocols are proprietary and we were unable to

interface with these types of controls. We hope that as companies like Honeywell begin making

Page 19: David Prilutsky JSHS

their control protocols available to the public, we will be able to develop new releases of

Heatduino that will be even less expensive than the one that interfaces with the mechanical

water heater control.

Conclusion While scientists and humans are looking for new sources of energy, prevention of global

warming and new more efficient ways of utilizing existing energy resources, small things that

we use in our day-to-day lives are often overlooked. Conventional WHs with outdated

mechanical controls installed in almost every house through United States is a good example of

it. Even the simple computer controlled device discussed in this paper is capable of bringing

savings in energy use in the area of 19% to each household. Based on the example described in

the paper, the savings may result in up to a $95 a year per household in a primary residence

and substantially more in a secondary residence.

Page 20: David Prilutsky JSHS

Bibliography 1. Josuttis, Nicolai M. 2012.The C++ Standard Library: A Tutorial and Reference. 2nd

ed. Addison-Wesley Professional

2. Ford, Jerry Lee 2008. Ajax Programming for the Absolute Beginner (No Experience Required

(Course Technology)). 1st ed. Course Technology PTR

3. Margolis, Michael 2011. Arduino Cookbook. 2nd ed. O’Reily Media

4. Pauken, Mike 2011. Thermodynamics For Dummies. 1st ed. For Dummies

5. Stroustrup, Bjarne, 2000.The C++ Programming Language. 3rd ed. Addison-Wesley

Professional

6. Arduino web site. <http://www.arduino.cc>

7. Bradford White 239-46990-01 Icon Natural Gas Residential Control Valve for MI75S,

M2XR75S, MI100T. <http://www.completeplumbingsource.com/bradford-white-239-46990-01-

icon-natural-gas-residential-control-valve-for-mi75s-m2xr75s-mi100t>

8. Water Heater, Use and Care Manual. < http://www.rheem.com/documents/fury-gas-canada-

guardian-use-and-manual >