Martin's corner on the web

Hot water tank controller project – part 2

I have finally found some time last weekend to finalize my smart hot water tank controller project, finalized the code and have it now running for a week. I also put up a small and simple html page to control the unit by changing the value of an emoncms.org feed. I have three modes of operation – Off, On and Auto, the controller subscribes itself to that feed and changes its mode of operation based on its value. Code could be extended to fetch setpoints from feed values as well, but I don’t need that right now and hard-coded those.

<!DOCTYPE html>
<html>
<head>
<title>Remote Control</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' href='http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css' />
<script src='http://code.jquery.com/jquery-1.6.4.min.js'></script>
<script src='http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js'></script>
</head>
<body><div data-role='page'><div data-role='header'><h1>Remote control</h1></div>
<form data-ajax='false' action="http://emoncms.org/api/post" method="get">
<br>
Mode:<select data-native-menu='false' name=csv id=csv>
<option value='0'>Off</option>
<option value='1'>On</option>
<option value='2'>Auto</option>
</select><br>
<input type='hidden' name='node' value='4'></input>
<input type='hidden' name='apikey' value='********API************'></input>
<button type='reset'>Reset</button>
<button type='submit'>Set</button>
</form>
</div
</body></html>

Here is a screenshot of the control page on my badly beaten, but trusty phone, I use JQuery for fancy looks:

IMG_2958

IMG_2959

 

2 thoughts on “Hot water tank controller project – part 2

  1. Andy Spencer

    Martin,

    Is that felt-tip pen on your HTC screen?? Please say no 😉

    Anyhow, I follow your posts with interest (have been for many months now).

    I am doing something not so far unrelated – I have 30/58mm panel for HW, backed by excess PV to 1KW immersion when avail (or house can spare if needed), I am just looking into integrating my new pellet stove with back boiler into my system (originally purchased for CH use, but how want to access HW).
    I have a jeenode PID controller (using mainly Jeenode/TinyTX sensors), but think that something more powerful (or distributed) is required for next phase. I use HouseMon rather than emonCMS as I find its a more efficient collection platform on the RPi, but dare not yet let it take over full PID duty (it shadows using a JS module version of my AVR code). Perhaps I will look at a multi-master system using both AVR’s and RPi as masters. Are you intending to implement PID in your solution?

    keep up your interesting posts. Perhaps I’ll make a blog soon to help others as you have done.

    1. Martin Post author

      haha, thats MS Paint helping me out 🙂

      This particular project needs to ensure hot water in predefined time slots, I need rough temperature ranges. PID is probably more appropriate for applications where precise temperature control is necessary, but I haven’t had that need yet. Is seems like an interesting project to try, unfortunately I will have considerably less free time for hobby fun in the foreseeable future compared to what I had up to couple weeks ago..

      I’m pretty disappointed with the Raspberry Pi in terms of reliability, I think wireless enabled AVR projects that connect both ways to a Internet gateway are the way to go. In my view, it makes most sense that the ‘brains’ reside on the cloud and issue commands to the little, relatively brainless AVR drones that will carry them out

      Go ahead with starting a blog, I myself have been inspired to do so by people that stand out and have always hoped to inspire others in turn. Sharing your experience, successes and failures is rewarding in unexpected ways.