Relay -why it acts the other way - help needed!

retrolefty:
Your wiring is correct. What is wrong is your coding:

digitalWrite( relay , HIGH)   It turns off the relay I don't under stand it  . Usually I used HIGH command to turn on a led or anything 

digitalWrite(relay , LOW) it activates the relay and load gets the power. Someone plz tell me,why it is acting the other way?




For that and most Asian relay modules digitalWrite( relay , HIGH) will turn the relay off and
digitalWrite( relay , LOW) will turn the relay on. You just need to get over the fact that you have in your mind that a HIGH output always means ON and a LOW means always OFF, it's not the case with that specific relay module.

Lefty

CrossRoads:
If it's a relay board, they are often set up with optoisolators - you can sink current (low signal) to turn it on, or it can be wired so that you source current (high signal) to turn it on.
Most that I've seen recently need a low to turn them on.

NC vs NO and COMMON - relays can be used to connect 1 of 2 signals to input for example, or to switch an output to 1 of two inputs - or just as a power switch as you are doing. So three different uses right there - need to think broadly about these things.

i thought, i was wrong in wiring r coding.if relay works this way then It is cool . Thanks lot guys !
Once again thanks to all for helping.