0

Its my first attempt to work with relay I tried to test my relay with this simple code

int Relay = 2; void setup() {
 // put your setup code here, to run once:
 Serial.begin(115200);
 pinMode(Relay,OUTPUT);
}
void loop() {
 digitalWrite(Relay,HIGH);
 delay(1000);
 digitalWrite(Relay,LOW);
 delay(1000);
}

I use thius simple 12V Relay

Connected to IN -> Digital 2 GND -> GND VCC -> 5V

The only thing is happened is the LED of the relay blinking in every sec. but can not hear the clicking sound from the relay box or testing with a multimeter's diode function the two(NC and COM) OUTs aren't close I tried to test other relays(from the same type) but does not do anything else.

thank you for your help What can be wrong?

asked Jul 27, 2018 at 8:48
1
  • Can you try the relay without arduino? 5V->5V, GND->GND, IN->0V/5V should simulate the arduinos programm. If it does not click, it may be damaged. Commented Jul 27, 2018 at 10:58

2 Answers 2

1

NC is "Normally Connected" - this contact is connected to COM ("common") if coil of the relay is not powered - the relay is disconnected.

NO "Normally Open" is connected to COM when the coil of the relay is powered - the relay is connected.

Some relays have the coil powered when the signal from MCU is LOW.

If the coil of the relay doesn't click, but the signaling LED lights up, then VCC is not connected. Check if you plugged the wire really to 5 V on Arduino side.

answered Jul 27, 2018 at 9:47
0

You need to define Relay. If the LED on the relay module is blinking, then you must have defined as pin 2 output, but omitted it from the code you posted. Please post all of the code!

It is good practice for all user variables to start with lowercase, e.g. relay not Relay. Then the code becomes:

relay = 2;
void setup(){
pinMode(relay,OUTPUT);
digitalWrite(relay,"LOW");
}
void loop(){
digitalWrite(relay,"HIGH");
delay(1000);
digitalWrite(relay,"LOW");
delay(1000);
}

If the relay still does not click on/off, test the microcontoller voltage output on the relay pin using your voltmeter. Check the relay is not dead or mis-wired.

answered Jul 27, 2018 at 9:11
1
  • sorry the relay was defined just made a mistake when copying the source code Commented Jul 27, 2018 at 9:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.