A 5V relay is an electromechanical switch that uses a low voltage (5V) control signal to open or close a circuit, enabling the control of higher voltage devices. It consists of a coil, an armature, and contacts. When the coil is energized with a 5V signal, it creates a magnetic field that moves the armature, switching the contacts between their normally open (NO) and normally closed (NC) states.
Explore Projects Built with 5V 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!
This circuit uses an Arduino UNO to control a 5V relay. The relay is powered by the Arduino's Vin and GND pins, and its control input is connected to digital pin D9 on the Arduino. The provided code is a basic template with no specific functionality implemented.
This circuit uses an ESP32 microcontroller to control a 1-channel 5V relay. The ESP32 toggles the relay on and off every 5 seconds, allowing it to control an external device connected to the relay's output.
This circuit consists of a 5V battery powering a 4-channel relay module, which controls four LEDs (red, yellow, green, and blue) through individual resistors. Each relay channel is activated by a corresponding SPST toggle switch, allowing manual control of the LEDs.
This circuit uses a WeMos D1 R2 microcontroller to control a 5V 2-relay module, which in turn controls the power to an AC bulb and a cellphone charger. The microcontroller also interfaces with a line tracking sensor, which likely provides input to control the relay states. The AC bulb and cellphone charger are powered by an AC wire connection, with the relay acting as a switch for the bulb.
Home automation systems (e.g., controlling lights, fans, or appliances)
Industrial control systems
Motor control circuits
IoT projects for switching high-power devices
Safety systems for isolating high-voltage circuits
Technical Specifications
Key Technical Details
Operating Voltage (Coil): 5V DC
Trigger Current: ~70-100 mA
Contact Ratings:
Maximum Voltage: 250V AC / 30V DC
Maximum Current: 10A
Relay Type: Single Pole Double Throw (SPDT)
Isolation: Electrical isolation between control and load circuits
Switching Time:
Operate Time: ~10 ms
Release Time: ~5 ms
Lifetime:
Mechanical: ~10 million operations
Electrical: ~100,000 operations (at rated load)
Pin Configuration and Descriptions
The 5V relay typically has 5 pins. Below is the pin configuration:
Pin Name
Description
Coil+
Positive terminal of the relay coil (connect to 5V control signal).
Coil-
Negative terminal of the relay coil (connect to ground).
Common (COM)
Common terminal for the load circuit.
Normally Open (NO)
Open when the relay is inactive; closes when the relay is energized.
Normally Closed (NC)
Closed when the relay is inactive; opens when the relay is energized.
Usage Instructions
How to Use the Component in a Circuit
Power the Relay Coil:
Connect the Coil+ pin to a 5V DC control signal (e.g., from a microcontroller or external power source).
Connect the Coil- pin to ground.
Connect the Load Circuit:
Connect the load's power source to the COM pin.
For a normally open configuration, connect the load to the NO pin. The load will be powered only when the relay is energized.
For a normally closed configuration, connect the load to the NC pin. The load will be powered when the relay is not energized.
Control the Relay:
Use a microcontroller (e.g., Arduino UNO) or a transistor circuit to provide the required 5V signal to the relay coil.
Important Considerations and Best Practices
Use a Flyback Diode: Always connect a flyback diode across the relay coil to protect the control circuit from voltage spikes caused by the collapsing magnetic field when the relay is de-energized.
Avoid Overloading: Ensure the load does not exceed the relay's maximum voltage and current ratings.
Isolation: Use optocouplers or transistors to isolate the microcontroller from the relay for added safety.
Power Supply: Ensure the power supply can provide sufficient current to energize the relay coil.
Example: Connecting a 5V Relay to an Arduino UNO
Below is an example of how to control a 5V relay using an Arduino UNO:
// Example: Controlling a 5V relay with Arduino UNO
// Pin 7 is used to control the relay
const int relayPin = 7;
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as output
digitalWrite(relayPin, LOW); // Ensure relay is off at startup
}
void loop() {
digitalWrite(relayPin, HIGH); // Turn relay on
delay(1000); // Keep relay on for 1 second
digitalWrite(relayPin, LOW); // Turn relay off
delay(1000); // Keep relay off for 1 second
}
Note: Connect the relay's Coil+ pin to Arduino pin 7 (via a transistor if needed) and Coil- to ground. Use a flyback diode across the relay coil.
Troubleshooting and FAQs
Common Issues and Solutions
Relay Not Switching:
Cause: Insufficient current to energize the coil.
Solution: Ensure the control circuit can supply at least 70-100 mA. Use a transistor or relay driver module if necessary.
Load Not Powering On:
Cause: Incorrect wiring of the load circuit.
Solution: Verify connections to the COM, NO, and NC pins. Ensure the load is within the relay's rated voltage and current.
Microcontroller Resets When Relay Activates:
Cause: Voltage spikes from the relay coil.
Solution: Add a flyback diode across the relay coil and ensure proper decoupling capacitors are used in the circuit.
Relay Stuck in One State:
Cause: Mechanical failure or overloading.
Solution: Replace the relay and ensure the load does not exceed the rated specifications.
FAQs
Q1: Can I use a 5V relay to control AC devices?
Yes, as long as the device's voltage and current are within the relay's rated specifications (e.g., 250V AC, 10A).
Q2: Do I need a separate power supply for the relay?
Not necessarily. If your microcontroller or power source can provide sufficient current (70-100 mA), you can use the same supply. Otherwise, use an external power source.
Q3: Can I control multiple relays with one microcontroller?
Yes, but ensure the microcontroller can handle the combined current requirements. Use transistors or a relay driver module for better control.
Q4: What is the purpose of the flyback diode?
The flyback diode protects the control circuit from voltage spikes generated when the relay coil is de-energized. It is essential for circuit safety and longevity.