cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Water shut off solenoid on timer

TNGW1500SE
Explorer
Explorer
One of the things I worry about when we leave the RV is a water leak. Now I know I could just shut the valve and last year we tried that but we forgot, a lot. I had some free-time to kill. LOL! So here's what I did to solve the "problem".

I bought a 12 volt normally closed solenoid valve off e-bay for 7 bucks. On each side of the valve I added a garden hose fitting. The valve screws onto my water inlet connection and the hose now screws onto the valve. I ran a hot to the pump from the compartment light.

Then I got creative and programed a NodeMCu (2 bucks on Ebay) using Arduino so that anytime the Node sees terminal D1 go "HIGH" (3.3 volts) it sends power to a Mosfit out D5 thereby grounding the pump through the Mosfet. I programed the Node to power D5 for 900000 milliseconds if D1 goes high.

Then I added a doorbell switch in the water compartment so I could push it and get 15 min "water on" time. It connects D1 to 3.3 on the Node.

I bought a 433Mhz remote receiver that came with 2 transmitters off Amazon (16 bucks) and wired relay 1 on the receiver to the Node so when the transmitter button "A" is pressed the relay connects the Node D1 to 3.3 volts on the Node. Thereby setting the timer to on for 15 min.

I'm putting one transmitter in the bathroom and one at the kitchen sink.

The water will now automatically shut off in 15 min.

If you followed that congratulations ;). It was a fun little project.

It's all mounted under the bed with only 5 wires from the electronics.
Hot
Ground
Switched Ground
and two wires to the doorbell button.

If it ever fails the valve can just be unscrewed and the hose connected directly.

Here's the code I used:

int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the pin as an output:
pinMode(D5, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(D1, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(D1);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn on:
digitalWrite(D5,HIGH);
delay(900000); //15 min on time
}
else {
// turn off:

digitalWrite(D5,LOW);
}
}
60 REPLIES 60

DiskDoctr
Explorer
Explorer
Reading your post, I miss sitting around a campfire and dreaming up enhancements and projects for the RV. ๐Ÿ˜‰

Interesting project :thumbsup:

2112
Explorer II
Explorer II
Thanks for posting this. I wasn't aware NodeMCu exists. After reading up on them today I may play around with one to see how it can fit my toolbox. I generally do not do IOT but you never know when a need may arise.
2011 Ford F-150 EcoBoost SuperCab Max Tow, 2084# Payload, 11,300# Tow,
Timbrens
2013 KZ Durango 2857

TNGW1500SE
Explorer
Explorer
myredracer wrote:
4x4van wrote:
Seriously? When have you ever wanted to run your water (in an RV) for 20 minutes straight? That's +/-70 gallons, give or take (assuming a flow rate similar to a typical 3.5gpm onboard pump).:S


What if someone was doing a large stack of dishes, cutlery and pots 'n pans? Water wouldn't be running non-stop for rinsing but washing/rinsing could take a while.

Or what if someone was using the outside shower to wash a big furry dog or you have a large family of kids just returning from the beach and you want them to rinse off outside?

Or what if you turned the water on to use the toilet and go for a drive and along comes your DW 20+ minutes later and the toilet won't flush and can't use the sink? I know I'd be in big trouble. ๐Ÿ˜ž

Or... Maybe I'll think of more later. ๐Ÿ™‚




"what if you turned the water on to use the toilet and go for a drive"

For real?? Does that help with constipation? Is this common knowledge that I am unaware of? Is it the vibration of the vehicle or do I need to drive on bumpy roads to loosen things up? I recommend wearing "depends" for the drive.

Any of the scenarios you stated would be a very serious problem for a quadriplegia or if your neighbor duct tapes your hands and feet together. Most RV parks don't allow that anyway. Otherwise press the button again. There's three buttons. One in the bathroom, one at the kitchen sink and one in the wet bay.

Bumpyroad
Explorer
Explorer
I think a better arrangement would be to use proximity switches so that whenever somebody is present the water would be on and when they leave it would shut off. then you wouldn't have the every 15 minute routine.

or just fill up and use water from your onboard fresh water tank and don't leave the city water hooked up at all.
bumpy

GordonThree
Explorer
Explorer
The neat thing about RV'ing is everyone has their own way of doing things, and there's no rule book that says we have to do it one way or another.

Leaving the water on all the time, and maybe remembering to turn it off, at a faucet or a switch, versus having a computer control it - those are options everyone can choose to implement for themselves.
2013 KZ Sportsmen Classic 200, 20 ft TT
2020 RAM 1500, 5.7 4x4, 8 speed

Dutch_12078
Explorer II
Explorer II
4x4van wrote:
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy
Seriously? When have you ever wanted to run your water (in an RV) for 20 minutes straight? That's +/-70 gallons, give or take (assuming a flow rate similar to a typical 3.5gpm onboard pump).:S

Does the timer stop timing when the water flow stops when taking a "Navy shower" for example? It doesn't as described. The total shower time could exceed the time limit, even if the water isn't flowing the whole time. Washing dishes could be another application where the total time would exceed the total water flow time.
Dutch
2001 GBM Landau 34' Class A
F53 chassis, Triton V10, TST TPMS
Bigfoot Automatic Leveling System
2011 Toyota RAV4 4WD/Remco pump
ReadyBrute Elite tow bar/Blue Ox baseplate

