Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use relay: Examples, Pinouts, and Specs

Image of relayDesign with relay in Cirkit Designer

Introduction

A relay is an electromechanical switch that uses an electromagnetic coil to open or close a circuit. It allows a low-power signal to control a higher power circuit, providing isolation and control in various applications. Relays are widely used in automation, home appliances, automotive systems, and industrial equipment to control high-current devices such as motors, lights, and heaters.

Explore Projects Built with relay

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of RF-Controlled Relay Switch with Indicator LEDs and Buzzer: A project utilizing relay in a practical application
RF-Controlled Relay Switch with Indicator LEDs and Buzzer

This circuit features an RF receiver that controls a 12V relay, which in turn switches between two circuits: one with a green LED and another with a red LED and a buzzer, both protected by resistors. A rocker switch is used to supply power from a 9V battery to the RF receiver and the relay's coil. The relay's normally closed (NC) contact is connected to the green LED, while the normally open (NO) contact is connected to the red LED and the buzzer, indicating that the relay's state determines which of the two circuits is active.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Below are the general technical specifications for a standard 5V single-channel relay module:

Key Specifications

Pin Configuration

The relay module typically has the following pins:

Pin Name Description
VCC Connect to the 5V power supply.
GND Connect to the ground of the power supply.
IN Control signal input (logic HIGH activates the relay).
COM Common terminal for the relay switch.
NO Normally Open terminal (connected to COM when the relay is activated).
NC Normally Closed terminal (connected to COM when the relay is not activated).

Usage Instructions

How to Use a Relay in a Circuit

  1. Power the Relay: Connect the VCC and GND pins of the relay module to a 5V DC power supply.
  2. Control Signal: Connect the IN pin to a microcontroller's GPIO pin or another control signal source.
  3. Load Connection:
    • Connect the device you want to control (e.g., a light bulb) to the NO terminal.
    • Connect the other end of the device to the power source.
    • Connect the COM terminal to the power source's ground or live wire, depending on the circuit design.
  4. Trigger the Relay: Send a HIGH signal (3.3V or 5V) to the IN pin to activate the relay and close the circuit between COM and NO.

Important Considerations

Example: Using a Relay with Arduino UNO

Below is an example of how to control a relay using an Arduino UNO:

// Define the relay control pin
const int relayPin = 7;

void setup() {
  pinMode(relayPin, OUTPUT); // Set the relay pin as an output
  digitalWrite(relayPin, LOW); // Ensure the relay is off initially
}

void loop() {
  digitalWrite(relayPin, HIGH); // Turn the relay on
  delay(1000); // Keep it on for 1 second
  digitalWrite(relayPin, LOW); // Turn the relay off
  delay(1000); // Keep it off for 1 second
}

Explanation:

Troubleshooting and FAQs

Common Issues

  1. Relay Not Activating:

    • Check if the VCC and GND connections are secure.
    • Ensure the control signal voltage is within the relay's trigger range.
    • Verify that the power supply provides sufficient current for the relay.
  2. Load Not Switching:

    • Confirm that the load is properly connected to the NO or NC terminal.
    • Check if the load's voltage and current are within the relay's specifications.
  3. Relay Buzzing or Clicking Rapidly:

    • This may occur if the control signal is unstable. Use a pull-down resistor on the IN pin to stabilize the signal.
  4. Microcontroller Resetting:

    • High-current loads can cause voltage dips. Use a separate power supply for the relay module or add a capacitor to stabilize the power.

FAQs

Q: Can I use a 3.3V microcontroller to control a 5V relay?
A: Yes, most 5V relay modules can be triggered by a 3.3V control signal. However, check the module's datasheet to confirm compatibility.

Q: What is the difference between NO and NC terminals?
A: The NO (Normally Open) terminal is disconnected from COM when the relay is off and connected when the relay is on. The NC (Normally Closed) terminal is the opposite—it is connected to COM when the relay is off and disconnected when the relay is on.

Q: Can I use a relay to switch DC and AC loads?
A: Yes, relays can switch both DC and AC loads, but ensure the load voltage and current are within the relay's rated specifications.

Q: Do I need an external transistor to drive the relay?
A: If you're using a relay module, it typically includes a transistor for driving the relay. For bare relays, you will need an external transistor or driver circuit.