Relay hangs or clacks for a very short time

Hey

I am testing a little with this sketch.
When the water pump is not connected to the relay, the relay switches as expected.
BUT with the water pump connected, the relay stuck (dont open anymore) or only switches very quickly.

What do I mixed here up?


byte pumpe = A3;

void setup() {
  Serial.begin(115200);
  pinMode(pumpe, OUTPUT);
}

void loop() {

  // ---- RELAIS test -------
  digitalWrite(pumpe, HIGH);
  delay(1000);
  digitalWrite(pumpe, LOW);
  //  -----------------------


  delay(5000);

}

My Wiring

Hello swerve0322

The pump would like to have a free-wheeling-diode to kill the induction voltage caused by switching on to off.

Have a nice day and enjoy coding in C++.

1 Like

Hi, @swerve0322

Move your gnd/neg wire for the pump, back to the 12V connector.
At the moment you have pump current flowing through the gnd that is shared with the UNO.

Moving it to where I have edited, makes sure the pump current is not flowing through any wiring associated with the controller.

The diode will help against Back EMF from the pump motor.
Make sure it is connected the correct way around.

Tom.. :smiley: :+1: :coffee: :australia:

2 Likes

Thanks for your answer - with the Diode it works like a charme!

One additional question. The Relais Modul has already a diode - and the idea of this "watering set" is, that I do not need any further stuff. Has the diode on the relais an other purpose?
A lot of other tutorials (https://arduinogetstarted.com/tutorials/arduino-water-liquid-valve or // this one has similar components Automatic watering system with Arduino) use only the relais to switch the pump without any additionals diode?
This is the scematic which i got from this watering set - also no diode?

Greetings

Hi,

The diode on the relay module is for the coil in the relay, it has a similar back-emf when it is de-activated and can cause mischief.
You will find all relay modules like yours will have them fitted to each relay.

That circuit you have shown, does not have the pump supply as part of the controller supply, so interaction would be minimal, but even here a diode across the pump is advisable.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.