[SOLVED] 5V Relay could be broken?

Hey there. This is the exact relay I'm using. And my setup for it is shown below. The code is irrelevant since it works on the arduino side and my question is related to a possible broken/welded conneciton in the relay.

It worked fine for a time but after about 10-15 mins, it started to work in an always ON state. the LED's on relay showed correctly according to the code, I also could hear the tick when the digital pin triggered the relay too. I'm not so new to electronics but certainly not an expert. It seems to me that the trigger works properly but something might have welded/melted inside so that the electricity always flows through.

Bear in mind that I tried to disconnect arduino and 5V power completely from the relay and it still worked. The power relayed through it like there's no sort of control. I am of course using the NC (Normally Closed) way but no go. Also, switching over to NO way seems to stop the flow of electricity but then, the switch does not do anything.

When nothing makes sense, I'm almost sure that there's something awfully wrong :slight_smile:
The relay is fairly cheap, I ordered new ones with spares too but still would like to know if I'm not aware of something.

The motor I use the relay for draws 0.640A at max (640mA).

So what do you think? Can the relay be burnt? I see no sign of burning/darkening but of course that may not be related at all.

For curiosity, My whole project is something like this;

#include <neotimer.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <NewPing.h>
 
#define SONAR_NUM     2 // Number or sensors.
#define MAX_DISTANCE 90// Max distance in cm.
#define PING_INTERVAL 33 // Milliseconds between pings.
#define ledUp 12
#define ledDown 7
 
unsigned long pingTimer[SONAR_NUM]; // When each pings.
unsigned int cm[SONAR_NUM]; // Store ping distances.
uint8_t currentSensor = 0; // Which sensor is active.
uint8_t lastSensor = 0; // Which sensor is active.
int value1;
int value2;

LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified module
Neotimer thetimer = Neotimer(1000);
 
NewPing sonar[SONAR_NUM] = { // Sensor object array.
  NewPing(9, 10, MAX_DISTANCE),
  NewPing(11, 8, MAX_DISTANCE),
};
 
void setup() {

pinMode(ledUp, OUTPUT);
pinMode(ledDown, OUTPUT);
    digitalWrite(ledUp, HIGH);
    digitalWrite(ledDown, HIGH);
  Serial.begin(115200);
  lcd.setBacklightPin(3,POSITIVE);
  lcd.setBacklight(LOW); 
  lcd.begin(16, 2);
  lcd.clear();
  pingTimer[0] = millis() + 75; // First ping start in ms.
  thetimer.start();
  for (uint8_t i = 1; i < SONAR_NUM; i++)
    pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
}
 
void loop() {
  for (uint8_t i = 0; i < SONAR_NUM; i++) {
    if (millis() >= pingTimer[i]) {
      pingTimer[i] += PING_INTERVAL * SONAR_NUM;
      if (i == 0 && currentSensor == SONAR_NUM - 1)
      sonar[currentSensor].timer_stop();
      currentSensor = i;
      cm[currentSensor] = 0;
      sonar[currentSensor].ping_timer(echoCheck);
    }
  }
  
  if(thetimer.repeat(300)){
    lcd.setCursor(0,1);
    lcd.print("Reset");
    value1 = 0;
    value2 = 0;
  }
  
    lcd.setCursor(0,0);
    lcd.print("Working");
    lcd.setCursor(0,1);
    lcd.print("No Action");
    
  if(cm[0] > 0 || cm[1] > 0)
  {
    Serial.print("0");
    Serial.print("=");
    Serial.print(cm[0]);
    Serial.print("cm ");
    Serial.print("1");
    Serial.print("=");
    Serial.print(cm[1]);
    Serial.print("cm ");
    Serial.println();
  }
  if (cm[0] > 10){
    value1 = 1;
    thetimer.reset();
    delay(50);
  }
    
  if (cm[1] > 10 && value1 == 1){
    value1 = 0;
    goUp();
    digitalWrite(ledUp, LOW);
    delay(400);
    digitalWrite(ledUp, HIGH);
    lcd.clear();
    value1 = 0;
    value2 = 0;
  }

  //set value 2 true
  if (cm[1] > 10){
    value2 = 1;
    thetimer.reset();
    delay(50);
  }
  
  if (cm[0] > 10 && value2 == 1){
    value2 = 0;
    goDown();
    digitalWrite(ledDown, LOW);
    delay(400);
    digitalWrite(ledDown, HIGH);
    lcd.clear();
    value1 = 0;
    value2 = 0;
  }
}
 void goUp()
 {
   Serial.println("MovingUpStarted");
    lcd.setCursor(0,1);
    lcd.print("Go Up Trigger");
    value1 = 0;
    value2 = 0;
 }
 void goDown()
 {
   Serial.println("MovingDownStarted");
    lcd.setCursor(0,1);
    lcd.print("Go Down Trigger");
    value1 = 0;
    value2 = 0;
 }
