What’s this about?
This is the UK website for Peter and Maureen Scargill. We live in the Northeast of England and also Andalucia in Spain.

Read through the blog entries, menu-accessible pages and archives if you're interested! Welcome to Peter and Maureen's website.

Get in touch via Facebook My Facebook Page
You should follow me on Twitter Follow me on Twitter
Join my LinkedIn network Join my network

Pete's Online CV
Archives

Posts Tagged ‘SAD light and more.’

Cottage Thermostat

If you’ve been keeping up I’ve spent all my spare time recently getting to grips with the Arduino – which is in essence nothing more than a single-chip Micro with bootloader and a decent library of routines.

We needed a better thermostat for Hollyberry Cottage and decided to “give it a go” – here’s the results so far after MANY blind alleys and the smell of fried plastic on more than one occasion…

Arduino-based thermostat

So essentially what you’re looking at on the right is a prototyping board with a microprocessor on the right and associated parts (the little long grey chip on the right), at the top of the board – the blue sub-board is an Ethernet (internet) interface, at the bottom a mains relay. Off the board to the left is a control pot (user heating control, to the top are some LEDs  and on the right is the cable I use to program the lot – that’s not part of the project.

So the idea is simple enough – the unit via a remote head controls the temperature in the place with two options – normal and standby… in standby the temperatures drop, in normal they are suitable for having people there.. in each case there are 4 timezones and the level of control the pot has is controllable… so we might let people vary the temperature by +-4 degrees from the setpoint for example….

tmp6261So why the Ethernet interface – well, Maureen and I are out and about, perhaps even in Spain and we need to be able to handle last minute cancellations or indeed last minute bookings.  Instead of driving over to the cottage to change the heating, we want to be able to do this from anywhere… and that means on a mobile phone. There are TWO different and incompatible Ethernet Interfaces for the Arduino board and I made the mistake of spending a lot of time working with the cheap one using the ENC28J60 chip – it’s cheap – but it simply does not work reliably. I then moved onto the standard board which uses a Wiz5100 chip – and that worked perfectly except for inexplicable hang-ups which were pretty predictable – turns out the standard library that everyone uses has a bug – that sorted the board is now working utterly reliably (up to now, longest test 24 hours – I plan to give it a couple weeks next).

tmpBBE7The interface has to be simple.. As you can see on the left I’ve stuck with large buttons. Typically you would log into the site and press NORMAL or FALLBACK to control the heating – but you can also set up the time, set the temperature zones and even view a graph of historical temperature (stored locally in EEPROM). The graph will get more sophisticated in time but for now it merely shows historical data. The chip has enough spare EEPROM for around 900 points (to the nearest degree, much smaller if you want fractions – though thinking about it I could store to the nearest 0.5degrees just by doubling the figure and getting the 8-bit equivalent – if the temperature hits 128c we’re in BIG trouble – or minus for that matter internally).

Instead of an expensive LCD display at the user end I’ve gone for 3 simple LEDS – red, green and blue. The GREEN light simply flashes to let you know the unit is thinking – when the heating is ON it flashes far more obviously…. the red and blue are optional and give a varying indication of HEATING (red) or COOLING (blue) depending on the setting of the pot.. they may or may not make it into the final unit.

I’ve incorporated delays to stop someone madly fiddling with the controls and setting the relay on and off rapidly….. and the settings will survive a power loss – though right now the time won’t… my next job is to get the board to send me an email if the power dies so I can reset the time – cheaper than using a battery and more useful as I need to know if power cuts occur! Maybe I’ll get it to send a TWEET…. more as things progress.

Update 29/3/2012

The email was not that easy – turns out it’s quite hard to have the board do a server/client on it’s own web pages AND handle something else – so email, even twitter is out (I did get the code running to send TWEETS!) until I can find out how to do 2 things at once. On the upside I’ve now added a real time clock board so it knows the time and can keep it if the power goes off. The board is essentially done, it now needs to sit on test to make sure it’s reliable. NOW I can get back onto working on Maureen’s SAD light… which will also get the real time clock treatment!  I’ve ordered more of the Ethernet boards – I can see lots of applications for this stuff.

Update 24/9/2014

See other posts on the subject of home control – amazing how far this project has come on in 2 years! The first follow up to this original article occurs here – my UberBareBoard project.