One Channel Relay Module With Arduino | Embedded System | New Topic [2023]

Share To:

In this article, Poly Notes Hub will discuss about the interfacing technique of One Channel Relay Module with Arduino. Also we will learn that about the circuit diagram, operation, and about the code as well.

Author Name: Arun Paul.

What is Relay or Relay Module ?

Relays are electrical switches that have the functionality of remote controls. Its purpose is to regulate a circuit by opening or shutting contacts in reaction to variations in signals, voltage, current, temperature, or other factors.

Think of it as a bridge connecting two different circuits. A switch is pulled by a tiny electrical current passing through the relay’s coil, which opens or closes contacts in a different area of the circuit. This has the benefit of enabling low-power signals to regulate higher-power circuits, which is useful in a variety of electrical applications. They are used for things like managing heating systems, turning on alarms, controlling motors, and controlling lights.

Terminals of Relay

  • A and B Coil Terminals ( Used as Power Terminals )
  • COM ( Common Terminal )
  • NO ( Normally Open )
  • NC ( Normally Closed)
what is relay terminals poly notes hub

Interfacing One Channel Relay Module With Arduino

In this circuit, we will learn how to operate an LED by a relay. Here, we are using a one-channel relay. So, we can only operate one LED at a single time. If you want to operate more than one LED, you must use more relays per your LED’s counts. For example, if you want to operate three led then you have to use three relays with similar circuit connection.

Required Components

  1. Relay ( 12V ) – One
  2. Diode ( 4007 ) – One
  3. LED ( Any Color ) – One
  4. Resistor ( 100 OHM ) – One
  5. Transistor ( BC547 ) – One
  6. Power Supply – +5V ( For LED ) and +12V ( For Relay )
  7. Arduino UNO

Circuit Diagram

Below shows the circuit diagram of one channel relay module with Arduino –

In this circuit diagram, Poly Notes Hub discusses how to connect single channel relay module with Arduino ?
  1. Arduino’s D8 PIN connected to the transistor base terminal.
  2. Transistor emitter terminal connected to the negative terminal of the power supply.
  3. A diode connected between the coil terminal of relay. Diode must be connected in reverse biased.
  4. A 12V supply is provided to the relay.
  5. LED’s anode terminal connected to the 5V through a 100 ohm resistor.
  6. LED’s cathode terminal connected to the NO terminal of the relay.
  7. Relay’s COM terminal connected to the ground or negative terminal of the power supply.
One Channel Relay Module With Arduino
| how to connect relay module with arduino uno

How it works ?

  1. When the digital terminal D8 of Arduino UNO becomes HIGH depending on the uploaded code, the base of the transistor gets the supply and switched. The relay’s coil one terminal gets connected to the ground.
  2. After getting connected to the ground terminal, the relay’s coil is magnetized because another terminal of the coil is already connected to the 12V Power Supply. Note, that if the relay is 5V then the relay supply should be 5V.
  3. After the magnetization of the coil, the COM terminal connected with the NO. And then the LED starts blinking.
  4. When the Arduino’s D8 becomes LOW the coil of the relay stops magnetization and then the COM terminal is connected with the NC of the relay and the LED stops blinking.
  5. This process continues until the supply is off.
  6. For visual experience please watch the video which we attached below.

Code for Arduino

Upload this code to Arduino and see how the circuit will work.

void setup() {
  pinMode(8, OUTPUT); // D8 PIN of Arduino Assigned as a Output Terminal

}

void loop() {
  digitalWrite(8, HIGH); // Produce output for 2 Sec
  delay(2000);
  digitalWrite(8, LOW); // Off for 2 Sec
  delay(2000);

}

Video for Reference

Share To:

Leave a Reply

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