Choosing a relay.

I was making a project that involves switching a 2HP water pump using a relay.
I was quite successful but something happened then. The relay was stable for about 2-5secs and then started misbehaving, switching on and off, on, off, on, off... .This happened many times, after restarting all.
I want to know why is it happening and how can I solve this problem. Thanks in advance.

There's probably something wrong with your relay driver circuit or the power supply.

Does this happen without the motor attached? i.e. Can you hear the relay clicking randomly?

Please show us what relay you are using (i.e. a link to the datasheet), and if you're not using a relay board with a built-in driver show us a schematic.

And it is possible that the problem is in your sketch. Does it act properly when you remove the relay and instead connect an LED and 220 Ohm resistor to your output pin?

JQC-3FC(T73)DC5V is the relay.

And yes the relay works without the pump connected. A LED is also attached in series, it works fine when pump is not connected.

It makes random clicking noises also.

I don't have a schematic diagram right now, but it is a very simple circuit in which the relay is controlled by a 2n2222a transistor with Arduino pin and the relay has a flyback diode connected. Nothing much.

One thing can I use a Triac instead.
Thank you

relay is 1 amp
pump is 2 HP... 8 amps @ 230vAC

use a switch and see how it works.
I expect premature failure as it is not rated for the application.

also the load is not listed. state what the motor lists as FLA
get a relay that clearly list motor hp in the spec sheet or the label

relays are rated with listings
inductive load
restive load
motor HP

Since your motor is so high above the relay spec, I am sorta surprised the relay did not just melt and short out.

It would be irresponsible for us to help you get your controls to work knowing that your parts are a fire hazard.

How do you power the relay? It may be a voltage regulator that overheats and turns the relay off, then after cooling down turns the relay on again, and so on. Watch the relay voltage...

subha26:
I was making a project that involves switching a 2HP water pump using a relay.

Common problem here. You have basically, told us nothing about your assembly, but are expecting us to figure out how something about which we know nothing at all might be malfunctioning. You are expecting us to have ESP or Telekinesis or whatever … :roll_eyes:

subha26:
I was quite successful but something happened then. The relay was stable for about 2-5secs and then started misbehaving, switching on and off, on, off, on, off… .This happened many times, after restarting all.
I want to know why is it happening and how can I solve this problem. Thanks in advance.

Well, we know that it is either a problem with interference from the pump itself or you are doing something extremely silly such as attempting to power a relay from the Arduino 5 V pin when you are powering the Arduino from “Vin” or the “barrel jack” because you simply cannot power anything other than one or two indicator LEDs from the 5 V pin or output pins when using the on-board regulator.

Wow! :astonished: How could I possibly know that when as I have said, you have told us nothing? Well these are the two most common mistakes reported here, so there is a good chance it is one (or in fact, both). When you start to play the game by showing that circuit diagram, the code according to the instructions and some properly taken photos in full outside daylight but not sun, then we might have a better idea. :grinning:

Thank you.
I have attached a picture. I don’t have any schematic diagram but if you look at the picture, there is one Attiny13a, some resistors, one Led, transformer and a voltage regulator. The resistors beside the MCU are pull_down resistors and one for led and other for the 2n2222a transistor.

Although I made a fix by reversing the operation of relay, meaning when relay is powered the pump is not working and when relay is not powered the pump is working. But I still want to know why is it happening.

Here’s the code:

