solenoid + arduino + circuit only on, not on/off


I'm looking for information on how to troubleshoot a circuit.

I followed the steps in the playground on connecting a solenoid to the arduino, using a transistor, resistor, and diode. Next, I loaded up the Arduino's provided example of turning the LED on / off, and connected the solenoid circuit to that digital output.

The result is that the solenoid turns on, but not off. If I lower the power supply signficantly (less than half), it has a fraction of the power/torque but I hear it turning on each second instead of staying on constantly.

Does this mean my resistor is under powered? How do I troubleshoot to make adjustments so my solenoid will fire correctly under a full load?


Not that I can help, but the type of transistor and diode, and size of resistor that you used are important details that need to be provided.

You might also want to say something about the solenoid and the power supply for the solenoid.

Excellent point.

The solenoid is a 24vdc 32 Ohm rotary arm solenoid from ledex.

The transistor is a TIP-120, and I'm using a 1k resistor and an 1N4004 diode as per the Arduino playground schematic.

Some ideas for you, for figuring out where things aren't as they should be....

Where your circuits connect to Arduino: Disconnect.

Connect that point to 5v and (not at the same time... alternately...) zero volts. That's (sort of) what happens when the Arudino output goes from high to low. Solenoid operates okay? Probably a software problem.

Leave your circuits disconnected. Connect an LED to the place your circuit was connected. Connect other side of LED to current limiting resistor. Connect other side of resistor to zero volts. Run your software. LED should go on and off.

I have run it with an LED in place of the solenoid, it flashes on and off each second. @tkbyd will give your 5v / 0v test a try! Thanks.

I have run it with an LED in place of the solenoid, it flashes on and off each second.

That suggests that your code is okay. Look closely at your circuits.