How do you control 1 solenoid valve from 2 sources?

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
In this scenario, there is a 12v latching solenoid valve which lets water run through a tap when a hand is placed under the sensor.


We have designed a separate circuit to connect to this valve and flush the tap at our command (this is an IoT project using GPIO pins on a microcontroller). This is our circuit (I assume the tap has a similar configuration):


To close the valve, 12v must be applied for about 0.5s, and to open, -12v must be applied for about 0.5s. In between, the valve remembers its position (as it is latching).

Both work separately but, without plumbing a new valve in, can we connect this new circuit directly to control the same valve?
The new connection will look something like this:


One problem I foresee is that there will be a short circuit on the opposing circuit when attempting to control the valve (as it is held at the same potential).
We cannot modify the original sensor tap, but we can put some intermediary circuit before the wires reach the valve.
One thought I had was to place in 4 resistors, but that might prevent enough current getting to the valve, right? (The valve draws about 250mA on activation.)

Many thanks for anyone who can help me solve this one!
 

Attachments

AnalogKid

Joined Aug 1, 2013
10,176
Let me try to clarify the question. As it is now, when the sensor sees your hand it activates the solenoid valve. As long as the sensor senses something, water stays on. A few seconds after the hand is removed, the sensor turns off the valve. The solenoid valve can latch in either the open or closed position without continuous coil current. Good so far?

What you want to do is add a manual override with a separate button for turn on and turn off. Correct?

In your schematic, both sides of the solenoid are at GND when no action is happening. Can you confirm that the original control system behaves the same way? It is possible that both sides of the solenoid are at +Vcc instead of GND in a resting state.

ak
 

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
Let me try to clarify the question. As it is now, when the sensor sees your hand it activates the solenoid valve. As long as the sensor senses something, water stays on. A few seconds after the hand is removed, the sensor turns off the valve. The solenoid valve can latch in either the open or closed position without continuous coil current. Good so far?

What you want to do is add a manual override with a separate button for turn on and turn off. Correct?

In your schematic, both sides of the solenoid are at GND when no action is happening. Can you confirm that the original control system behaves the same way? It is possible that both sides of the solenoid are at +Vcc instead of GND in a resting state.

ak
You've got it spot on.
However I cannot see the other circuit so it may well be possible that both sides of the solenoid are at +Vcc instead of GND in a resting state.
In both cases they will be at the same potential and hence be a short circuit, right?
 

AnalogKid

Joined Aug 1, 2013
10,176
I see what you mean now, and yes.

The first thing that comes to mind is three relays staggered in time. Pressing either button starts the sequence. The first relay (DPDT) disconnects the solenoid from the original circuit and connects it to your circuit. Then your circuit (as above) activates one of two SPDT relays to apply the correct voltage polarity (current direction) to force the solenoid to open or close. Once that pulse is done, the first relay returns control to the original circuit. This will be more simple if your circuit applies a constant width pulse no matter how long you hold down the button.

Messy, but meets the reqs so far.

Refined thought - If the two pushbutton switches can handle the solenoid current directly, then this reduces to two SPDT switches, one DPDT relay and some diodes; no transistors, no timers. Hmmm ...

ak
 

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
I see what you mean now, and yes.

The first thing that comes to mind is three relays staggered in time. Pressing either button starts the sequence. The first relay (DPDT) disconnects the solenoid from the original circuit and connects it to your circuit. Then your circuit (as above) activates one of two SPDT relays to apply the correct voltage polarity (current direction) to force the solenoid to open or close. Once that pulse is done, the first relay returns control to the original circuit. This will be more simple if your circuit applies a constant width pulse no matter how long you hold down the button.

Messy, but meets the reqs so far.

Refined thought - If the two pushbutton switches can handle the solenoid current directly, then this reduces to two SPDT switches, one DPDT relay and some diodes; no transistors, no timers. Hmmm ...

