0% found this document useful (0 votes)
28 views15 pages

Apoorvs

Uploaded by

ishasaini321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views15 pages

Apoorvs

Uploaded by

ishasaini321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Project Based Learning Report

On
Wiring a relay module to the Arduino UNO board

Submitted in the partial fulfilment of the requirement


For the Project Based Learning in Embedded System Design
In
Electronics & Communication Engineering
By
2214110408 Sneha Amodkar
2214110443 Apoorva Das
2214110439 Anushka Srivastav

Under the guidance of Dr. Arundhati A. Shinde

Department of Electronics & Communication Engineering


Bharati Vidyapeeth
(Deemed to be University)
College Of Engineering
Pune – 410043

Academic Year : 2024 -25


Bharati Vidyapeeth
(Deemed to be University)
College of Engineering,
Pune – 411043

DEPARTMENT OF
ELECTRONICS & COMMUNICATION
ENGINEERING

CERTIFICATE

Certified that the Project Based Learning report entitled, “Wiring a relay module to the
Arduino uno board ” is work done by

2214110431 Sneha Amodkar


2214110443 Apoorva Das
2214110439 Anushka Srivastav

in partial fulfilment of the requirements for the award of credits for Project Based Learning
(PBL) in Embedded System Design of Bachelor of Technology Semester V, in Electronics &
Communication Engineering.

Date:

Dr. Arundhati A. Shinde Dr. Arundhati A. Shinde

Course In-charge Professor & Head


ACKNOWLEDGEMENT

First and foremost, we would like to express our gratitude to our Mentor, Dr. Arundhati A.
Shinde who was a continual source of inspiration. she pushed us to think imaginatively and
urged us to do this project without hesitation. Her vast knowledge, extensive experience, and
professional competence in the subject of Electronic & Communication enabled us to
successfully accomplish this project. This endeavor would not have been possible without her
help and supervision.

Sneha Amodkar
Apoorva Das
Anushka Srivastav
INDEX

S No. Topic Page No.

Problem Statement
1 1

2
Introduction
2

Components Used 3-5


3

Circuit connection & Diagram 6


4

Code Implementation 7-9


5

Conclusion 10
6

7 Reference 11
Problem statement

Wiring a relay module to the Arduino uno board

Solution
In this project, the Arduino Uno will interface with a relay module that serves as an
intermediary between the microcontroller and the high-power circuit controlling the bulb. The
Arduino Uno, equipped with digital output pins, will send signals to the relay module,
triggering it to either close or open the circuit, thereby turning the bulb on or off. This setup
leverages the relay module's capability to handle higher voltages and currents safely,
maintaining isolation between the low-voltage Arduino circuitry and the mains-powered bulb.
.

1
INTRODUCTION

Wiring a relay module to an Arduino Uno board is an essential skill for anyone looking to
expand their knowledge in electronics, automation, and embedded systems. A relay is an
electrically operated switch that can control high-power circuits with a low-power signal,
making it ideal for applications where the Arduino, which operates on low voltage (5V), needs
to control high-voltage devices, such as household appliances, lights, motors, or industrial
equipment.

One of the main challenges when working with microcontrollers like the Arduino is their
inability to handle high current or high voltage directly. If you want to control a 220V AC
appliance or a high-power DC motor, directly connecting it to the Arduino would damage the
board. This is where a relay comes in—it acts as an electrically controlled switch, enabling the
Arduino to turn devices on or off without direct electrical contact with high-voltage circuits.

Using a relay allows you to bridge the gap between low-voltage logic (from the Arduino) and
high-voltage, high-current devices, adding versatility to your projects. Relay modules are
typically opto-isolated, meaning there is no direct electrical connection between the control side
(Arduino) and the load side (the device being controlled), providing an extra layer of safety.

This setup is commonly used in applications like home automation systems, where you can
control lights, fans, or heaters remotely. It’s also prevalent in industrial automation, robotics,
and even DIY projects that require controlling heavy-duty electrical components through a low-
power microcontroller. Understanding how to wire a relay module to the Arduino opens up
numerous possibilities for automation and innovation, allowing you to take on projects
involving both low-power digital systems and high-power electrical loads with confidence

2
COMPONENTS USED
To make a temperature and humidity measuring device using DHT11 and ESP8266, and
display the readings on an LCD screen, the following components are required:

