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 control of high voltage or high current devices using a low voltage signal, making it an essential component in automation, control systems, and safety circuits. Relays are widely used in applications such as home automation, motor control, industrial equipment, and automotive systems.

Common applications include:

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.

Key Technical Details

Pin Configuration and Descriptions

The pin configuration of a relay depends on its type. Below is the pinout for a common 5V SPDT relay:

Pin Name Description
Coil+ Positive terminal of the electromagnetic coil. Connect to the control voltage.
Coil- Negative terminal of the electromagnetic coil. Connect to ground.
COM Common terminal. Connect to the load or power source.
NO Normally Open terminal. The circuit is open when the relay is inactive.
NC Normally Closed terminal. The circuit is closed when the relay is inactive.

Usage Instructions

How to Use the Relay in a Circuit

  1. Connect the Coil Terminals:

    • Connect the Coil+ pin to the control signal (e.g., 5V from a microcontroller or external power supply).
    • Connect the Coil- pin to ground.
  2. Connect the Load:

    • Identify whether you want the load to be connected to the Normally Open (NO) or Normally Closed (NC) terminal.
    • For devices that should only turn on when the relay is activated, connect the load to the NO terminal.
    • For devices that should remain on by default and turn off when the relay is activated, connect the load to the NC terminal.
    • Connect the other side of the load to the power source.
  3. Power the Relay:

    • Ensure the control voltage matches the relay's coil voltage rating (e.g., 5V for a 5V relay).
    • Activate the relay by applying the control voltage to the Coil+ pin.

Important Considerations and Best Practices

Example: Connecting a Relay to an Arduino UNO

Below is an example of how to control a 5V relay using an Arduino UNO to switch a 12V LED.

Circuit Connections

Arduino Code

// 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 at startup
}

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

Troubleshooting and FAQs

Common Issues

  1. Relay Not Activating:

    • Check if the control voltage matches the relay's coil voltage rating.
    • Verify that the control circuit can supply enough current to activate the relay.
  2. Relay Chattering:

    • Ensure the power supply is stable and not fluctuating.
    • Add a capacitor across the power supply to smooth out voltage dips.
  3. Load Not Switching:

    • Confirm the load is connected to the correct terminal (NO or NC).
    • Check if the relay's contact rating is sufficient for the load.
  4. Burnt Relay Contacts:

    • Ensure the load's current and voltage do not exceed the relay's contact rating.
    • Use a relay with a higher rating or add a snubber circuit for inductive loads.

FAQs

Q: Can I use a relay to switch AC loads?
A: Yes, relays are commonly used to switch AC loads. Ensure the relay's contact rating supports the AC voltage and current of the load.

Q: Why do I need a flyback diode?
A: A flyback diode protects the control circuit from voltage spikes generated when the relay coil is de-energized. Without it, the voltage spike could damage sensitive components.

Q: Can I directly connect a relay to a microcontroller?
A: It depends on the relay's coil current. If the microcontroller cannot supply enough current, use a transistor or relay driver circuit.

Q: How do I know if my relay is working?
A: You should hear a clicking sound when the relay switches. You can also measure continuity between the COM and NO/NC terminals to verify operation.