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 high-power device, making it an essential component in many electronic and electrical systems. Relays are widely used in applications such as home automation, industrial control systems, automotive electronics, and power distribution systems. They provide electrical isolation between the control circuit and the load, ensuring safety and reliability.

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

Technical Specifications

Below are the general technical specifications for a standard single-pole single-throw (SPST) relay. Specifications may vary depending on the specific relay model.

General Specifications

Pin Configuration and Descriptions

The relay typically has 5 pins for SPDT relays or 3 pins for SPST relays. Below is the pin configuration for a standard SPDT relay:

Pin Number Name Description
1 Coil (+) Positive terminal of the electromagnetic coil.
2 Coil (-) Negative terminal of the electromagnetic coil.
3 Common (COM) Common terminal connected to the moving contact of the relay.
4 Normally Open (NO) Contact that remains open until the relay is activated.
5 Normally Closed (NC) Contact that remains closed until the relay is activated.

For SPST relays, only the COM, NO, and Coil pins are present.

Usage Instructions

How to Use the Relay in a Circuit

  1. Connect the Coil:

    • Connect the positive terminal of the relay coil to the control signal (e.g., from a microcontroller or transistor).
    • Connect the negative terminal of the relay coil to ground.
    • Ensure the control signal matches the relay's coil voltage (e.g., 5V for a 5V relay).
  2. Connect the Load:

    • Connect the load (e.g., a motor or light bulb) to the COM and NO pins if you want the load to turn on when the relay is activated.
    • Use the COM and NC pins if you want the load to turn off when the relay is activated.
  3. Add a Flyback Diode:

    • Place a diode (e.g., 1N4007) across the relay coil terminals, with the cathode connected to the positive terminal. This protects the circuit from voltage spikes generated when the relay is deactivated.
  4. Power the Circuit:

    • Ensure the power supply can handle the current requirements of both the relay coil and the load.

Example: Connecting a Relay to an Arduino UNO

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

Circuit Connections

Arduino Code

// Define the pin connected to the relay
const int relayPin = 7;

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

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

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating:

    • Check if the control signal voltage matches the relay's coil voltage.
    • Verify that the control circuit can supply enough current to the relay coil.
    • Ensure the relay is connected correctly, and the flyback diode is not reversed.
  2. Load Not Turning On/Off:

    • Confirm the load is connected to the correct relay pins (COM, NO, or NC).
    • Check the relay's contact rating to ensure it can handle the load's current and voltage.
  3. Relay Buzzing or Clicking Rapidly:

    • This may occur if the control signal is unstable. Use a capacitor to stabilize the signal.
    • Ensure the power supply is sufficient and not fluctuating.
  4. Burnt Relay Contacts:

    • This can happen if the load exceeds the relay's contact rating. Replace the relay and use one with a higher rating.

FAQs