Steve's website

This is our simple website - running on a beaglebone black, it hosts our favourite recipes and cakes, and things that interest us. There's an area for the kids for when they start to learn computing at school, and a personal blog for us all

House Automation

    Immersion Heater Control

  1. immersion_control.pdf
  2. My first foray into the internet of things - built upon and arduino Mega 2560 board with the aim of controlling my immersion heater without the need to go out to the internet, for those times when I have a surplus of solar energy. The board has a number of functions added to control and monitor my immersion heater. The basic board controls a 16A relay unit a LED and communicates via a wifi connection. It has a button which resets the system and a couple TMP36 temperature sensors, accurate to a tenth of a degree.

    The sketch to control these responds to the following HTML commands :

        immersion/relay-on
        immersion/relay-off
        immersion/status
        immersion/led-on
        immersion/led-off
        immersion/reset
        immersion/temp1
        immersion/temp2
        immersion/alltemp
        immersion/hourdata
    
    

    The temperature is reported as a value between 0 and 1023. To get the mV the value needs to be converted by dividing by 1024 and multiplying by 5000 (5V). The mV then need to be converted to degrees by subtracting 500, then dividing by 10.

    I did find some of the arduino sketch string manipulation routines a little dodgy, and took some debugging, but it does now seem to work. The IDE is also a little flaky in terms of permissions - you need X11 to access the GUI but root authority to upload to the device, but maybe that's the way I installed it.

    Further updates were needed. First it died at some point and didn't recover, so I implemented a watchdog counter which resets after a number of seconds of not being updated, which also allowed me to implement a software reset. I also noted that the temperature did fluctuate, so I averaged the temp over a second to get more consistency. I then decided that it was bad to query it so many time a minute to get sensible data, so I keep a rolling log of temperature every 5 seconds for an hour (the limitation being the memory capacity to store the info). I can then query a whole hours worth of data in one call - much more sensible