First, think of the circuit that gets power to your pump, without the relay. You'll have the +V from your power source going to the red wire on your pump, going through the pump to the black wire, then from the black wire to ground on the power source. To put in the relay, your going to disconnect the circuit somewhere, doesn't matter too much where, and put each end of the wire from the disconnection to one of the screw terminals on a relay. One should connect to COM, the other depends on whether you want to the pump to operate when normally open or normally closed.
On the other side of the relay board is where your control wiring, from the Arduino, goes. Connect the +5V and GND on the board to the +5V and GND on the Arduino. Then your going to connect one of your digital outputs on the Arduino to the relay pin. This pin will trigger the relay to flip.
This Instructable should help. They're driving a light, but the principle is the same as a motor. When powering motors it can also be good to put a diode arranged opposite of flow to protect the circuit from the motor.This image below is from that Instructable.
But why a relay? A MOSFET might be easier and simpler.
But first things first, what current does this motor take? Stall current is the first thing
to find out (measure the motor resistance at the terminals). Stall current = 12V / R
hey guys I need some help, I am doing a project with a 240v to 24v transformer, an uno arduino and a 4 relay module and I need to press a pushbutton that starts a 24v dc pump, runs for 15 seconds, stops pump but starts 24v dc motor at same time for 10 seconds, stops motor and loops around to restart pump and does the continuous loop, how do I find the right code for doing this?