Forum Discussion

TNGW1500SE's avatar
TNGW1500SE
Explorer
Apr 11, 2018

Water shut off solenoid on timer

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);
}
}

About DIY Maintenance

RV projects you can tackle on your own with a few friendly pointers.4,351 PostsLatest Activity: Jan 13, 2025