A relay operates like an electromagnet. A relay is a switch; which can make contact between two points. Here, there are three such points; COM (common), NO (normally open) and NC (normally closed). The COM will be connected to NC in normal state. The input to the relay, excites an electromagnet (relay coil) so that the normal connection (i. e. , between 'com' and 'NC' terminals) gets switched, so now the connection is between com and NO.
The relay is just a switch. It just do the on off task. It just controls the path. You need to provide the usual supply voltage (like 240V ac) required for operating the lamp (not that 12V, it's just to excite the relay or for operation of the relay). To do the ON OFF action you need to connect the relay in series in the phase just like a switch and arrange the neutral to reach the bulb directly. Suppose you connected the phase like; it comes to COM, and continues from NO to the lamp. Then in normal state the lamp will be off (as phase is not reaching the lamp). When the relay gets excited by the input (12v) com get connected to NO, so now the phase is complete or is connected to lamp and lamp glows.
Relays are in such a sense are advantageous to control loads in such comparatively higher voltage levels with low voltage dc signals like the 12 V you used. What i explained is a simple working principle. There are different types of relays like Reed relay, Contactor, Buchholz relay, Overload protection relay, solid state relay etc. Solid state relays are relays with no moving parts. They are made up of electronics components like thyristors and are controlled with triggering. They are very fast and efficient. Hope you understood at least the very simple basics of relay.
It doesn't matter how many pins is your relay, what matter is the following:
- The nominal voltage to trigger the coil of the relay.
- The Maximum Current for the relay contact.
- The Maximum voltage for the relay contact.
Well the other thing to be considered, is to identify the relay coil if it is not mentioned in above or in the side of the relay by the following.
- using ohmmeter place the ohmmeter on 2 of the pins till you find a small resistance depend of the coil minimum 50 ohm till 300 ohm, this is your coil, since you apply the nominal voltage on it the contact will change it is value.
Note the following, you can just say relay, there is many type of relays. On Delay timer relay, off delay timer relay, telerupteur relay, mechanical relay.
Now the use of a relay for the following things:
- Drive high voltage load through a small voltage.
- Drive AC load through DC voltage.
- Drive many load through single small voltage.
- Isolate high voltage from low voltage.
- Automate things like relay timer, mechanical relay, staircase relays.
Last note, it is preferred to place a diode in reverse parallel on the coil to avoid damage your circuit since the principal of all coils in the world that it provide reverse current since the supply has been cut off.
Other option to be used and keep it in the mind when using relays:
- Time of switching off and on are different.
- Make before break.
- Triak can be replaced a relay in some applications.
- Power mosfet transistor can also replace a relay in some cases only.
- Electronic isolated relays (operate fast and silently).
- Optical relays which are also silent, fast, isolated.
- IC relay, sometime high voltage and high current, never underestimate an electronic parts according to the size, like moc series.