User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Advice on GPIO configuration

Wed Apr 27, 2016 11:51 am

Hello guys.
If possible,
I need an advice on how to configure the RPi to operate with this valve:
http://www.aliexpress.com/item/3-way-DN ... 58008.html
It's a 3-way solenoid valve that will serve to deviate a water flow from one outlet to the other.
I'm having a little difficulty to understand this scheme:
wiring.jpg
wiring.jpg (44.99 KiB) Viewed 767 times
If I understand correctly, to move the valve from one position to the other, I need to invert the connection on the two wires:
position 1: green to GND and red to (+)
position 2: red to GND and green to (+)

Could you kindly confirm this?
Thanks in advance.

PS: considering the title of the thread and how to actuate the above connections with the RPi, maybe better to ask later... :?
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

User avatar
saper_2
Posts: 240
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: Advice on GPIO configuration

Thu Apr 28, 2016 8:44 pm

dentex wrote: If I understand correctly, to move the valve from one position to the other, I need to invert the connection on the two wires:
position 1: green to GND and red to (+)
position 2: red to GND and green to (+)
Yes. The valve have "end-stops" so leaving the switch in one position, won't make the valve to draw current, once it set up for position.

To drive this you need one of:
1. H-bridge circuit + control circuit,
2. 2 relays: 1x with two pole toggling contacts (DPDT/2PDT) + 1x with one normal open contact (SPST / SPDT),
3. 1x bi-stable relay with 2 toggling contacts (2PDT/DPDT) and with 2 coils (yes, they exists)

Ad. 1 - this is 4 transistors circuit, which is controlled from an dedicated IC (e.g. DC motor controller IC there are ICs that have already built-in H-bridge already) - with controller you need 2 GPIOs: one for "Enable" another one for "direction". This one is most pro approach to the problem, but also is rather difficult and not cheap.
Ad. 2 - relay with DPDT contacts you connect like in seller schematic, and the second one control power supply for the toggling one (so you don't have to keep the toggling one switched on constantly). This require two GPIOs too. This is cheapest and simplest solutions and do the trick really good (It's a little dirty but, uh well...)
Ad. 3 - You connect the relay contacts like in seller schematic, and you drive each coil to switch contacts to opposite state. Two GPIOs required. Not the cheapest, but will work fine too - that specific relay (two-coil latching (toggling) double pole double throw contacts) is a expensive thing compared to common relays (common relay is about 10x or more cheaper :D)

I would use the 2 option :) - I'm lazy and I don't like to spend money for exotics parts like latching-relay or DC motor controller (and parts for it's circuit) :D

I think I don't need to mention, that you have to use some circuit wit transistors to drive relays from GPIOs (I assume that by looking at your post count - you're not total green).


Ps. I think the better topic would be "Driving DC motor valve from GPIOs" or something alike... Oh, it just came to my mind: look up how to control DC motor in both direction from raspberry pi (There must be something).

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: Advice on GPIO configuration

Fri Sep 09, 2016 6:49 pm

saper_2 wrote:...
Yes. The valve have "end-stops" so leaving the switch in one position, won't make the valve to draw current, once it set up for position.
[...]
I think I don't need to mention, that you have to use some circuit wit transistors to drive relays from GPIOs (I assume that by looking at your post count - you're not total green).

Ps. I think the better topic would be "Driving DC motor valve from GPIOs" or something alike... Oh, it just came to my mind: look up how to control DC motor in both direction from raspberry pi (There must be something).
Thank you very much for your answer.
Sorry for the late reply... I hate when I forget to click the "watch" button. ;)
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

Return to “Interfacing (DSI, CSI, I2C, etc.)”