void echoCheck() { // If ping echo, set distance to array.
  if (sonar[currentSensor].check_timer())
    cm[currentSensor] = sonar[currentSensor].ping_result / US_ROUNDTRIP_CM;
}

Do you think there might be a problem trying to make the motor go both directions at the same time by using the NC terminals on the relays? At least by the Fritzi diagram you show.

Paul

Paul_KD7HB:
Do you think there might be a problem trying to make the motor go both directions at the same time by using the NC terminals on the relays? At least by the Fritzi diagram you show.

Paul

Programmatically impossible :slight_smile: Besides, the motor makes this weird buzzing sound when I tried to energize two directions simultaneously just for a brief moment to see how things go with the motor I have since it's not a very common type.

So no, it's not about two directions triggering simultaneously :slight_smile: Do you think the relays are fried?

flamacore:
Programmatically impossible :slight_smile: Besides, the motor makes this weird buzzing sound when I tried to energize two directions simultaneously just for a brief moment to see how things go with the motor I have since it's not a very common type.

So no, it's not about two directions triggering simultaneously :slight_smile: Do you think the relays are fried?

Look again at your Fritzy diagram. With nothing from the Arduino, both directions are powered.

Paul

Paul_KD7HB:
Look again at your Fritzy diagram. With nothing from the Arduino, both directions are powered.

Paul

Hmm ok I think something is wrong here then. The motor connections are connected in NC ways which should read "Normally Closed", thus there should be no electricity. Am I wrong here? Would you please guide me a little further? :slight_smile:

Normally closed (NC) means with NO power to the relay, the common (C) and the normally closed (NC) are connected.

If you want motor power ONLY under program control, connect the (C) and the (NO). The when the Arduino pin triggers the relay, power will from the PSU to the motor.

Paul

I think I could not describe the issue correctly. My problem is, whichever pin (NC or NO) I connect motor in, the relay makes the click sound, the green led turns on but the power does not flow through. As it's like the green led and click has no effect whatsoever.

The program woprks fine, the green led turns on and off as it should according to the software. Also the relay does make a click sound correctly again.

I tried with only one direction of the motor and the result is the same. I connect the power source to the common pin of the relay, direciton to the NC pin, it works ALWAYS ON regardless of the state of the green LED or click sound.

Yet again, I connect the power source to the common pin of the relay, direction to the NO pin this time, now it does not flow AT ALL. Again, regardless of the state of the LED or click.

To shorten and clarify;

220v Source to Common
Direction to NC
= ALWAYS ON

220v Source to Common
Direction to NO
= ALWAYS OFF

While the LED and the click sound does work as they should. For example LOW for 3 seconds then HIGH for 3 seconds and loop. The LED just does that exactly but it has no effect on the relay.

Perhaps is it more clear now?

I know if you had a volt meter you would have told us the voltage at the motor when you tried it. However, have you tried connecting the power directly to the motor to see if it works in both directions?

Looking at your program, do you think 400 milliseconds it enough time for your motor to begin turning?

Paul

Paul_KD7HB:
I know if you had a volt meter you would have told us the voltage at the motor when you tried it. However, have you tried connecting the power directly to the motor to see if it works in both directions?

Looking at your program, do you think 400 milliseconds it enough time for your motor to begin turning?

Paul

