Sunday, December 14, 2014

Home Automation: Arduino controlled Geyser

A long-pending post. I had built this project way back in May 2014, during the summer (in India). In one aspect, it seems better to have delayed this post, as my project has gone through a few bug fixes and enhancements, both in hardware & software -- so I can talk about the most recent version.

I had done a few other home automation stuff earlier like this one : DIY: Raspberry Pi controlled Power Strip - Part 1. I was/am constantly on the look out for any opportunity to automate things at home. We have been wasting lots of energy, as our geyser almost runs till cut-off most of the times and we won't need so much hot water during summer. This was simply because we won't remember to turn it off on time. I wanted to fix this by building a timer controlled switch for the geyser using Arduino.

I had earlier used Raspberry Pi for home automation. This time, I wanted to use Arduino for a few reasons. Unlike the power strip, which is completely network-controlled, this is a low power project and doesn't necessarily be network-controlled (I could actually snap in a Ethernet Shield for Arduino and make this network-controllable -- remember, I have Ethernet running over my power lines anyway, so easy to get a network anywhere). I also wanted to explore Arduino as part of this, as Arduino is relatively low cost and very low power (< 1W). I buy Arduino/Raspberry Pi from Ebay India directly (though they could be cheaper by other channels).

Here is the circuit:

This circuit was drawn using some online tool (that isn't perfect). The tool had bugs, so some of it didn't come out the way I want. Still conveys the idea.

The project is primarily, a relay (Relay2) driving the high power geyser (ours is around 2500W). The original plan was to drive this relay by a signal from Arduino. The high power relay that I procured, required a signal voltage of around 9V without which it couldn't really turn on the load. Arduino GPIO pins operate only at 5V. So I had to introduce another relay (Relay1) to supply the required 9V (external source), but on signal from Arduino. This also ensures, not much current is drawn directly from Arduino. Arduino Uno has a built-in voltage regulator (safe up to 12V), but I decided to be safe and use a custom voltage regulator using LM7805 (I wouldn't want to heat up Arduino or burn it -- lot cheaper to build an external voltage regulator - around Rs.70). I also have a 16x2 LCD to display the status/timer (see photos). The LCD is driven using the standard Arduino LCD library.

Here is the voltage regulator (built separately and tested out):



It doesn't turn on the geyser instantly. It runs a 10 second timer before it turns it on. This is to ensure that any electricity interruptions don't turn on/off the geyser too quickly. Better for the geyser.


Showing the countdown to shutdown:
 
 

The project in action (for the last 6 months). The USB cable connects to the data port of Arduino via a hole in the case -- this is used for software upgrades in-place; just connect my Mac and click on a button to flash it instantly with new code. eg., Once the winter started, I had to patch it to increase the timer a bit to get it to the right temperature.


This board is in series with the geyser, so turning on the physical switch doesn't turn on the geyser (expected).