ak
Yes! I think you're definitely on the right lines - to isolate whatever output is coming from the old circuit and just have it interface with ours.
It might be as simple as two SPST relays (added in the left of the image below)... could this work?!
 

eetech00

Joined Jun 8, 2013
3,418
Hi


Just use one standard relay (w/ 2 "C" contacts) to act as a DPDT switch between the solenoid and each control circuit, such that, when energized, it enables your circuit to operate the solenoid. When de-energized it would enable the old circuit. The "enable" relay would be energized by either one of your transistor drivers.

eT
 

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
Hi


Just use one standard relay (w/ 2 "C" contacts) to act as a DPDT switch between the solenoid and each control circuit, such that, when energized, it enables your circuit to operate the solenoid. When de-energized it would enable the old circuit. The "enable" relay would be energized by either one of your transistor drivers.

eT
Yes that does seem like an elegant solution! This should work right, regardless of the old circuit configuration? (new circuit at the top):
 

eetech00

Joined Jun 8, 2013
3,418
Almost....

You need to add steering diodes so that transistor driver(s) only energizes the appropriate relay and RLY7.
Or use a separate transistor driver for RLY7, or use a separate contact of each existing relay to energize RLY7.

See circuit below.

Question:

Shouldn't the Pull-up resistors at the GPIO inputs be Pull-down resistors?

eT

Selenoid driver Ckt.png Selenoid driver Sim.png
 
Last edited:

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
Almost....

You need to add steering diodes so that transistor driver(s) only energizes the appropriate relay and RLY7.
Or use a separate transistor driver for RLY7, or use a separate contact of each existing relay to energize RLY7.

eT
Yes you're right, I didn't see that. Not sure how the steering diodes would work with that config though.
How about this (using a separate transistor driver)?
 

eetech00

Joined Jun 8, 2013
3,418
Yes you're right, I didn't see that. Not sure how the steering diodes would work with that config though.
How about this (using a separate transistor driver)?
Yes..that will work.

However, doesn’t the GPIO output +5 to turn on the transistor and energize the relays? If so, R23,R24 should be connected to ground instead of +5.

eT
 

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
Yes..that will work.

However, doesn’t the GPIO output +5 to turn on the transistor and energize the relays? If so, R23,R24 should be connected to ground instead of +5.

eT
Yes you're right, I was playing round with the effect of pull-up and pull-down resistors for the input part of the GPIO pins. They need to be pull-down if they are to be outputs too.
Thank you for your help!
 

Alec_t

Joined Sep 17, 2013
13,234
To close the valve, 12v must be applied for about 0.5s, and to open, -12v must be applied for about 0.5s.
How is that achieved? Where is the -12V supply?
Does the valve have one solenoid coil for 'on' and another one for 'off'', or is a single coil used with polarity reversal?
 

Thread Starter

Dan Simmons

Joined Jan 11, 2019
12
How is that achieved? Where is the -12V supply?
Does the valve have one solenoid coil for 'on' and another one for 'off'', or is a single coil used with polarity reversal?
I don't pretend to be an expert on solenoid valves, only what I need to know. What I do know is that a latching solenoid uses a permanent magnet to remember its position. A quick google gives a good explanation of how this works:
"Electrical polarity is vital to proper latching solenoid operation. As current flows in one direction, energizing the coil field, it adds to the pull of the permanent magnet. The pull attracts the armature to the stationary pole. Once the armature is in full contact with the pole, the permanent magnet holds it in a latched position without further electrical input. Sending a current through the coil field in the opposite direction cancels the magnet’s attraction and releases the plunger from the latched position." (https://www.tlxtech.com/understanding-solenoids/articles/latching-solenoid-basics)
 

eetech00

Joined Jun 8, 2013
3,418
How is that achieved? Where is the -12V supply?
Does the valve have one solenoid coil for 'on' and another one for 'off'', or is a single coil used with polarity reversal?
Hi

A -12 volt supply isn't needed. The coil drive current just needs to be reversed to change the state of a single coil latch relay.

eT
 
Top