2 Relay Module Interfacing with Arduino

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.
1. Relay Proteus Simulation
- I have also designed relay simulation in Proteus ISIS.
- Relay Proteus ISIS simulation is shown in the figure given below.
2. 2 Relay Module Components
- A complete list of the components used while designing 2 relay module is shown in the figure given below.
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.
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.
- 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.
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.
- 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.
8. 2 Relay Module Circuit Diagram
- Circuit diagram of 2 relay module is given in the figure shown below.
9. 2 Relay Module Interfacing with Arduino Wiring Diagrams
- First you should have a look at Relay Interfacing With Microcontroller using ULN2003A, you will get a better idea about its interfacing with different micro-controllers.
- Wiring diagram for 2 relay module interfacing with Arduino is shown in the figure given below.
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.
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.
13. 2 Relay Module Application
- 2 relay module applications are given in the table shown in the figure below.
×
![]()















































