1.Relay module:
A relay module is an electrical switch that allows a low-power signal (like from an Arduino
or other microcontroller) to control high-power devices. Here are its key features:
Key Features:

. Electrical Isolation

 Provides isolation between the low-power control circuit (microcontroller) and the high-power
circuit (like AC appliances), ensuring safety.

2. Control Low Voltage, Operate High Voltage

 Operates with low voltage (3.3V or 5V) from microcontrollers and switches higher voltage
loads, such as 110V/220V AC or 30V DC devices.

3. Normally Open (NO) and Normally Closed (NC) Contacts

 NO contact: Default state is open, current flows when the relay is activated.
 NC contact: Default state is closed, current stops when the relay is activated.

4. High Power Rating

 Relays are designed to handle large currents and high voltages, typically rated for 10A at 250V
AC or 30V DC.

5. Opto-Isolation (in most modules)

 Many relay modules use opto-isolators (opto-couplers) to electrically separate the low-voltage
control circuit from the high-voltage load, enhancing protection against surges and electrical
noise.

3
2.Arduino uno :
The Arduino Uno is one of the most popular and versatile microcontroller boards in the
Arduino family, widely used for prototyping and electronics projects. Here are the key features
that make it highly suitable for beginners and experienced developers alike
Key Features :
1. Microcontroller

 ATmega328P: The Arduino Uno is powered by the ATmega328P microcontroller, which is an


8-bit AVR microcontroller with 32 KB of flash memory, 2 KB of SRAM, and 1 KB of
EEPROM.

2. Operating Voltage

 5V: The board operates at 5V, which is compatible with most sensors, modules, and components

3. Clock Speed

 16 MHz: The Arduino Uno runs at a clock speed of 16 MHz, which is adequate for most
general-purpose projects, providing sufficient processing power for a wide range of tasks.

4. USB Interface

 USB Type-B Port: The Arduino Uno uses a USB connection for programming and power
supply. This interface also allows for serial communication between the Arduino and your
computer for debugging and monitoring.

5. Power Supply Options

 Multiple Power Inputs: You can power the Arduino Uno via the USB cable (5V), a barrel jack
(7-12V), or through the Vin pin (7-12V). It also includes a voltage regulator to ensure stable 5V
and 3.3V power outputs

4
3. Potentiometer:
A potentiometer is a three-terminal variable resistor commonly used to adjust voltage,
control devices, or as a user input component in electronics. Here are its key features:
Key Features:

1. Adjustable Resistance

 The resistance can be manually varied by rotating or sliding a control knob, providing a
continuous range of values.

2. Three Terminals

 Two fixed terminals connected to the ends of the resistive track.


 One wiper terminal connected to a movable contact that slides along the resistive track,
adjusting the resistance.

3. Variable Output Voltage

 The potentiometer acts as a voltage divider, producing a variable output voltage based on the
position of the wiper. The output voltage ranges between the supply voltage and ground.

4. Linear and Logarithmic Tapers

 Linear taper: Resistance changes linearly with the wiper’s movement.


 Logarithmic taper: Resistance changes logarithmically, often used for volume control in audio
devices.

5. Types of Potentiometers

 Rotary Potentiometer: A circular knob for adjusting resistance (most common).


 Slide Potentiometer: A slider that moves linearly to change resistance.
 Trimmer Potentiometer: A small, adjustable type used for fine-tuning.

6. Resistance Range

 Available in various resistance values (e.g., 1KΩ, 10KΩ, 100KΩ), depending on the application.

5
CIRCUIT CONNECTIONS

1.Arduino Uno – 2. Relay Module-


* VCC [5V] * VCC
* GND * GND
* A5(Analog Pin) * IN
* NC, COM, NO

CIRCUIT Diagram

6
CODE IMPLEMENTATION

const int relay = 12;

void setup() {
Serial.begin(115200);
pinMode(relay, OUTPUT);
}

void loop() {
// Normally Open configuration, send LOW signal to let current flow
// (if you're usong Normally Closed configuration send HIGH signal)
digitalWrite(relay, LOW);
Serial.println("Current Flowing");
delay(1000);

// Normally Open configuration, send HIGH signal stop current flow


// (if you're usong Normally Closed configuration send LOW signal)
digitalWrite(relay, HIGH);
Serial.println("Current not Flowing");
delay(1000);
}