void setup() {
  // put your setup code here, to run once: 
  pinMode(0, OUTPUT);
  digitalWrite(0, HIGH);
  pinMode(2, OUTPUT);
  pinMode(1, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  power(HIGH);
  delay(3000);
  byte n=0;
  while(analogRead(A2)<=410){
    if(n==5){
      n=0;
      while(analogRead(A3)<=410){
        if(n==5)digitalWrite(0, LOW);
        if(n<5)n++;
      }
      n=0;
      while(true){
        if(!(analogRead(A3)<=410)) {
          if(n==5) {
            digitalWrite(0, HIGH);
            break;
          }
          if(n<5)n++;
        }
        else
          n=0;
      }
      break;
    }
    else
      n++;
  }
  power(LOW);
  delay(27000);
}

void power(byte v) {
  digitalWrite(2, v);
  digitalWrite(1, v);
}

Thanks.

DrDiettrich:
How do you power the relay? It may be a voltage regulator that overheats and turns the relay off, then after cooling down turns the relay on again, and so on. Watch the relay voltage...

There is no heating also.

subha26:
JQC-3FC(T73)DC5V is the relay.

And yes the relay works without the pump connected. A LED is also attached in series, it works fine when pump is not connected.

It makes random clicking noises also.

If you have got an LED in series with the relay, then you do not get the full 5V across the relay coil.
There will be a volt drop of around 1.8V for a red LED, so you are probably only have 3.2V to power your relay.

Such a low voltage will cause the relay to behave erratically as you describe.

A better way of using an LED to indicate when the relay is activated, would be to put it in parallel with the relay coil, (with its own series resistor to limit the LED current).

Is your LED really connected in series as you say, or in parallel?

We haven't seen a schematic yet - hand drawn is OK.

I don't see a buffer cap on the input of the regulator, just a (small/blue) 10 or 22uF decoupling cap.
That cap needs to be at least 470uF for that transformer based circuit (assuming ~100mA current draw).
Ripple on the 5olt supply could now be so high that the MCU just keeps restarting.
Add a 1000uF cap from regulator input to regulator ground.
Leo..

JohnLincoln:
If you have got an LED in series with the relay, then you do not get the full 5V across the relay coil.
There will be a volt drop of around 1.8V for a red LED, so you are probably only have 3.2V to power your relay.

Such a low voltage will cause the relay to behave erratically as you describe.

A better way of using an LED to indicate when the relay is activated, would be to put it in parallel with the relay coil, (with its own series resistor to limit the LED current).

Is your LED really connected in series as you say, or in parallel?

We haven't seen a schematic yet - hand drawn is OK.

Just did it in parallel. Still problem persists. Thank you.

What we need to see is a diagram, but you can start with posting the voltage you get on that buffer cap.
Must be about 9-12volt, assuming you're using an LM7805 regulator.

What voltage is that transformer. 2*6.3volt AC?
Leo..

20180928_202340-min.jpg

Well, clearly you need a real reservoir capacitor on the input to the regulator. Presume it is a 7805, but that is not critical, I would suggest 1 mF, rated at twice the transformer (half) voltage.

Your wiring is not too bad, keeping wires reasonably well paired. I would still be a little concerned about something doing analog reads; we need the schematic to see just what you are doing.

Wawa:
What we need to see is a diagram, but you can start with posting the voltage you get on that buffer cap.
Must be about 9-12volt, assuming you're using an LM7805 regulator.

What voltage is that transformer. 2*6.3volt AC?
Leo..

It is a 9V 500 mA transformer.

This is the schematic. Please pardon me for my bad drawing.

I don't have a 1mF capacitor in my store. Just for curiosity, will the capacitor solve the problem, or a optocoupler in conjunction would be a great choice.

subha26:
I don't have a 1mF capacitor in my store. Just for curiosity, will the capacitor solve the problem, or a optocoupler in conjunction would be a great choice.

I'm not guaranteeing it will solve your problem, but not having a smooth DC power supply will certainly cause problems.

An optocoupler would only be meaningful if you had two different power supplies to separately power the "Arduino" and the relay.

A SSR - Solid State Relay - would be a good alternative, correctly rated and using a heatsink which would not fit in your mug.

hello....

anyone home ???

2 hp = about 8 amps

1 amp relay

a few seconds....

can anyone offer a way to use a relay rated for 1/10th the amps to make it work after it failed ?

is there a capacitor that might fix ?
maybe some PWM ??

or was the motor something that was not listed correctly ?

is the first place to look at the sketch ?
or would it be better to look at how the pins are connected ?

is anyone asking about the motor ?

Most of us have 230/240volt AC mains power, and that relay is rated for 7 (Chinese) Amps @250volt.

Those relay contacts must have a snubber circuit across the contacts if you want it to survive.
Leo..