2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to provide a detailed discussion on 2 Relay Module Interfacing with Arduino. First of all I would like to explain you that what is relay and how to use it and then we will move forward towards 2 relay module interfacing with Arduino. I have already controlled relay with 555 timers. 2 relay module consists of two relays. Relay is basically an electronic device or a switch which is used to open and close the circuits electronically. A relay controls an electric circuit by opening and closing contacts in another circuit. When the relay contact is normally open (NO), there will be an open connection when the relay is not energized. When the relay contact is normally closed, there will be a closed connection even when the relay is not energized. We can use relays to control the smaller currents in different electronic circuits. 2 relay module has two relays. One relay can control two AC/DC device simultaneously. That means 2 relay module can control four AC/DC devices at a time. 2 relay module is normally used to control the DC motors in different projects e.g. robotics, automation, embedded projects etc. It can control two DC motors simultaneously. Moreover, we can also use it for different applications e.g. to control DC/AC fans, AC/DC lights, AC/DC bulbs and a lot more. The further detail about 2 relay module interfacing with Arduino will be given later in this tutorial.

2 Relay Module Interfacing with Arduino

2 Relay Module is an electronic device consists of two relays as its major components. Relay is a switch which makes or loses the connection between two different circuits. A single relay is capable of controlling two AC/DC devices simultaneously. So, 2 relay module is able to control four AC/DC devices at the same time. Mostly it is used to control the DC motors. It can also be used in different projects e.g embedded projects, robotic, automation, power etc. 2 relay module is shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
1. Relay Proteus Simulation
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
2. 2 Relay Module  Components
  • A complete list of the components used while designing 2 relay module is shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
3. 2 Relay Module  Input Pins
  • 2 relay module has five (5) input pins in total, each perform different action.
  •  All of its pins are provided in the table shown in the figure below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
4. 2 Relay Module  Input Pins Description
  • We must know about the functions of each pin.
  • 2 relay board/module input pin functions are listed in the table shown in the figure below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
  • Both IN1 and IN2 comes from the micro-controller (Arduino UNO in this case).
  • IN1 pin controls the 1st relay attached on 2 relay module.
  • IN2 pin controls the 2nd relay attached on 2 relay module
5. 2 Relay Module  Output Pins
  • 2 relay module has three (3) output pins for each relay.
  • Its output pins are given in the table shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
6. 2 Relay Module  Output Pins Description
  • Each output pin of 2 relay module has its own functions.
  • 2 relay module pin functions are listed in the table given in the figure shown below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
  • NO pin is normally open pin and device attached to this pin will not work if the relay is not energized.
  • COM is a common pin i.e. ground pin.
  • NC is normally closed pin and device attached to this pin will start working even if the relay is not energized.
7. 2 Relay Module  Compatibility
  • 2 relay module is compatible with different micro-controllers.
  • Some of those micro-controllers are provided in the table shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
8. 2 Relay Module  Circuit Diagram
  • Circuit diagram of 2 relay module is given in the figure shown below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
9. 2 Relay Module  Interfacing with Arduino Wiring Diagrams
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
10. 2 Relay Module  Interfacing with Arduino Actual Diagrams
  • I have provided the complete wiring diagram for 2 relay module interfacing with Arduino.
  • Wiring diagram is shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
11. 2 Relay Module  Interfacing with Arduino Source Code & Description
  • If you are new to Arduino software then you must have a look at How to write Arduino code.
  • You just need to copy and paste the source code given below in your Arduino software.
  • The complete source code for 2 relay module interfacing with Arduino is given below.
int relay1 = 6;
int relay2 = 7;  

void setup() {
  
  pinMode(relay1, OUTPUT); 
  pinMode(relay2, OUTPUT);
}

void loop() {

   digitalWrite(relay1,LOW);
   delay(1000);
 
   digitalWrite(relay1,HIGH); 
   delay(1000);
   
   digitalWrite(relay2,LOW); 
   delay(1000);
   
   digitalWrite(relay2,HIGH); 
   delay(1000);
}
  • First of all I have defined relay pins.
  • Then I have changed the mode of these pins to output.
  • After that I have turned on and off both of the relays with the delay of 1 sec or 1000 msec.
  • So, that was the brief description about the source code for 2 relay module interfacing with Arduino.
  • You can download the wiring diagram and complete Arduino source code here by clicking on the button below.

12. 2 Relay Module  Features
  • The most common features associated with 2 relay module are provided in the table shown in the figure given below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
13. 2 Relay Module  Application
  • 2 relay module applications are given in the table shown in the figure below.
2 relay module interfacing with Arduino, Interfacing of 2 relay module with Arduino, 2 relay module Arduino interfacing, how to interface 2 relay module with Arduino, 2 relay module Arduino interfacing, 2 relay module attached with Arduino, Interfacing 2 relay module with Arduino
In the tutorial 2 Relay Module Interfacing with Arduino, we have learnt about the components used in the design of 2 relay module. We have also learnt about the 2 relay module interfacing with Arduino. I have provided the complete Arduino source code, you can control this module using the same code. I hope you have enjoyed the tutorial. If you have any problem you can ask us in comments. Out team is 24/7 available for you. I will share different informative engineering topics in my upcoming tutorials. So, till my next tutorial, take care and bye :)