Arduino for 12v dc motor

I tried hooking up a 12v peristaltic pump to an arduino, however it didnt work. I think this is because there isnt enough current for the motor (or pump but a peristaltic pump is practically a dc motor). Is what I need to do have a transistor for the pump to amplify the current such as a pn2222 transistor, or is there a better way or a better transistor.
Thanks in advance.
Dean.

An Arduino pin can supply 5V at most, and a low current at that, so no wonder that a 12V motor does not work. Let's hope that you have not damaged the Arduino by trying

Members with more knowledge of electronics will give you advice on how to drive the motor from the Arduino

Use PWM and solid state relay.
I wrote an detailed case about this.

(look at the bottom link)

Right thank you both for your help, I do have relays I was just wondering if I could cut them out as it would make things cheaper and I know that I have used dc motors in the past with arduino albeit at a lower voltage.

Do you need to control the speed of the motor or is it simply on or off ?

Its Just on or off. I do have a l298n board lying around could I just wire up my motors to this and have a 12v supply to the l298n?

How much current does that motor need?

I believe it is 625mA as it is a 7.5W at 12V and just used a rearrange power formula for current.

You must pick a motor driver based on motor supply voltage and the motor stall current. Stall current can be many times the running current. The motor will draw stall current, briefly, every time that it starts. Until you know the stall current you cannot, intelligently, choose a driver. The stall current should be listed on the motor data sheet. If not, one can estimate the stall current. Measure the motor winding resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.

Is the motor to be reversible or run in one direction only. If it needs to be reversible, an H-bridge driver will be required. The L298 and L293 drivers are ancient and inefficient and terrible drivers by today's standards. Pololu has a great line of modern motor drivers and good instructional pages for the use of each of their products.

If the motor needs to rotate in only one direction a simple MOSFET driver would suffice. Again, choose the MOSFET based on motor supply voltage and stall current.