I tried with both directions directly and it works yes :slight_smile: And with 400ms, It worked before for 10-15 mins as I stated in my original post so I'm assuming it's enough but I tried with another basic code which has 3000ms delay, still not working. I'm completely sure that it's not about the code or the digital pin triggering. It all works fine, just does not affect the relay at all.

Any further ideas?

Thanks for all the input btw. Really appreciate it.

flamacore:
I tried with both directions directly and it works yes :slight_smile: And with 400ms, It worked before for 10-15 mins as I stated in my original post so I'm assuming it's enough but I tried with another basic code which has 3000ms delay, still not working. I'm completely sure that it's not about the code or the digital pin triggering. It all works fine, just does not affect the relay at all.

Any further ideas?

Thanks for all the input btw. Really appreciate it.

Well, my first Arduino project was a Peltier cooler/heater using relays to turn the 12 volts on/off and to switch the direction of the current, much as you have done. I had relay problems and replaced relays on the little boards more than once.

I carefully dissected the relays and one had contacts welded together. One had some build up of insulating material on the contacts. No clue where that came from. They are really, really cheap! Just because they have ratings printed on the box, doesn't mean much.

Time for you to get more relay boards!

Paul

Hi,
First, can you please post a copy of your circuit as a picture of a hand drawn circuit in jpg, png?

NOT fritzy, they are hopeless, no terminal labels on the motor, using a DC socket as the mains input? ? ?

Please draw a circuit.
Show power inputs and motor terminals.

Please a link to data/specs of the motor, and/or a picture of its name plate and terminals.

If the motor is an induction motor, I don't think the contacts of the relay would be happy switching inductive current and so quickly.
I cannot see any STOP time to let the motor come to a stop.

What is the application of your project?

Have you written a simple code JUST to cycle your motor back and forth, like 5 seconds in each direction with suitable OFF time for the motor to slow down.

Have you measured the contact resistance of the relays, the NC and when you activate the relay the NO contacts?

Thanks.. Tom.. :slight_smile:

Post a link to that 4 terminal motor and the relay modules you have, can't see the terminal markings on that picture or turn the picture over to see the bottom of the circuit board.


Motor is a similiar one to this. This is the closest I could find because it's a custom made one.

It has 4 pins.

1- 220V voltage always active
2- Direction 1
3- Direction 2
4- Ground

Will try to draw when I get home but the problem is definitely not the motor, not the code, not the 220v power usage. I have correct information from the company that owns the motor, it definitely uses 220V wall source directly while drawing 0.7 amps at max; also tested with a multimeter.

I've tested if the motor works with direct connection, tested if the code works properly with LEDs, tested with and without external 5V supply to the relay module, tested literally every single NC-NO-C connection option possible.

220v (+) -> Motor always active pin
220v Ground -> Motor ground

220v (-) -> Common
Direction -> NC

220v (-) -> Common
Direction -> NO

220v (-) -> NC
Direction -> Common

220v (-) -> NO
Direction -> Common

The project is controlling a roller blind via a swipe gesture using ultrasonic sensors. The code works fine. I can't stress that enough :slight_smile: I'm an established game designer/programmer with 6 years of work behind me. I know when my code works or not :slight_smile: Also, I stated before that I've tested it with just a simple on-off code with 3 seconds delay (3000ms). No, the motor does not need any time to start working or stop working. I really can't stress that enought that the code and the motor are OK.

Now, thanks for the information again; I did not measure the contact resistance of the relays. I've never done that, can you guide me on what should I see when I switch my multimeter to resistor mode when testing those contacts?

Replaced the relay, immadiate fix :slight_smile:

flamacore:
Replaced the relay, immadiate fix :slight_smile:

So it looks like you may have a switching inductive load problem, damaging the relay contacts.
Tom... :slight_smile:

TomGeorge:
So it looks like you may have a switching inductive load problem, damaging the relay contacts.
Tom... :slight_smile:

Looks like it as I've done some research to support that idea :slight_smile: What would you suggest for protection might I ask? Is it something I can shield my relays from? I feel like a transistor or a resistor should be able to provide some form of protection but I'm heavily new to 220v handling so...

Could you guide me? :slight_smile: