There are several places I could have posted this, since the basis is the Arduino control and it relies on the Arduino plug-in, I thought this might be the best forum.
Over in another thread I mentioned that I used a KLD water valve for my emergency water shutoff. One of the members asked if I would do a write up of the control wiring and events. The valve I chose was from KLD in China, it is a KLD20S with B3S wiring. It is a full bore 3/4" stainless valve with end switch feedback. I purchased it direct from China for about $65 delivered.
Here is the basic wiring for the valve. On the motor drive side there is a common "-", an open drive and a close drive connection. For the limit switches there is a common and an N.O. switch for closed and open.
One thing I discovered when I received the valve is that the designers planned on the valve being operated by supplying open or close drive, and leaving that drive applied the whole time the valve is opened or closed. It only draws about 60ma at fully opened or closed, but I don't think that is necessary. The valve is a standard ball valve, so it is not going to creep if there is no current applied. Unfortunately the open or close limit switches only stay actuated when motor drive is applied. I'm sure I probably could have hacked the valve so that the switches would show the valve in the open position without drive applied, but I didn't see the point.
I used an Arduino Mega just because I have had better luck with them because they have more memory than the Uno. I only needed 4 pins, so a Uno would work. I used an Arduino POE Ethernet Shield and a Velleman KA05 I/O shield. I only assembled the board for the two inputs and outputs I needed. The board makes for a nice clean installation with screw terminals for the inputs and outputs, a relay and drive circuit for output and LEDs to show the status of the inputs and outputs. I put the Arduino near the valve to mitigate any noise I might pickup on the Arduino inputs. Ethernet connects the Arduino to my home network.
Then it was two virtual devices, two Arduino inputs and two Arduino outputs. Below is a shot of the associated devices.
First is a "Fault" virtual device that will trip any time the valve fails to fully open or close within a reasonable time frame. Full travel on the valve is about 6 seconds, so I set the failure time at 30 seconds as I will show in an event below. The Fault device will trigger a pushover message and give me a visual reminder that a fault had occurred until it is cleared by normal valve operation
The second device is is another virtual device for valve control. It is used to trigger the events below to open and close the valve. Below that are the two Arduino outputs to drive the valve open or closed and the two Arduino inputs that recognize when the limit is reached in each direction.
Then there are two events for Open, one to trigger when the virtual position device is changed to "Open" and another to trigger when the valve has hit the limit switch for fully open.
The Open event sets the Arduino Open drive output to ON and the Close drive output to OFF. An immediate script changes the string value for the position device to "Opening". A timer is started to be used in fault detection in another event.
The Opened event is triggered by the Arduino Open Limit Input, waits three seconds than turns the Open Drive output Off. An immediate script sets the string value of the position device to "Open". The Arduino Open Drive Output is turned off, the timer is stopped and reset and if there was a prior fault, it is cleared or turned Off.
Then there is an event for failsafe on the motor drive. If the valve drive has been On for 30 seconds or more, it is turned Off.
The Valve Close, Valve Closed and Valve Closes -Failsafe events are duplicates of the Open counterparts, just using a different Arduino input and output.
The Water Valve Operation Fault event simply looks at the timer, if an open or close event has not completed within 30 seconds, the "Fault" virtual device is turned On, an immediate script changes the position virtual device string to "Fault'. The timer is reset and a Pushover message is sent.
Here is a quick video of the Device Manager screen showing the devices in operation.
Since my valve is buried inside a basement wall, I couldn't get pictures of my actual installation. Here is a spare valve and Arduino bread boarded on my workbench for demonstration.
There are many different valves and many different ways of controlling them. I have had such good luck with Arduino controls this was my choice. If you have any questions, please don't hesitate to ask.
Over in another thread I mentioned that I used a KLD water valve for my emergency water shutoff. One of the members asked if I would do a write up of the control wiring and events. The valve I chose was from KLD in China, it is a KLD20S with B3S wiring. It is a full bore 3/4" stainless valve with end switch feedback. I purchased it direct from China for about $65 delivered.
Here is the basic wiring for the valve. On the motor drive side there is a common "-", an open drive and a close drive connection. For the limit switches there is a common and an N.O. switch for closed and open.
One thing I discovered when I received the valve is that the designers planned on the valve being operated by supplying open or close drive, and leaving that drive applied the whole time the valve is opened or closed. It only draws about 60ma at fully opened or closed, but I don't think that is necessary. The valve is a standard ball valve, so it is not going to creep if there is no current applied. Unfortunately the open or close limit switches only stay actuated when motor drive is applied. I'm sure I probably could have hacked the valve so that the switches would show the valve in the open position without drive applied, but I didn't see the point.
I used an Arduino Mega just because I have had better luck with them because they have more memory than the Uno. I only needed 4 pins, so a Uno would work. I used an Arduino POE Ethernet Shield and a Velleman KA05 I/O shield. I only assembled the board for the two inputs and outputs I needed. The board makes for a nice clean installation with screw terminals for the inputs and outputs, a relay and drive circuit for output and LEDs to show the status of the inputs and outputs. I put the Arduino near the valve to mitigate any noise I might pickup on the Arduino inputs. Ethernet connects the Arduino to my home network.
Then it was two virtual devices, two Arduino inputs and two Arduino outputs. Below is a shot of the associated devices.
First is a "Fault" virtual device that will trip any time the valve fails to fully open or close within a reasonable time frame. Full travel on the valve is about 6 seconds, so I set the failure time at 30 seconds as I will show in an event below. The Fault device will trigger a pushover message and give me a visual reminder that a fault had occurred until it is cleared by normal valve operation
The second device is is another virtual device for valve control. It is used to trigger the events below to open and close the valve. Below that are the two Arduino outputs to drive the valve open or closed and the two Arduino inputs that recognize when the limit is reached in each direction.
Then there are two events for Open, one to trigger when the virtual position device is changed to "Open" and another to trigger when the valve has hit the limit switch for fully open.
The Open event sets the Arduino Open drive output to ON and the Close drive output to OFF. An immediate script changes the string value for the position device to "Opening". A timer is started to be used in fault detection in another event.
The Opened event is triggered by the Arduino Open Limit Input, waits three seconds than turns the Open Drive output Off. An immediate script sets the string value of the position device to "Open". The Arduino Open Drive Output is turned off, the timer is stopped and reset and if there was a prior fault, it is cleared or turned Off.
Then there is an event for failsafe on the motor drive. If the valve drive has been On for 30 seconds or more, it is turned Off.
The Valve Close, Valve Closed and Valve Closes -Failsafe events are duplicates of the Open counterparts, just using a different Arduino input and output.
The Water Valve Operation Fault event simply looks at the timer, if an open or close event has not completed within 30 seconds, the "Fault" virtual device is turned On, an immediate script changes the position virtual device string to "Fault'. The timer is reset and a Pushover message is sent.
Here is a quick video of the Device Manager screen showing the devices in operation.
Since my valve is buried inside a basement wall, I couldn't get pictures of my actual installation. Here is a spare valve and Arduino bread boarded on my workbench for demonstration.
There are many different valves and many different ways of controlling them. I have had such good luck with Arduino controls this was my choice. If you have any questions, please don't hesitate to ask.
Comment