Go Down

Topic: Best way to drive a 12V DC solenoid valve (Read 17539 times) previous topic - next topic

sta

Jul 28, 2008, 11:56 am Last Edit: Jul 28, 2008, 11:56 am by sta Reason: 1
I'm a complete newbee when it comes to electronics, so I need a little help here.

I have a 12V DC solenoid valve, that draws 450 mA at max. I want to be able to control this valve from the Arduino. I guess I can't draw this much current directly from the Arduino, so I have to go through some kind of relay, correct?

What relay should I look for? 5V DC -> 12V DC? Do I need any other components or can I simply hook up the relay to a digital pin + GND on the Arduino board, and the valve on the other side of the relay?

mem

#1
Jul 28, 2008, 12:20 pm Last Edit: Jul 28, 2008, 12:21 pm by mem Reason: 1
Using the keywords: [glow]arduino solenoid  [/glow]in google bring up a number of relevant links including these:
http://www.arduino.cc/playground/uploads/Learning/solenoid_driver.pdf
http://www.arduino.cc/playground/Learning/SolenoidTutorial

Grumpy_Mike


dnear1

#3
Jul 29, 2008, 02:06 am Last Edit: Jul 29, 2008, 02:08 am by dnear1 Reason: 1
I used a 2n3904 or a 2n2222a transistor with a 1k resistor from base to the output pin on the arduino.  Emittor to Ground, + direct to the solenoid and collector to second wire from solenoid.  These are NPN style.. You can also use a PNP style and just reverse ground and +12v on the ends.

This will supply up to 500ma with standard to-93 transistor.. There are other transistors to use if you need more current..  Or you could just 'double up' the transistors.

sta

Thank you for the information, it was a great help. I now got it all set-up and it actually works as well.

sta

I have to throw in another Qustion:

What are the cons and pros of using a transistor vs a relay solution for driving the valve?

AP

Transistor is cheaper and much faster.  Relay can generally take much more current.  You also have to worry about back current from relays, but not transistors.

And relays generally make a distinctive clunking noise while transistors are silent.

Go Up