A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is necessary to control a circuit by a separate low-power signal, or where several circuits must be controlled by one signal.
A relay is an electrically operated switch of mains voltage. It means that it can be turned on or off, letting the current go through or not.
Controlling a relay with the Arduino is as simple as controlling an output such as an LED.
This relay module has two channels (those blue cubes). There are other varieties with one, four and eight channels.
Pin Connection With Arduino
- GND :- goes to ground of Arduino.
- IN1 :- controls the first relay (it will be connected to an Arduino digital pin).
- IN2 :- controls the second relay (it should be connected to an Arduino digital pin if you are using this second relay. Otherwise, you don’t need to connect it).
- VCC :- goes to 5V of Arduino.
Main Voltage Connections
In relation to mains voltage, relays have 3 possible connections:
• COM: common pin
• NO (Normally Open): there is no contact between the common pin and the normally open pin. So, when you trigger the relay, it connects to the COM pin and supply is provided to a load
• NC (Normally Closed): there is contact between the common pin and the normally closed pin. There is always connection between the COM and NC pins, even when the relay is turned off. When you trigger the relay, the circuit is opened and there is no supply provided to a load.
If you want to control a lamp for example, it is better to use a normally-open circuit, because we just want to light up the lamp occasionally.