Project feasibility of programmable repeat cycle timer controlling 120VAC pump

Here is my problem: I have water pipes going through the concrete floor of my basement, and the hot water pipes were not wrapped with insulation. It takes forever to get hot water anywhere in the house. No problem, I get a continuous flow pump for the hot water. Unfortunately this warms up the cold water pipes (which lay next to the hot water pipes in the concrete) so now cold water takes forever to get.

My proposed solution: Use an Arduino, a RTC board, and an AC relay shield to create a repeat cycle timer for the pump. I can play with different timer values in software to figure out how long the duty cycle should be so that hot water stays hot and cold water stays cool. I can also set it to only cycle in the mornings and evenings, when hot water is most likely to be needed.

Is this a feasible thing for me to attempt? Is there a better solution to my problem?

Just a bit of background. I haven't done anything yet with an Arduino, or any computing with a soldering iron since the early eighties but it doesn't scare me. Hooking 120V up near digital circuitry does scare me a bit (I lost a very expensive circuit back in the seventies when a spark jumped to the coil on a mechanical relay and fried everything) but I figure that companies that specialize in Arduino AC relays (like this one) probably do a safer job than I ever did.

Finally, is there anything else I should be aware of? Other than the Arduino (the Uno?), RTC, power supply, and relay shield, is there anything else I'll need? Will there be a problem wiring both the shield and the RTC to the Arduino together? Any supporting resistors, capacitors, or other components needed to make this work?

Thanks for any help or advice.

If the 120V piece bothers you, you might consider a powerswitch tail which encapsulates the switching and lets you control it directly from an arduino digital output.

That is perfect! Much better than what I was planning, more self-enclosed and isolated. Thank you for making me aware of this component.

Would it be easier to use a valve instead of a pump? Cold would be easy--just open a valve into the toilet holding tank. For hot water, you could have a bathroom sink run the hot side for a while.

Add temp sensors if you're even more ambitious.

Well, I already have the pump installed, so I think I’ll stick with that.

Good point about the temperature sensors. Perhaps that will be an expansion for another day. The only reason I’m not including it in the initial build is that the pump is in a concrete closet in the basement with the hot water tank, and I’d have to run wires all over the house to get temperature readings from pipes near the taps where the water temperature is problematic which are naturally the points farthest from the tank. Or I could add wireless sensors if they were powerful enough to reach the closet, I guess.

I do like the idea as a whole especially since, combined with flow sensors, the system could “learn” to anticipate when to run the pump cycle so that hot water was available at the times it was most likely needed. Feed in information about weekends and holidays and vacations, and it could identify its own schedules running the cycle timer. A bit of AI on an Arduino would be cool.

Since this is my first Arduino project I think I’ll start with baby steps. Thanks for the suggestion, though. I may end up doing it eventually.