title: Arduino solenoid project is not working
body: <p>I am trying to control a <a href="http://en.wikipedia.org/wiki/Solenoid" rel="nofollow">solenoid</a> using an <a href="http://arduino.cc/en/Main/ArduinoBoardUno" rel="nofollow">Arduino Uno</a>. I followed instructions described in the tutorial <em><a href="http://www.instructables.com/id/Controlling-solenoids-with-arduino/?ALLSTEPS" rel="nofollow">Controlling solenoids with Arduino</a></em>.</p>
  
  <p>The solenoids are <a href="http://store.mansteri.com/index.php/en/motors-actuators/solenoid-5v-small.html" rel="nofollow">Solenoid - 5&nbsp;V (small)</a> and <a href="http://store.mansteri.com/index.php/en/motors-actuators/solenoid-36-v.html" rel="nofollow">Solenoid 36&nbsp;V</a>. The resistor is 10&nbsp;kohm, transistor is <a href="http://www.datasheetcatalog.com/datasheets_pdf/I/R/F/5/IRF520.shtml" rel="nofollow">IRF520</a>, the diode is <a href="http://en.wikipedia.org/wiki/1N4001_and_1N5400_series_diodes" rel="nofollow">1N4007</a>, and the DC battery voltage has been measured to be 7.45&nbsp;V.</p>
  
  <p>When I connect a small solenoid, it vibrates 3 or 4 times normally and its arm is just kind of jammed at a position and start vibrating (kind of trembling) with a high frequency. If I use a big solenoid, it vibrates 3 or 4 times and then stops. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>int solPin = 13;
  
  void setup() {                
      pinMode(solPin, OUTPUT);
  }
  
  void loop() {
      digitalWrite(solPin, HIGH);
      delay(100);               
      digitalWrite(solPin, LOW);
      delay(100);               
  }
  </code></pre>
  
  <p>Where is the problem and how can it be fixed?</p>