From what I understand, you use a relay when you have two circuits of incompatible voltages (one too high for the other). In my project, I have a 12V power supply that will supply power to my Arduino Uno and to the pump. Most of the projects I've seen so far use a relay, but if both the Uno and the pump are using the 12 volts, do I need it? Or can I just directly connect the pump?
I am old, I prefer to use a relay to drive a motor like a water pump.
You can use a logic MOS FET directly with a motor.
For on/off control of a water pump, place a kickback diode across the motor terminals.
Keep motor wiring away from other wiring.
As long as they have a common ground, you don't necessarily need a relay, HOWEVER, there is no way the pins on the Arduino can drive a 12v water pump directly. The arduino can only handle 5v (or 3.3 on some) with a maximum current of something like 40 ma (.040A). You can use a transistor such as a FET to switch the pump or you could use a smaller transistor to drive the coil of the relay since the Aruino usually would not have enough current to drive the relay assuming it had a 5v coil. Either way, you are going to need something to either control the motor direct or drive the relay coil. Without more information on how much current the motor needs, it is hard to say exactly what parts you need.
mikey
Ah, I didn't think about the current limit of the Arduino. I guess I'll stick to using a relay for the switch.
And a transistor to drive the relay.
.
use the relay for on/off control of the pump
use a FET if you need variable speed. you can pwm the FET to get a variable speed.