Setting the time on RTC without a computer

Hi all:

I've been using a homemade controller for my hot water circulation pump for years. It uses a purchased electronic timer and a temperature switch to keep a loop of water hot during waking hours. The timer sets when the pump can run (waking hours). And the temperature switch keeps the pump on just long enough to heat the loop, cycling periodically to maintain temperature. It works okay. But the timer relay in it died the other day. So, I'm toying with using an arduino to replace my cobbled-together controller and add a few new features (another story).

Because I want to have the pump off during non-waking hours, I need a real-time clock. Online, I've found numerous examples of using one, and setting the time using the clock in the computer used to program it. However, I don't think it's realistic to expect some future homeowner to do that to set the RTC time when the battery needs to be changed.

Has anyone explored a way to have the time setting function self-contained? I'm guessing you'd need a few pushbuttons and an LED/LCD display for the time. I'm also assuming the actual timing of when the pump should be on (once per day) would be similar. So maybe a rotary switch with three positions: "Time", "On" and "Off". Use the pushbuttons to increment/decrement the settings for each of the three variables. Before I dive in, I just wondered if anyone else has tried something like this. Maybe there's a better way.

Thanks in advance,
John.

People struggle with programming electronic equipment already - even if you write a superlative manual for an arduino controlled system, no-one but a geek is going to want to touch it. I'd expect any future owner to want a standard off the shelf controller installed.

If you're prepared to run ethernet to the device or use a wifi shield, you can get the time from a time server and either use it directly or just to set the clock at power up.

Spend $50, get a Honeywell 7 day a week, multiple on-off times a day thermostat with relay output. Battery powered, LCD screen, runs for ages on 2 AA batteries, warns you when batteries are low. Put the manual in a plastic bag and keep it near the heater.
http://www.homedepot.com/p/Honeywell-7-Day-Programmable-Thermostat-with-Backlight-RTH2510B/203628789?N=5yc1vZc4kc
We use one of these at our fencing club. Programmed to turn the heat about a half hour before we get there, turns off near the end of class, holds the temp at 55F the rest of the time.

Menu-based systems are all a PITA, I am a nerd and I hate them.

It doesn't have to be very accurate eh? Why not just have a pot with a dial marked 0-23 and three buttons, NOW, ON and OFF.

Rotate and press NOW to set the time, repeat for on and off times.

If you needed more resolution have hours and minutes pots or limit the range as it's only half the day you need probably.

Even simpler, have the user program at the start time, then they just have to enter a length, but that's not as user friendly.


Rob

You could use the sextant approach. At exactly noon, you have the user hit a button to set the clock.

The most appropriate approach to this is to use a photocell of some sort (diode, LDR, solar cell) placed in daylight and a PLL (phase locked loop) program .

The base algorithm is that if there is daylight, the system switches on. If however, there was a record of daylight 24 hours and 48 hours ago and not 12 and 36 hours ago, and the same an hour later, then you may presume it is now daytime and synchronise the "clock" accordingly. The analysis can be performed for however many hours before daylight you wish to turn on, and similar algorithms for after daylight.

Great ideas! Thanks!

If I wanted to buy a working solution, replacing the programmable timer for $24 is easy enough. The point of this was to use the Arduino to 1: have fun with it as a project; and 2: add some new features, such as flow detection.

Keep in mind that waking hours aren't necessarily the same as daylight hours.

Agreed that it would be all too easy for this to get too complicated. My benchmark is the clock setting in my car, which works similarly to how I described it in the first post, except the time setting function is accessed through multiple button presses. My version would be a bit simpler than that...I think. It's even simpler than the current programmable timer setup I already have.

You've given me some alternatives to consider. Keep the great ideas coming. This should be a fun little project.

Regards,
John.

I wouldn't worry about leaving it for the next homeowner. Just take it with you for your next house! Unless they ask for it. Also, many people, such as inspectors, frown upon homemade equipment running your house, since it doesn't have any of the proper certifications. They might just ask you to rip it out anyways.

Well, the plan is to enclose and label it well enough that it passes for a purchased system. If circumstances dictate that I remove it, so be it.

the_tool_man:
Keep in mind that waking hours aren't necessarily the same as daylight hours.

That was the point of my suggestion.

If the system does not know the time, possibly because it was powered down, it can default to daylight hours, but once it has determined what daylight and night are by a sort of PLL, it can move to whatever algorithm you have determined such as switching on two hours before or two hours after. And if it determined that the days are shorter, it can alter these to match.

I don't know if I can explain this properly, and this will take a lot of outputs, but you could have 24 LED's and 24 slide switches. Every hour the Arduino lights an LED in turn. If the slide switch is on it turns on (or leaves on) the heater. If the slide switch is off it turns it off. The arduino has no idea what time it is, so it is up to you to know that the third switch means 9:00 AM, or whatever.