Can't get a DC motor to work with Arduino UNO

Dear Arduino community,

I'm currently learning Arduino for the first time and would like to make a DC motor work. I followed a instructables tutorial to create a basic circuit. Here's a photo of what I assembled:

I attached 5V to the "+" rail and the GND to the "-"

And here's the code that goes along with it:

const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to

int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 3000);
  // change the analog out value:
  analogWrite(analogOutPin, outputValue);

  // print the results to the serial monitor:
  Serial.print("sensor = ");
  Serial.print("\t output = ");

  // wait 2 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:

A similar circuit (and the exact same code) worked with a LED - by turning the potentiometer I was able to change it's brightness. After building the circuit for the motor, the only thing that happens is this: - YouTube The motor starts to make a strange noise when I turn the knob (please ignore the noise that starts at 4 seconds - it's the microphone, not the motor. The motor noise starts at 2 seconds)

I tried two resistors: 1K and 330 Ohm, neither worked. My transistor is an 2N2222A; this is why it's turned the other way around. In the tutorial a PN2222 was used, so the Emitter and Collector are on the opposite side. This is the spreadsheet for the motor: M260

I've looked around the web for help but couldn't find a solution. I know this is basic stuff, but I'm just starting out and simply can't find an answer. I would be very thankful for some suggestions.

All the best,

Most likely, either the power supply or the transistor cannot supply enough current to start the motor. The transistor base resistor may also be too large – the minimum value is 220 Ohms. Note that most Instructables are crap.

Do not attempt to power a motor from the Arduino!

What would be the best way to power it, then? As I've said, I'm a beginner when it comes to electronics and Arduino and I wouldn't like to damage the motor or the Arduino...

Try 4xAA batteries for the motor power supply, and connect the negative battery lead to the Arduino ground.

You would be much better off using a logic level MOSFET transistor instead of following that tutorial.

I will try that out and post a message with the result. Thank you!

How is the pot wired? How 'bout a pic with the motor chopped out and the pot and it's wiring chopped in.

The whole circuit looks exactly like the one I posted in the beginning. I bought 4 AA batteries and two new motors (a R280 and a Motraxx X283). Both of them work with the batteries (as @jremington suggested) as well as with my Arduino-Powered circuit. The first motor doesn't work at all, even with the batteries (it still makes the same weird sound). Maybe it's just broken? Anyway, thanks for the suggestion! I think the topic can be now closed.