Enriquez f3 Formative
Enriquez f3 Formative
Relay Module
A relay is an electrically operated switch that can be turned on or off, letting the current go through
or not, and can be controlled with low voltages, like the 5V provided by the Arduino pins.
Controlling a relay module with the Arduino is as simple as controlling any other output as we’ll.
This relay module has two channels (those blue cubes). There are other models with one, four and
eight channels. This module should be powered with 5V, which is appropriate to use with an
Arduino. There are other relay modules that are powered using 3.3V, which is ideal for ESP32,
ESP8266, and other microcontrollers.
1
Relay Pinout
The six pins on the left side of the relay module connect high voltage, and the pins on the right side
connect the component that requires low voltage—the Arduino pins.
The high-voltage side has two connectors, each with three sockets: common (COM), normally closed
(NC), and normally open (NO).
2
PIN WIRING
The low-voltage side has a set of four pins and a set of three pins.
The set at the right consists of VCC and GND to power up the module, and input 1 (IN1) and input 2
(IN2) to control the bottom and top relays, respectively.
The second set of pins consists of GND, VCC, and JD-VCC pins. The JD-VCC pin powers the
electromagnet of the relay.
The connections between the relay module and the Arduino are really simple:
1.5 Materials/Equipment
1 unit PC
1 unit Arduino Microcontroller
1 unit DC Motor
1 unit Serial Cable
1 unit Battery Pack
1 pc 2P Relay Module
1.6 Circuit Diagrams / Figures / Source Codes (if Applicable)
1.7 Procedure/s
Connections:
3
Motor positive - Relay switch 1 COM input
Motor negative - Relay switch 2 COM input
9v battery positive - Relay switch 1 NO & Relay switch 2 NO
9v battery negative - Relay switch 1 NC & Relay switch 2 NC
Both wires from the motor will connect to both of the COM (middle) inputs of the relay
switches.
The positive wire from the 9v battery will connect to both of the NO (top) inputs.
The negative wire from the 9v battery will connect to both of the NC (bottom) inputs.
This external power supply (9v battery) will be used to power the motor. This can be changed to
control the speed of the motor.
Arduino 5v pin - Relay module VCC pin
Arduino GND pin - Relay module GND pin
Arduino pin#7 - Relay module IN1
Arduino pin#8 - Relay module IN2
After we finish connecting the motor, all we need to do is power the relay switch module itself.
using the arduino, we can connect the wires and send signals to activate the relay switches.
#define CW 7
#define CCW 8
void setup()
{
pinMode(CW, OUTPUT); //Set CW as an output//
pinMode(CCW, OUTPUT); //Set CCW as an output//
}
void loop()
{
digitalWrite(CW,HIGH); //Motor runs clockwise//
delay(1000); //for 1 second//
digitalWrite(CW, LOW); //Motor stops//
digitalWrite(CCW, HIGH);//Motor runs counter-clockwise//
delay(1000); //For 1 second//
digitalWrite(CCW, LOW); //Motor stops//
}
4
1.8 Activity Report
5
1.8.1 Data and Results
// C++ code
//
void setup()
{
pinMode (7_OUTPUT);
}
void loop ()
{
digitalWrite(7,HIGH);
delay(1000),// Wait for 1000 millisecond(s)
delay(1000);// Wait for 1000 millisecond(s)
1.8.2 Solutions
N/A
6
1.8.3 Observations
This experiment is focused on the utilization of the Arduino module in the process of
motor control. Here, the introduction of relay to function as a basic switching device made
the motor to function depending on the logic provided by the user. For this experiment, we
used the relay and the DC motor present in the Tinkercad software. We were able to perform
and make the motor spin clockwise and counterclockwise by using the Arduino board and the
algorithms that we created. Proper connections of the pins must be observed to attain the
desired output. Also, consider it essential to check the proper pins present in the relay. The
9V DC power was needed for the DC motor to spin. The counterclockwise and clockwise
were performed by the DC motor due to the function of the relay where it changes from AC
to DC.
1.8.4 Conclusions
In this activity we were able to familiarize ourselves with the indicators in the relay that
helped in knowing where to properly connect it. Relays usually can be used from 0V-25V
DC and 10 amperes 25V AC or depending on the specifications on the relay used. In the
program given in the module, it can make the relay spin from both directions which is in
counterclockwise direction and clockwise direction. Since, the available relay used is single
relay, it can only work in a single direction. It doesn’t matter if normally close or normally
open is used, the result will still be the same. When simulating the relay, it can work in both
directions one at a time just by changing the polarities of the connection.
7
1.8.5 Rating
Criteria Grade
Total Score