Relay Module And Working Details

The relay is the device that open or closes the contacts to cause the operation of the other electric control. It detects the undesirable condition with an assigned area and gives the commands to the circuit breaker to disconnect the affected area through ON or OFF.
Every electromechanical relay consists of
1. Electromagnet
3. Mechanically movable contact
3. Switching points and
4. Spring
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 power is provided to the 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 the load.
It works on the principle of an electromagnetic attraction. When the circuit of the relay senses the fault current, it energises the electromagnetic field which produces the temporary magnetic field.This magnetic field moves the relay armature for opening or closing the connections. The small power relay has only one contacts, and the high power relay has two contacts for opening the switch.
The inner section of the relay is shown in the figure below. It has an iron core which is wound by a control coil. The power supply is given to the coil through the contacts of the load and the control switch. The current flows through the coil produces the magnetic field around it.
Due to this magnetic field, the upper arm of the magnet attracts the lower arm. Hence close the circuit, which makes the current flow through the load. If the contact is already closed, then it moves oppositely and hence open the contacts.
Types of Relay Based on the principle of operation
1. Electrothermal relay:
2. Electromechanical relay:
3. Solid State relay:
4. Hybrid relay:
A. They can be used for both ac and dc systems for protection of ac and dc equipment’s
B. Electromagnetic relays operating speeds which has the ability to operate in milliseconds are also can be possible
C. They have the properties such as simple, robust, compact and most reliable
D. These relays are almost instantaneous. Though instantaneous the operating time of the relay varies with the current. With extra arrangements like dashpot, copper rings.
E. Electromagnetic relays have fast operation and fast reset
a.  High burden level instrument transformers are required (CTs and PTs of high burden is required for operating the electromagnetic relays compared to static relays)
b. The directional feature is absent in electromagnetic relays
c. Requires periodic maintenance and testing unlike static relays
d. Relay operation can be affected due to ageing of the components and dust, pollution resulting in spurious trips
e. Operation speed for an electromagnetic relays is limited by the mechanical inertia of the component
1. Electromagnetic relays are employed for the protection of various ac and dc equipment’s
2. The over/under current and voltage protection of various ac and dc equipment’s
3. For differential protection
4. Used as auxiliary relays in the contact systems of protective relay schemes.
Copy and paste the below given code into Arduino Uno or download via below link:
// is an automatic generator of schematics and code.
// Copyright (C) 2016 Roboplan Technologies Ltd.
// Include Libraries
#include “Arduino.h”
#include “LDR.h”
#include “Relay.h”
#include “SolenoidValve.h”
// Pin Definitions
#define LDR_PIN_SIG A3
// Global variables and defines
#define THRESHOLD_ldr 100
int ldrAverageLight;
// object initialization
SolenoidValve solenoidValve(SOLENOIDVALVE_PIN_COIL1);
// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
while (!Serial) ; // wait for serial port to connect. Needed for native USB
ldrAverageLight = ldr.readAverage();
menuOption = menu();
// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
if(menuOption == ‘1’) {
// LDR (Mini Photocell) – Test Code
// Get current light reading, substract the ambient value to detect light changes
int ldrSample =;
int ldrDiff = abs(ldrAverageLight – ldrSample);
Serial.print(F(“Light Diff: “)); Serial.println(ldrDiff);
else if(menuOption == ‘2’) {
// Relay Module – Test Code
// The relay will turn on and off for 500ms (0.5 sec)
relayModule.on(); // 1. turns on
delay(500); // 2. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds.; // 3. turns off.
delay(500); // 4. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds.
else if(menuOption == ‘3’) {
// 12V Solenoid Valve – 3/4” – Test Code
// The solenoid valve will turn on and off for 500ms (0.5 sec)
solenoidValve.on(); // 1. turns on
delay(500); // 2. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds.;// 3. turns off
delay(500); // 4. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds.
if (millis() – time0 > timeout)
menuOption = menu();
// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
Serial.println(F(“\nWhich component would you like to test?”));
Serial.println(F(“(1) LDR (Mini Photocell)”));
Serial.println(F(“(2) Relay Module”));
Serial.println(F(“(3) 12V Solenoid Valve – 3/4””));
Serial.println(F(“(menu) send anything else or press on board reset button\n”));
while (!Serial.available());
// Read data from serial monitor if received
while (Serial.available())
char c =;
if (isAlphaNumeric(c))
if(c == ‘1’)
Serial.println(F(“Now Testing LDR (Mini Photocell)”));
else if(c == ‘2’)
Serial.println(F(“Now Testing Relay Module”));
else if(c == ‘3’)
Serial.println(F(“Now Testing 12V Solenoid Valve – 3/4””));
Serial.println(F(“illegal input!”));
return 0;
time0 = millis();
return c;
Download Arduino Sketch here. relay with solinoind valve

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.