I'm working on a project using an Arduino Mega 2560 that involves actuating a pull-type solenoid for 10 seconds at a time. I'm using a low voltage solenoid (~6V) that can be under-volted without an issue. The solenoid has just two connections for power and ground. When plugged into the 5V power supply on the board, the solenoid pulls with the expected strength. When I connect it to a digital output pin (I'm using pin 13 right now) to control when and how long it actuates, the pull force drops dramatically, which I believe is a result of the relatively small current coming from the digital pin.
Is there any way I can control the 5V power supply or up the current on the digital pin? I would prefer to do this without adding any extra circuitry.
digital output pins have maximum current rating much less then solenoids require, 30ma is a safe limit to keep to. You run a real risk of burning out an output pin trying to power a solenoid. You need to wire a switching transistor between the output pin and the solenoid for proper operation. First off it would be to find out what the current demand for your solenoid is. A datasheet will usually provide that information.
zach_smith:
At most the solenoid needs around 400 mA when operating at 5V.
Well as the USB +5vdc has a 500ma max you probably shouldn't even be powering via the arduino's +5vdc power. An external power supply is the way to go and use a switching transistor between the arduino output pin and the solenoid/external +5vdc supply. He is an example circuit from the arduino playground: