nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Relay for motorized valve

Sat Mar 22, 2014 2:56 pm

Hello everybody --
I am new to raspberry pi (absolutely loving it), and electronics. I think I am starting to understand little better but still needs a lot of validation. I write programs for living.

I am also a homebrewer and wanted to utilize my newfound toy -- Raspberry Pi -- for my automated brewing rig I am working on. I decided to use this motorized valve from alibaba http://www.alibaba.com/product-detail/1 ... 45782.html. It is a three-wire valve. Here is the wiring diagram for the valve found on the same URL.
valve-wiring-diagram.png
valve-wiring-diagram.png (38.41 KiB) Viewed 3088 times
I think this is what you would call a 1-pole double throw switch -- right?I was wondering if I could use a relay (or SSR) to operate this valve from RaspPi/GPIO. I was thinking that perhaps something like this would do the trick: http://www.ebay.com/itm/8-SPDT-Power-Re ... 1055957831. What are your thoughts? If not would you mind suggesting any other that should work?

Thank you in advance!

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Relay for motorized valve

Sat Mar 22, 2014 3:26 pm

you can probably do it with a transistor, but a relay also works. there is not much information on the website. it is possible that you can connect the GND to +12V and the POWER lead to GND, as this device can take ac voltage. if that is the case you could replace the contact with an npn or nmos transistor.

just close the contact to open the valve. I would power it from 12Vdc, as the relay board you are considering is using 12V coils.
I call the kind of contact that is shown in the schematic a normally open contact. there is no need for a double throw contact. this type of contact is also called SPST NO (single pole single throw normally open).
I would not myself connect this relay board to the mains voltage, the distances between signal traces and the relay contacts seem to be far too short for to meet safety requirements.

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Sat Mar 22, 2014 4:33 pm

Thanks Tage! Just when I thought I knew enough :)

I have more questions now. I don't want to bombard you with all of them. I will do some research and find as many answers as I can on my own. I will post back more questions and ask for validation after that. Thanks again.

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Sat Mar 22, 2014 8:27 pm

I think I may have a solution. How about using a power supply like this one? MDR-60-12:
http://www.onlinecomponents.com/mean-we ... p=11952284 (It produces 12V output)
thus avoiding main

And a relay board like this
http://www.sainsmart.com/arduino/arduin ... -mini.html
The drawback of this board is that it will use up one of the 5V pins. I hope I won't need that pin for anything else. And only question is that should DC30V a concern as it is much higher than 12V power supply from MDR-60-12? I am thinking it would be bad only if it is lower than the power supply -- correct?

Thanks again.

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Mon Mar 24, 2014 8:31 pm

Hello Tage --
Was wondering if you could help me with a few question I have.

I wanted to explore running this with a transistor option a little bit. I have read up on transistor and it definitely sounds like a better option. But I am not sure how to hook all the wires up from this valve. All the transistor examples I have seen so far use 2 wires.

Thanks for any help in advance!

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Relay for motorized valve

Tue Mar 25, 2014 3:55 pm

nhs wrote:Hello everybody --
I am new to raspberry pi (absolutely loving it), and electronics. I think I am starting to understand little better but still needs a lot of validation. I write programs for living.

I am also a homebrewer and wanted to utilize my newfound toy -- Raspberry Pi -- for my automated brewing rig I am working on. I decided to use this motorized valve from alibaba http://www.alibaba.com/product-detail/1 ... 45782.html. It is a three-wire valve. Here is the wiring diagram for the valve found on the same URL.
valve-wiring-diagram.png
I think this is what you would call a 1-pole double throw switch -- right?I was wondering if I could use a relay (or SSR) to operate this valve from RaspPi/GPIO. I was thinking that perhaps something like this would do the trick: http://www.ebay.com/itm/8-SPDT-Power-Re ... 1055957831. What are your thoughts? If not would you mind suggesting any other that should work?

Thank you in advance!
HI

In my experience a motorised valve is just a motor with 2 windings (usually 230vac) a direction capacitor inside.

So 4 wires is usual. Earth GR/YW, Neutral BLUE.
2 motor lives that could be Brown and Black.
The capacitor gives 230vac as a back feed, it will electrocute you if you are holding the black while applying power to the brown. So isolation is important.

So...

If you want fully OPEN then fully CLOSED a pair of relays is best. Yes I could do it with 1 but the supply is then permanently applied to both wires.

So please ask for more help if needed.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Relay for motorized valve

Tue Mar 25, 2014 4:34 pm

Hi

This crude diagram will show that applying a live to one wire on the motor how it would track through the capacitor and make the other side 'live' as well.