myredracer
Explorer II
Explorer II
4x4van wrote:
Seriously? When have you ever wanted to run your water (in an RV) for 20 minutes straight? That's +/-70 gallons, give or take (assuming a flow rate similar to a typical 3.5gpm onboard pump).:S


What if someone was doing a large stack of dishes, cutlery and pots 'n pans? Water wouldn't be running non-stop for rinsing but washing/rinsing could take a while.

Or what if someone was using the outside shower to wash a big furry dog or you have a large family of kids just returning from the beach and you want them to rinse off outside?

Or what if you turned the water on to use the toilet and go for a drive and along comes your DW 20+ minutes later and the toilet won't flush and can't use the sink? I know I'd be in big trouble. ๐Ÿ˜ž

Or... Maybe I'll think of more later. ๐Ÿ™‚

GordonThree
Explorer
Explorer
4x4van wrote:
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy
Seriously? When have you ever wanted to run your water (in an RV) for 20 minutes straight? That's +/-70 gallons, give or take (assuming a flow rate similar to a typical 3.5gpm onboard pump).:S


A fancy RV with on board laundry. There could be more than 15 minutes between fill/drain cycles.
2013 KZ Sportsmen Classic 200, 20 ft TT
2020 RAM 1500, 5.7 4x4, 8 speed

4x4van
Explorer III
Explorer III
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy
Seriously? When have you ever wanted to run your water (in an RV) for 20 minutes straight? That's +/-70 gallons, give or take (assuming a flow rate similar to a typical 3.5gpm onboard pump).:S
We don't stop playing because we grow old...We grow old because we stop playing!

2004 Itasca Sunrise M-30W
Carson enclosed ATV Trailer
-'85 ATC250R, '12 Husky TE310, '20 CanAm X3 X rs Turbo RR
Zieman Jetski Trailer
-'96 GTi, '96 Waveblaster II

GordonThree
Explorer
Explorer
Dutch_12078 wrote:
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy

Of course the time delay could be programmed for any value that fit your needs, but it also might be worth making the delay cumulative so multiple button presses would add additional time, possibly with some practical limit. Set the time delay at 15 minutes for instance, and two quick button presses would give you 30 minutes of water. Just a thought...


thats why I love microcontroller projects, so easy to make arbitrary adjustments.

the button could be replaced with a clickable rotary encoder. dial any # you want, push to start counting. push again to reset, shut off, add time, whatever

of course, you can also call that feature creep
2013 KZ Sportsmen Classic 200, 20 ft TT
2020 RAM 1500, 5.7 4x4, 8 speed

TNGW1500SE
Explorer
Explorer
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy


If I wanted 20 min (for some unknown reason???), I'd push the button and somewhere between 5 min and 15 min, I'd push it again.

I don't see why I'd ever want more than 15 min since I don't own a firetruck.

Dutch_12078
Explorer II
Explorer II
Bumpyroad wrote:
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy

Of course the time delay could be programmed for any value that fit your needs, but it also might be worth making the delay cumulative so multiple button presses would add additional time, possibly with some practical limit. Set the time delay at 15 minutes for instance, and two quick button presses would give you 30 minutes of water. Just a thought...
Dutch
2001 GBM Landau 34' Class A
F53 chassis, Triton V10, TST TPMS
Bigfoot Automatic Leveling System
2011 Toyota RAV4 4WD/Remco pump
ReadyBrute Elite tow bar/Blue Ox baseplate

Bumpyroad
Explorer
Explorer
4x4van wrote:
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long.


what if he wants the water to flow for 20 minutes? now you would need to keep hitting the switch all day long whenever you wanted water. seems like rube goldberg had some input into the design.
bumpy

TNGW1500SE
Explorer
Explorer
GordonThree wrote:
Check this out:

https://pastebin.com/qWzKPa8F


nice and simple. thanks

4x4van
Explorer III
Explorer III
paddywanpeep wrote:
LOL - Dont worry you are not over my head with your design. I just think its stupid and unnecessary that's all. So you traded in one potential problem for another - hitting your switch every 15 minutes. hey whatever floats your boat I guess. I'll stick with just flipping off the already built in switch like I have been doing.
Actually, I think it did go over your head, at least a little. Why would he have to hit his switch every 15 minutes? That would only be necessary if he wanted a constant non-stop flow of water all day long. And your actions of hitting the "already built in switch" is irrelevant to the OP's city water hookup.

You flip a switch (for your water pump) EVERY time you want water...then you flip that same switch AGAIN to turn it off EVERY time. Fine. But for those RVers who use City water, that's not an option; the only way to turn off the water is by going outside and turning the faucet off.

The OP's system requires only a single button press when he wants water (just like you pressing a switch), but he doesn't have to do anything to turn it back off (unlike you, who has to press your switch again to turn your pump off); his turns itself off automatically after 15 minutes. Actually pretty smart; Virtually no risk of water damage from a plumbing leak, without ever having to remember to turn anything off.

Of course, his system only works for city water, but the same idea could be adapted to the onboard system easily as well, automatically turning the water pump off after 15 minutes.
We don't stop playing because we grow old...We grow old because we stop playing!

2004 Itasca Sunrise M-30W
Carson enclosed ATV Trailer
-'85 ATC250R, '12 Husky TE310, '20 CanAm X3 X rs Turbo RR
Zieman Jetski Trailer
-'96 GTi, '96 Waveblaster II