Relay Interface With Arduino Circuit Diagram

Relay Interface With Arduino

Arduino Tutorial

Hey, Do you want to know how to Relay interface with Arduino? Do you want to control your electrical appliances just sitting in your room? Do you feel lazy to turn the lights on and off? Are you working on a project that requires the use of controlling A.C. devices? well, you are at the right place. In this article, we’ll go over how to function, use, and interface the Relay module With Arduino in a step-by-step detailed guide. Hence, I hope you find this useful. We at Techatronic have already uploaded several Arduino Tutorials and detailed project guides related to Arduino which will be useful to learn the basics and programming of Arduino.

What is Relay Module?

Relay is basically a switch, which needs electrical energy to work. This can be used to control devices which can be anything from A.C. to D.C. These switches are gaining popularity in devices related to home automation. we can also make our own DIY projects related to Home Automation using IoT. you can also use this module to make a voice-controlled switch that can work with both Google Assistant and Alexa, using NODEMCU as its brain.

This can work much spontaneously which makes it a great addition to any project. the coil requires 5V to operate which is a very common voltage on which many microcontrollers work. this makes it easy to use in projects which use them. Relay modules are available in many channels as per need ranging from single-channel all the way up to sixteen-channel.

How Does the Relay Module Work?

Relay Module Works on the basis of Electromagnetism. A coil inside a relay is used for the functioning of the relay. When an electric current passes through the coil, it forms an electromagnetic field. An iron core inside the coil moves and it helps the contacts to touch, helping the circuit to close. when no current passes through the coil, the contacts are normally open.

There are two types of relay configuration available. they vary in their throw and pole. The pole is the control terminal of the coil, whereas the throw is the possible connections as output. a Single pole-Single throw relay can control only one switch at a time whereas a single pole-Double throw relay can work as two Switches.

Components Required

  • Arduino UNO
  • Relay Module
  • AC Bulb
  • AC power  supply
  • Jumper Wires
  • Breadboard
  • USB cable to connect Arduino UNO with computer
S.No Component Required Quantity Buy Link
1. Arduino UNO 1
2. Arduino UNO Cable 1
3 5V Single Channel Relay 1
4. AC Bulb 1
  AC Bulb Holder 1
5. Jumper Wire 40
6. Breadboard 1
7. 9 Volt Battery 1

Relay Interface With Arduino Circuit Diagram

Relay Interface With Arduino Circuit Diagram

Arduino UNO Relay Module
D4 Pin IN1 OUT Pin
( +5V ) VCC VCC ,  ( + 5V )
GND ( Ground ) GND
AC Bulb 220 V AC Supply Relay Module
Normally Open
Phase Common
Terminal 1 Normally Closed
Terminal 2 Neutral
  • VCC of the module to 5V of Arduino UNO
  • GND of the module to GND of Arduino UNO
  • Trigger Pin of the module to D8 of Arduino UNO

Relay Interface With Arduino Code

 void setup()  
  pinMode(8,OUTPUT); // RELAY PIN  
  digitalWrite(8,HIGH); // Normally ON Only For Chanies Relay Module  
 void loop()   
  digitalWrite(8,LOW); // RELAY ON  
  digitalWrite(8,HIGH);  // RELAY OFF  

Before uploading the code, check all the connections properly as you are working with live 220 Volt A.C. The bulb will turn on for 1 second and turn off for another 1 second. I hope you will find this tutorial helpful. If you have any queries, you can ask us in the comment section below.

Spread the love, Share this post with friends