Therefore relays with physical as well as electrical isolation are my preferred option, rather than a SSD which simplifies connections.
Motorised Valve.PNG
Motorised Valve.PNG (8.91 KiB) Viewed 2872 times

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Tue Mar 25, 2014 6:24 pm

Hello Johndough --
Thanks for you reply.

I am planning to use a 12V DC power supply.

Also, it is a 3 wire valve. Here is a little diagram and some instructions:
valve-wiring-diagram.png
valve-wiring-diagram.png (38.41 KiB) Viewed 2854 times
instructions.png
instructions.png (45.72 KiB) Viewed 2854 times
I was thinking that I could just use a transistor as another user suggested. Do you think that will work?

If not, I have to read up on opto-isolator :). Which I don't really mind.

Thanks for any help.

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Relay for motorized valve

Tue Mar 25, 2014 7:29 pm

nhs wrote:Hello Tage --
Was wondering if you could help me with a few question I have.

I wanted to explore running this with a transistor option a little bit. I have read up on transistor and it definitely sounds like a better option. But I am not sure how to hook all the wires up from this valve. All the transistor examples I have seen so far use 2 wires.

Thanks for any help in advance!
you could try this


RD, GR and BK match the valve connections.
V1 is your 12V dc supply. don't forget that you must connect its GND to GND of your Pi.
GPIO is you r Pi output pin
Q1 turns ON which pulls down the gate voltage on M1.
M1 is any p-channel MOSFET that has 20V gate-source voltage rating.

Tage
Attachments
valve.png
valve.png (16.26 KiB) Viewed 2835 times

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Tue Mar 25, 2014 10:49 pm

Thanks Tage!

I will try this and will post status.

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Wed Mar 26, 2014 4:04 am

Tage --
2 more questions:
1. Why is R1 necessary?
2. Could a transistor do the same job as the mosfet is doing in the circuit?

Sorry for bugging you with so many questions. I hope you don't mind too much.

Thanks.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Relay for motorized valve

Wed Mar 26, 2014 9:37 am

nhs wrote:Hello Johndough --
Thanks for you reply.

I am planning to use a 12V DC power supply.

Also, it is a 3 wire valve. Here is a little diagram and some instructions:

Thanks for any help.
Hi

The instructions are magic.

RD connects to the POSITIVE.
BK and GR are NEGATIVE

If the GR is negative and SW closes I see the POSITIVE also connecting to GR.

I expect there is an internal travel limiter for OPEN and CLOSE.

But I would like to know more about the thing before committing to any specific instructions.

Also I looked at the original link and noticed alternate ways the 3 wires could be connected. Is the diagram you have the correct one?
3 Wires.PNG
3 Wires.PNG (47.65 KiB) Viewed 2648 times
Last edited by johndough on Thu Mar 27, 2014 10:26 am, edited 1 time in total.

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Relay for motorized valve

Wed Mar 26, 2014 2:27 pm

nhs wrote:Tage --
2 more questions:
1. Why is R1 necessary?
2. Could a transistor do the same job as the mosfet is doing in the circuit?

Sorry for bugging you with so many questions. I hope you don't mind too much.

Thanks.
R1 is used to keep the gate-source voltage at zero when the npn transistor is not ON. without it, the gate would float and the MOSFET could be on or off or something in between. (there is also some leakage current in the npn transistor when it is off. that leakage current is flowing through the R1 resistor but only causing a very small voltage.)

you can replace the p-channel MOSFET with a pnp transistor, but you need to add a resistor in series with the collector of the npn transistor to control the base current of the pnp. a MOSFET is controlled by a voltage from gate to source, a pnp is controlled by a base current that flows out of the base. the npn and the newly added resistor defines this base current. the voltage from emitter to base of the pnp will be about 0.6V to 1V depending on the transistor type.

you could try another 10k resistor from the base of the pnp to the collector of the npn.. I could keep R1 connected as shown from emitter to base of the pnp, to handle the leakage current in the npn. (the pnp will amplify this leakage current so there may otherwise be a small current flowing out of the collector of the pnp when Q1 is off.)
Attachments
pnp.png
pnp.png (28.53 KiB) Viewed 2716 times

nhs
Posts: 9
Joined: Fri Mar 21, 2014 4:38 pm

Re: Relay for motorized valve

Thu Mar 27, 2014 1:44 am

Thanks a lot for the explanation Tage. You did not have to draw up another circuit to answer my transistor question -- I was just curious if it was possible or not. But I appreciate the gesture.

Return to “Other projects”