go_away

Author Topic: is it easy to connect a solenoid to arduino?  (Read 503 times)

0 Members and 1 Guest are viewing this topic.

Offline freeeeemanTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
is it easy to connect a solenoid to arduino?
« on: January 13, 2014, 11:39:15 AM »
i'm working on a project that i posted about earlier and thought i would be able to use a servo, but it turns out that the servo isn't strong enough and is a little too noisy.

so my next step is to try to get a solenoid to work. i looked around and found that it is possible to connect a solenoid  to an arduino board while having an addition power source. i have never used a transistor, solenoid or anything like this and need a little help to start.

essentially, i'm trying to bang a gong through wifi. servos didn't seem strong enough and were too loud. but i have no idea what solenoid to get, resister to get or how to connect them. any help would be appreciated!

thanks,
freeman

my original post is here:
http://www.societyofrobots.com/robotforum/index.php?topic=17439.0

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: is it easy to connect a solenoid to arduino?
« Reply #1 on: January 13, 2014, 01:52:54 PM »
You want a 12V or 24V solenoid that's strong enough.
Here's a wiring tutorial: http://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf
Note that the "1 kOhm" resistor should probably be more like "220 Ohm" or "330 Ohm" for driving a large solenoid.
Make sure your power supply is 24V/1A or more amps.

Personally, I'd replace the NPN transistor with a power MOSFET like the IRLB8721, but the wiring diagram above is likely fine for your needs.

More links:
http://www.adafruit.com/products/413 Solenoid
http://www.adafruit.com/products/355 MOSFET (if you go that way)
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_192681_-1 (power supply)
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_177990_-1 Diode (for example; there are many)

« Last Edit: January 13, 2014, 01:57:22 PM by jwatte »

Offline freeeeemanTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: is it easy to connect a solenoid to arduino?
« Reply #2 on: January 13, 2014, 02:09:25 PM »
awesome, thanks!
how does the MOSFET fit into the wiring diagram? how does one actually connect the wires? i assume there's an easy/standard/non-hacked-up way to do it, i just don't know about such things. i'm a software guy. :)

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: is it easy to connect a solenoid to arduino?
« Reply #3 on: January 13, 2014, 05:13:08 PM »
Where you see a NPN transistor in a low-side switch configuration like this, you can usually replace a N-channel MOSFET.
The "base" of the NPN becomes the "gate" of the MOSFET.
The "emitter" of the NPN becomes the "source" of the MOSFET.
The "collector" of the NPN becomes the "drain" of the MOSFET.
There should be a 10 kOhm - 50 kOhm resistor between gate and source.
There doesn't typically have to be a resistor at all between control pin (on Arduino) and gate, so the base resistor can be removed. If you want one to limit outrush current when switching, 100-150 Ohms is sufficient.

Or just buy the NPN transistor they're using in the Arduino example and call it good. Efficiency likely won't actually matter in this case :-) Jameco or Digi-Key ought to have them. Just change the 1k base resistor to 150-200 Ohms; 5 mA is way too little base current for driving a 1A solenoid in that circuit.
« Last Edit: January 13, 2014, 05:15:48 PM by jwatte »

Offline freeeeemanTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: is it easy to connect a solenoid to arduino?
« Reply #4 on: January 13, 2014, 07:40:33 PM »
thank you!!!

 


Get Your Ad Here