12V Water Pump Controlled by Arduino and Relay Won't Work

Hello,

I am having trouble with controlling a water pump using an Arduino.
All I have in my circuit is the Arduino, a relay, a 12V battery pack, and my 12V water pump.
The water pump doesn't turn on when connected to the Arduino but does turn on when connect it directly to the 12V battery pack I have.

Here is my code:

void setup() {
  Serial.begin(9600);
  pinMode(7, OUTPUT); // Set pin 7 to output
}

void loop() {
  digitalWrite(7, HIGH); // Set pin 7 as "high" or turn it on
  Serial.println("Should be on"); // prints that the pump should be on
  delay(10000); // 10 second delay
  digitalWrite(7, LOW); // Set pin 7 as "low" or turn it off
  Serial.println("Should be off"); // prints that the pump should be off
  delay(10000); // another 10 second delay
}

My wiring:
5V pin on Arduino is connected to DC+ (VCC) pin on relay
GND pin on Arduino is connected to DC- (GND) pin on relay
Pin 7 on Arduino is connected to IN1 pin on relay
COM pin on relay is connected to positive/red wire of battery pack
NO pin on relay is connected to positive/red wire of water pump
Black/negative wire of battery pack is connected to black/negative wire of water pump

Any help would be greatly appreciated! Thanks in advance!

Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

Links:

Water Pump:
https://www.amazon.com/MOUNTAIN_ARK-Submersible-Amphibious-Hydroponic-Fountains/dp/B010LY7P3Y/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=zlufy-20&linkId=52eb718b44e0ca29d8a840bb78947e3b&language=en_US

Relay:
https://www.amazon.com/gp/product/B07M88JRFY/ref=as_li_tl?ie=UTF8&tag=zlufy-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07M88JRFY&linkId=66ad60435e5c1b06cfa288e940d084be

Arduino board is the average Arduino Uno board you can get from the official Arduino website.

The battery pack has room for 8 1.5V batteries making it output 12V. It has a red (positive) wire and a black (negative) wire.

Schematic is attached.

Take good pictures of the wiring and show them to us.

Does the relay board LED operate when being controlled from the Arduino ?

Does the relay click when operating from the Arduino ?

Edit:
That relay might take ~190mA for the coil which might be loading the Arduino.

Try a different i/o pin.

How is the Arduino powered? The drawing doesn't show it.

larryd:
Take good pictures of the wiring and show them to us.

Does the relay board LED operate when being controlled from the Arduino ?

Does the relay click when operating from the Arduino ?

Edit:
That relay might take ~190mA for the coil which might be loading the Arduino.

Try a different i/o pin.

Yes, the red LED labeled "PWR" or "Power" lights up when the circuit is powered up.
There is also a green LED that turns on and off.

No, the relay doesn't make a clicking sound when connected to the Arduino.

Using a different i/o pin doesn't work.

Also, I did some research on relays and apparently if they don't click then the wiring or the relay isn't working. But I double checked my wiring and it should be working so I'm not sure. The relay package I bought had multiple relays so I switched relays and the circuit still didn't work.

jremington:
How is the Arduino powered? The drawing doesn't show it.

The Arduino is powered by a usb cable that is connects the Arduino to my pc.

“There is also a green LED that turns on and off.”

Good sign.

Let’s see a good image of the circuit wiring.

Try changing the time to 1second on/off so the click happens more often, with the pump disconnected.

What is written on the top of the relay ?

The top of the relay has some logos. The main logo says "SONGLE" with a picture of Then there is some lettering that says, "10A 250VAC 10A 125VAC", "10A 30VDC 10A 28VDC", and on the last line in slightly bigger lettering, "SRD-12VDC-SL-C".

Changing the time to 1 second on/off still makes it so that I can't hear any clicking noise from the relay.

Here is the image of the circuit wiring:

“SRD-12VDC-SL-C"

Looks like the coil voltage is 12v on your relay module.

The link you gave from Amazon shows a 5v coil :o

I think this is your schematic for the relay module or it is at least similar.

You need the 5v version.

Wait so I should get a 5V relay even though the water pump is 12V?

I got the link from amazon from a tutorial here: Arduino - Controls Pump | Arduino Tutorial (arduinogetstarted.com)
I used the tutorial to wire it up but I used different code. When I used the code from the tutorial it didn't work.

The pump is 12v; the N.O. contacts on the relay are used to connect the pump to the 12v battery, this is okay.


You are trying to use the 5v power pin on the Arduino to energize a 12v relay coil on the relay module.

This will not work as you can probably suspect.


If your relay coil was rated at 5v, you could energize it with the Arduino 5v as long as the coil current was small.


Edit

“ Wait so I should get a 5V relay even though the water pump is 12V?”

A 5v relay is a relay that has its coil rated at 5v.

What the output contacts are doing has nothing to do with the coil voltage.

You should also add a reversed biased kickback diode across the pump as seen here.

What is a reversed biased kickback diode? Also if I don't use it, will the system short-circuit or break? The tutorial didn't ask for a diode.

Your pump motor is made up from coils of wire.

When your pump is ON, the motor generates a huge amount of electrical noise that can cause interference in the Arduino.

A diode is placed across these coils to stop this electrical noise.

These diodes are placed across ‘non-reversing DC inductive loads’ like your motor.

The diode lead that has a painted band (cathode) is connected to the positive motor wire, the other lead is connected to the negative motor wire. This is the reverse biased connection mentioned.

You can also add a .1uF ceramic capacitor in parallel with this diode to also help reduce noise interference.

The tutorial you site should have had these added in their circuitry.

If you ‘don’t add these components’ your Arduino can and probably will experience problems.

1 Like

With a 12V relay module, you have to connect 12+ (red wire) to the relay module DC+ pin, 12- (black wire) to to DC-, Arduino GND to DC- (along with the 12V- wire), Arduino output pin to relay module IN pin. 12V+ (red wire) to relay NO terminal, pump+ wire to relay COM, AND diode cathode (end with band), pump- AND diode anode to 12V-.

Thanks for the help!

larryd:
Your pump motor is made up from coils of wire.

When your pump is ON, the motor generates a huge amount of electrical noise that can cause interference in the Arduino.

A diode is placed across these coils to stop this electrical noise.

These diodes are placed across ‘non-reversing DC inductive loads’ like your motor.

The diode lead that has a painted band (cathode) is connected to the positive motor wire, the other lead is connected to the negative motor wire. This is the reverse biased connection mentioned.

You can also add a .1 ceramic capacitor in parallel with this diode to also help reduce noise interference.

The tutorial you site should have had these added in their circuitry.

If you ‘don’t add these components’ your Arduino can and probably will experience problems.

Ok then, I will get a 5V relay and a diode. Thanks for your help!

That type of relay module should be taken off the market, too easy for noobs to blow it up along with their Arduino.
Opto isolated relays should have SEPARATE terminals for coil power and logic, 2 terminals for coil + and -, 2 for signal common and input. And why bother making them active LOW when every noob in the universe expects HIGH to be ON?

JCA34F:
With a 12V relay module, you have to connect 12+ (red wire) to the relay module DC+ pin, 12- (black wire) to to DC-, Arduino GND to DC- (along with the 12V- wire), Arduino output pin to relay module IN pin. 12V+ (red wire) to relay NO terminal, pump+ wire to relay COM, AND diode cathode (end with band), pump- AND diode anode to 12V-.

Doing this can cause problems.

There will be ‘no physical isolation’ between the motor and Arduino.

Also, you ‘must connect’ the relay PCB jumper to the ‘high trigger’ setting.

If left at the LOW setting, the Arduino output pin can be damaged.