Using a Arduino Uno R3 to control a 12V 1.5A DC motor

I wanna use the Arduino Uno to control my 12V DC motor. The target is simple: the motor run for a short time and stop for a while then repeat the process again and again. I am a beginner of micro-controller and dont know whether just motor+Uno+battery are enough. I connected the motor to the PWM port, but the motor does not run.


No way that will work.
It's not a good idea to just connect something and see if it works.
The motor is like a short to any of your Arduino's ports.
So you probably did some damage there.
NEVER connect a motor directly to an Arduino port.

Now how to do this:
Go find a relay that can switch 1.5 A at least.
The coil should not use more than 20 mA (0.02 A).
Connect that to a port of your Arduino so you can switch the motor on and off.
Also connect a diode in such way that the pin with the mark (a line) is connected with the Arduino output pin, and the other side to GND.
This way you will be able to make your motor run at full speed and always in the same direction or to stop.

If you want to also control the speed and/or direction, connecting it will be a bit more difficult.

Thanks for your reply! I will try the relay out.

By the way, I saw some people use a motor shield+UNO R3 to control the DC motor as well. And I have the SainSmart L293D Motor Drive Shield as well, what is the function of it?

I used the following code, and the DC motor is supposed to connect to the M1-M4, but all of them have zero voltage.

#include <AFMotor.h>

AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");

motor.setSpeed(200); // set the speed to 200/255

void loop() {
Serial.print("tick");; // turn it on going forward

Lookup the function and specifications of that shield at the sainsmart site.
I don't think it's meant for motors like yours, but for small steppers.
You can also lookup the specs of the L293D chip to find out what it is able to do.

Do you have any recommendations for my motor? If I also wanna control the direction.


That L293D can handle less than half the current your motor needs, so you can't use that one.

Go for a motorshield that has a L298N on it.
That one can handle 2 A.
There's a ton of those.