Redirecting 12v to either one output or another

Hi all,

I'm messing around with a mechanical ball valve and my arduino. The valve works by applying 12v to a red wire to open or to a green wire to close (with a black wire always connected to ground.

Now ... I can happily make this work with two arduino pins, two transistors/mosfets and all the gubbins, but I was wondering if there's a more efficient method, which relies on just one pin ... Perhaps that the 12v would flow to the green wire by default unless the transistor was activated, which would redirect the flow to the red wire?

Not really a dealbreaker, I have enough free pins to use two, but it's bugging me!

Thanks Mark

You need an SPST 5V relay http://www.miniinthebox.com/electronics-diy-arduino-5v-relay-module_p340896.html?currency=USD&litb_from=paid_adwords_shopping&gclid=CjgKEAjwwPabBRCXo46OtM_RhGMSJACgCeqA2GOpKtXFukaztdkcq0ZIjGLbfw8bNgUyv1JFFCIfcfD_BwE

12v=>COMMON red wire=>N.O. contact green wire => N.C. black wire always connected to ground.

[u]Relay OFF[/u] Valve OFF [u]Relay ON[/u] Valve ON

But the whole point of the way it operates is to avoid power drain by only requiring current briefly when switching.

As a consequence it is likely to not be rated for continuous operation - you must check this as it will overheat if so.

Thank you! I'll give this a go.

The valve indicates that it will automatically shut off when it is in position, but I will double check this.

Do you know how to drive the relay ?

I was just reading about changing the polarity to change motor direction in the book, Arduino Robotics. It suggests using an H-Bridge. There are many configurations of this component to suit many purposes. Is the ball valve driven by a motor or a servo?

@Un4gvn, That's all well and good but I think a ball valve is driven with a solenoid not a motor or the OP would probably have mentioned that, althought we can't take anything for granted here on the forum. I think it's too early to bring up H-bridges because the OP has not given us any electrical parameters for the device he is driving (I guess that's "Need-to-Know", and we don't). Let's try not to complicated this any more than necessary.

Thanks raschemmel, I ran across an article about the Open Sprinkler project based on Arduino. The author provides a complete tutorial on the project with schematics and parts list. Open Sprinkler is used to open and close multiple water valves. Perhaps there is something in the article that markpeace can use for his project. Markpeace, I would like to know more about your project. Please keep us informed on your progress. Thanks, MT.

@ Un4gvn ,

I ran across an article about the Open Sprinkler project based on Arduino

Why don't you provide a link ?

I was just web-surfing one evening, in a non-teleological way, when I found this article (http://rayshobby.net/blog/?p=18). It is now a commercial product that can be bought complete or in kit form. If you keep cruising through the blog, you can read about the origins of the project, suggested parts, and Eagle schematics. This page of the blog (http://rayshobby.net/blog/?p=12) displays an updated version of the controller circuit, and a downloadable schematic. It's amazing what you can find on the Web. I think that I was looking at Arduino boards and shields, which lead me to SparkFun, which lead me to the up-coming Maker Fair, which led me to....

That's pretty cool . I like my RainMaker Sprinkler controller cause I can test each output for a selected period of time and because I can program all the outputs for different times or days.

If you want to just use one wire, the below setup might be of interest. Wire the motor so when the relay isn't powered, the valve goes closed and when the relay is powered the valve is opened.