Netduino Saves Marriage - fixes hot water - Netduino 2 (and Netduino 1) - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino Saves Marriage - fixes hot water


  • Please log in to reply
4 replies to this topic

#1 Jack Chidley

Jack Chidley

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 22 March 2013 - 12:05 PM

Ah, there are so many impressive people and projects here. What I have done is neither but it is why I love these devices: I used them to do a simple ugly hack to fix the hot water in my house.  I have extended my computer skills into the real world.  Amazing.


Background

I have a combination gas boiler in my home.  Owing to some manufacturing or design defect, every couple of years the hot water breaks down.  This is because the internal switch for DWH (Direct Hot Water) fails.  I’ve tried everything in the past but the only reliable fix is to replace a fairly substantial assembly costing over £100. 


It not the money, the scraped fingers, the swearing, the tears (mine) whilst replacing it.  It’s the business critically of the service.  When the thing breaks, the hot water suddenly goes cold when my wife is in the shower.


So I put together the ugliest of ugly hacks with a Netduino, a water flow sensor (http://proto-pic.co....er-flow-sensor/), a simple relay and a bunch of plumbing items.


Oh, and this code. 
Can you tell that I don’t do this for a living?

 

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace NPlus_Water{    public class Program    {        static long pulsebuffer = 0;        public static long totalPulse = 0;        const int samplingPeriod = 500;   // 1 second        public static void Main()        {            InterruptPort FlowMeterPulse = new InterruptPort(Pins.GPIO_PIN_D7, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);            FlowMeterPulse.OnInterrupt += new NativeEventHandler(FlowMeterPulse_OnInterrupt);            bool flowLastPeriod = false;            bool flowThisPeriod = false;            OutputPort hotWater = new OutputPort(Pins.GPIO_PIN_D13, false);            while (true)            {                WaitUntilNextPeriod(samplingPeriod);                if (pulsebuffer > 10)                {                    flowThisPeriod = true;                }                else                {                    flowThisPeriod = false;                }                if (flowThisPeriod && flowLastPeriod)                {                    hotWater.Write(true);                }                else if (!flowThisPeriod && !flowLastPeriod)                {                    hotWater.Write(false);                                }                flowLastPeriod = flowThisPeriod;                Debug.Print("Pulses: " + pulsebuffer.ToString());                totalPulse += pulsebuffer;                pulsebuffer = 0;            }        }                public static void FlowMeterPulse_OnInterrupt(uint data1, uint data2, DateTime time)        {            pulsebuffer++;        }            static void WaitUntilNextPeriod(int period)            {            long now = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;            var offset = (int)(now % period);            int delay = period - offset;            Debug.Print("sleep for " + delay + " msrn");            Thread.Sleep(delay);        }    }}

 

Here’s the thing.  It has worked without a hitch and was a lot less expensive than the commercial part.  And I did it myself with the support of this community: the various posts, the books, the inspiration (Cuno’s code).

 

Of course, I don’t let the wife see how appalling and flimsy the whole arrangement is.

 

Two pictures - One is where "the brains" plugs into the boiler instead of the old DHW switch.  The other is "the brains": Neduino, flow meter, switch, etc.

 

Attached Files


Edited by Jack Chidley, 22 March 2013 - 02:09 PM.


#2 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 22 March 2013 - 03:18 PM

That's great... but just wait for that time when the water goes cold and it's because of a bug in your code. Then you'll be in trouble.

 

Yesterday evening I managed to accidentally vent my laser cutter back through the cooker extractor hood rather than outside. I filled the house with the smell of melting acrylic. My wife was still fuming about it when I went to bed later.



#3 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 22 March 2013 - 04:20 PM

Well done Jack. Wife has hot water so you're not in it! I would add some comments to the code to help you understand it in the furure. Any plans to extend it further? Heating control coupled with Ethernet access, external temperature / sun shine sensor for "adaptive" control, ... Paul

#4 Jack Chidley

Jack Chidley

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 22 March 2013 - 07:17 PM

Actually, yes.  Pretty much all of the above (not the sun shine bit) and geothermal heating.  Many plans.  Little time.



#5 Jack Chidley

Jack Chidley

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 22 March 2013 - 07:23 PM

 I managed to accidentally vent my laser cutter back through the cooker extractor hood rather than outside. I filled the house with the smell of melting acrylic.

 

I've tried but I just can't think of a viable alternative explanation.  "I set fire to the salad spinner whilst I was cooking your dinner"?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.