Notifications
Clear all

[Solved] Input wanted on wiFi controlled water valve

54 Posts
4 Users
24 Likes
2,254 Views
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

I am thinking about a project to allow WiFi control of a 110VAC water shut off. Today it is on a std wall switch. What is the device to use for AC control, it looks like Bill used a solid state relay, is that the only solution? The one I have is 12V but I have a few buck/boost modules that can boost the ESP32 or ESP8266 5V to 12V. It only draws 5ma at 12V so about 12ma at 5V shouldn't stress the WiFi board. I would love to put the control for this in the Arduino IoT cloud, just got a Nano 33 IoT so ready to experiment.

I could buy a 12VDC water valve but would rather not spend more money than needed if the AC version can work.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
Quote
b
 b
(@b)
Noble Member
Joined: 4 years ago
Posts: 912
 
Posted by: @zander

Bill used a solid state relay, is that the only solution?

Have a look at the shelly1 for an all in one wifi / relay that can be switched via HTPP or MQTT messages and can be used with a shelly cloud.  

You could mimic that approach to create a zander 1 with your Nano 33 IOT and a relay placed on a PCB all enclosed in an electrically save enclosure to protect from the 110v.  Your design could make use of the Arduino cloud.  If a zander1 starts to sell in the millions, don't forget to give a nice donation to the originator of this idea.


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@byron Thanks for the reply. I have a few boards kicking around so I would rather build my own.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@byron Forgot to mention. My understanding is that those opto-isolated relays is the 'safe' way to deal with 110VAC. I also forgot to mention that the existing water valkve is controlled with a 110VAC conventional relay on a wall switch with light now. I am only looking at replacing the switch and light so in fact I will have a relay controlling another relay controlling the electrically operated valve. I haven't decided if I should eliminate the existing mechanical relay or not. On the one hand it's already there, does not change the wiring hardly at all and has no effect on the new part I am wanting to build.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Inst-Tech
(@inst-tech)
Reputable Member
Joined: 1 year ago
Posts: 366
 

@zander, Question: at what voltage is the existing relay being powered by?  is it 12 volts AC or DC, or some other voltage?

Indeed, using the opto-coupler relays is a much safer way to keep your low voltage circuit isolated from the AC voltages..Would be nice to see a schematic  or drawing of what you are trying to do, and maybe we can be more helpful..hooking up things like that was what I did for a living for 49 years, industrial instrumentation/electrical tech lol...

Good luck on your project,

regards,

LouisR

LouisR


   
b reacted
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@inst-tech It's a 110VAC valve. If I did a schematic it would be pencil and paper as I have not been able to find a coputer drawing package. About 20 years ago I found one and it was discontinued the day before I decided to buy it. The replacement software was not to my liking. Anything that has CAD in it is too complex for me, the pgm I loved was called something like Drafting Table. I have no need for 3D or 3D printing.

I will try a neat (with a ruler) diagram later but it's really quite simple.

110VAC NC water shut off connected to a 110VAC relay controlled by illumiated wall switch using 110VAC for the relay. I wil simply take the wires off the switch and attach them to the relay board's NC, this way the mechanical switch still functions as per now, while the cloud can turn off the water by picking the relay. The system is failure proofed since in a power outage situation the relay controlling the valve will drop since it is NOT powered by my 7.2kWh inverter system.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
b
 b
(@b)
Noble Member
Joined: 4 years ago
Posts: 912
 

 

Posted by: @zander

110VAC NC water shut off connected to a 110VAC relay controlled by illumiated wall switch using 110VAC for the relay

I thought the point of a relay is to use a low current to switch a high current. The way I interpret things you seem to say you have a 110v switch that switches a 110v relay, but I think I'm interpreting things wrong as why have a relay and a switch where just a switch would seem to be all thats needed, and probably your switch supplies a low current to your relay maybe taking a feed low volts supply from your vintage relay.  But this is only a vague speculation on my part.  

Whatever, to switch your pump on you need to supply it with 110v either through a relay of some sort, or some other circuity you design.  If you intend to use your existing relay then I suggest its out with the multimeter with rubber boots and some healthy respect regards the 110v to see exactly what the switch voltage is.  If the volts are indeed 110v then it would seem somewhat strange to use a 110v relay (to replace the switch) to trigger another 110v relay.  Personally I would just replace your existing relay with one suitable for your purposes.  