7
CODE EXPLANATION

The code provided is used to control a relay module connected to an Arduino Uno. A relay is an
electrically operated switch that allows control over a high-voltage device (like a light or motor)
using a low-voltage signal from the Arduino. The code operates the relay in a Normally Open
(NO) configuration, where the device is normally off until the relay is activated to allow current
to flow.

Code Breakdown:
1. Define Pin for Relay
cpp
Copy code
const int relay = 12;

 This defines relay as pin 12 on the Arduino. This pin will be used to control the relay.

2. Setup Function
cpp
Copy code
void setup() {
Serial.begin(115200);
pinMode(relay, OUTPUT);
}

 Serial.begin(115200);: Initializes serial communication at a baud rate of 115200, allowing


the Arduino to send information to the Serial Monitor (used for debugging and messages).
 pinMode(relay, OUTPUT);: Sets pin 12 as an output, meaning it will send signals
(HIGH/LOW) to the relay to control it.

3. Loop Function
cpp
Copy code
void loop() {
// Normally Open configuration, send LOW signal to let current flow
digitalWrite(relay, LOW);
Serial.println("Current Flowing");
delay(1000);

// Normally Open configuration, send HIGH signal stop current flow


digitalWrite(relay, HIGH);
Serial.println("Current not Flowing");
delay(1000);
}

 digitalWrite(relay, LOW);: This sends a LOW signal to the relay's control pin (pin 12).
In a Normally Open (NO) configuration, setting the pin to LOW closes the relay,
allowing current to flow through the relay and powering the connected device.
o Serial.println("Current Flowing");: Prints "Current Flowing" to the Serial
Monitor, indicating that the relay is closed and the current is flowing through the load
(device).
o delay(1000);: Pauses the program for 1 second (1000 milliseconds), keeping the
relay closed during this time.

8
 digitalWrite(relay, HIGH);: This sends a HIGH signal to the relay. In a Normally Open
configuration, setting the pin to HIGH opens the relay, stopping the current flow and
turning off the connected device.
o Serial.println("Current not Flowing"); : Prints "Current not Flowing" to the
Serial Monitor, indicating the relay is open and current is not flowing.
o delay(1000);: Pauses the program for 1 second, keeping the relay open during this
time.

Summary:

 Normally Open (NO) Configuration:


o LOW signal closes the relay, allowing current to flow and powering the connected device.
o HIGH signal opens the relay, stopping the current flow and turning off the device.
 Serial Output:
o Every second, the Serial Monitor will display either "Current Flowing" (when the relay
is closed) or "Current not Flowing" (when the relay is open).

The code alternates the relay state every second, turning the connected device on and off in a
loop, while providing feedback on the Serial Monitor

9
CONCLUSION

In conclusion, wiring a relay module to an Arduino Uno is a fundamental technique that greatly
enhances the capabilities of your projects by enabling control over high-power devices using the
low-voltage logic of the Arduino. The relay acts as an electrically controlled switch, allowing
you to safely manage devices that require higher voltage or current than the Arduino can directly
handle.

By using a relay in either a **Normally Open (NO)** or **Normally Closed (NC)**


configuration, you can control devices such as lights, motors, and other household or industrial
equipment. With a simple connection of power, ground, and a control signal from the Arduino,
the relay can effectively act as an interface between the low-power Arduino and high-power
external loads.

Additionally, through Arduino code, you can automate tasks, turning devices on or off at specific
times or under certain conditions, which is ideal for home automation, industrial systems,
robotics, and smart energy management. The use of a relay module provides flexibility, safety,
and reliability, making it an essential tool for controlling complex electronic systems in a wide
variety of applications.

Satisfied course outcomes are :-

CO 1: Describe the architecture of Embedded Systems

CO 6 : Select and use the appropriate Arduino Uno and Relay Module for real-world
applications.

10
REFERENCE

https://www.researchgate.net/publication/332835074_Research_Paper_On_Home_Automatio
n_Using_Arduino

https://quartzcomponents.com/blogs/electronics-projects/home-automation-project-using-
arduino-uno-and-2-channel-relay-
module?srsltid=AfmBOopSPRsCBJcI6icjx7rlndmUERoy77ufuyIwViWW4DDL7V_7XzeG

https://www.instructables.com/Home-Automation-With-Blink-eyeorgan/

11

You might also like