How to switch polarity?

Hi all,

first off, I'm new to electronics, so this may be a newbie question :wink:

I want to control a 9v Solenoid from my arduino. I've managed to get myself to a position where I can power the solonoid form the arduino to make it change one way, to make it change back I just switch the +/- wires around.

So my question... how do I build a circuit that allows me to change the polarity from the Arduino?! Can anyone give me any pointers to where I should be looking for examples?

thanks
Tim

The magic word is: H-bridge. It's usually used to run a DC motor in reverse, but electrically it's exactly the same as your solenoid (which apparently doesn't have a spring to return it?).

There are lots of examples if you google, and commercially available H-bridge shields for your arduino.

-j

hi kg4wsv,

thanks, I'll see what I can find for that.

and yeap, the solenoid stays put (is "latching solenoid" the right term?!)

Tim

See this for how to build a H-bridge from relays or an IC:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html
http://www.thebox.myzen.co.uk/Workshop/Motors_2.html