I use a Sparkfun SS relay to switch 240VAC which is triggered by an i2c connection from a rpi pico to control my central heating boiler and hot water circulation pumps.  Other relays can be switched via a 3.3v DC connections.  Your nano board can output a 3.3v signal or i2c etc (and triggered via the nano's wifi from the arduino cloud or some other device on your home network) so it would be an ideal companion to a suitable relay and you could house them all in a nice electrically secure container.  (of course the shelly1 would do all this for a small $ though it would be missing the arduino cloud connection ability)

Here is a link to the small bestie of a relay I use but there are many others that would be suitable.  

https://www.sparkfun.com/products/16810

Of course be very aware of the current draw your pump requires and select a relay that can easily supply the amps required without approaching it limit rating.  (if you need 10amps then don't use a 10amp rated relay as its too close for comfort to its rated amps).  Also be aware of the amount of heat the relay may generate, especially if housing your contraption in a home made enclosure.

Good luck with your project.


   
Inst-Tech reacted
ReplyQuote
Inst-Tech
(@inst-tech)
Reputable Member
Joined: 1 year ago
Posts: 366
 

@byron...yes, I too am somewhat puzzled by @zanders relay arrangement..But I'll wait to see what he has by way of a drawing or schematic of how the system is arranged. If the purpose of the relay is an interposing type for fail safe operations, then it might have some validity..but I'd need to see the specifics, voltages, load requirements, etc.

Indeed, your correct in making sure the relay contacts are rated above the load requirements, and that heat dissipation is accounted for in surrounding environments. I look forward to seeing how this project progresses..

Keep us informed @zander (Ron).. this is going to be interesting...

regards,

LouisR

LouisR


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@byron I appreciate your concern, but I did work as an industrial electrician before I switched to computers.

Here is the relay https://www.amazon.ca/gp/product/B0071NAYUU/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1 .

Here is the VALVE, NOT pump! https://www.amazon.ca/gp/product/B01GKZ7J7U/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

The reason for the relay was to keep the higher current of the valve away from the wall switch. The coil/switch is NOT wired into the inverter circuit so in case of a power failure the water is shut off. I don't remember why/if I could have wired the valve through the switch not on the inverter but that's what it is.

Now I can just connect the switch in series with one of these https://www.amazon.ca/gp/product/B0857KFZRJ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 and have both in house switch control as well as cloud control.

I should mention I live in an RV and the toilets are designed in a way that the water valve can and has failed in a way that lets water flow into the toilet thus overflowing it (an RV can't have overflow protection). That is why I am somewhat paranoid about being able to shut the water supply off outside enough so that a leak before the valve finds it's way to the ground quickly but inside enough to not freeze up.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@inst-tech Couple things I didn't mention that might help.

I live in an RV.

RV toilets are engineered in a way that the water valve fails every few years and allows water to flow in.

RV toilets can't have overflow protection due to sewer gasses and no P trap in a toilet.

My RV is basically a rolling UPS so I need to wire things up to either be on the UPS or not. I want the water to shut off if there is a power failure.

In addition, I just do not like the idea of wiring a household switch directly to a big electro-magnet. The relay is designed to handle the load.

It's totally safe.

Thank you for your concern, now can I get some input on technology to control the AC, or is Bill's solution the only way, at least the only good way. I assumed it was, but had to ask since @will educated me about MOSFET's for a DC project.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@inst-tech Here is my diagram. And a picture of the actual valve. Originally I was going to use a 12VDC valve so needed the relay and had it all connected (somewhat difficult in an RV) then when I realized I had a 1/2" valve could only get 110VAC in a 3/4" valve. I just connected the valve and since the relay wasn't causing me any problems just left it there. I just did some more checking and find information that says it is a 28W device but draws 0.5A @ 110VAC which to me says 55W. The relay I used is good for 25A, no idea what the wall switch is good for, but with the relay I know I am good. The manufacturer's web site does not tell me the relay's draw.

IMG 6754

 

IMG 6753

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

Turns out the SS relay only needs 5V to pick, the description I was looking at said 12V but in fact closer inspection says 4-12.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
b
 b
(@b)
Noble Member
Joined: 4 years ago
Posts: 912
 

@zander

I know I'm flogging a dead horse, but taking your words of wisdom "It is considered poor judgement to traverse a chasm in 2 leaps" I give a diagram doing just one leap using a shelly1 $10 relay that can be switched via your wifi.  Its rated at 16 amps so would appear to be ok for your valve.  No need to reply I was doodling while I await someone to come to give me a quote for hedge trimming. 😀 

Screenshot 2022 03 07 at 07.48.47

 

 


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 4015
Topic starter  

@byron Yes, but most of us here want to build our own devices.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Inst-Tech
(@inst-tech)
Reputable Member
Joined: 1 year ago
Posts: 366
 

@zander... Well, I think I can see what it is your trying to do, so I've included a drawing for you to look at and see if that's what you have in mind.. I left out the cloud part because this wasn't needed to show how a 5 v relay controls the water valve ( 2-way solenoid valve) and the wall switch.. it's basically an or gate.. either one with operate the valve to open it, and on loss of power the water valve closes..

let me know what you think..are we in the ball park?

regards,

LouisR

Water Valve Cloud relay

 

LouisR


   
ReplyQuote
Page 1 / 4