You use a relay as an electrical switch operated by an electromagnet, typically to control a high-voltage or high-current circuit using a low-voltage or low-current signal.
What is a Relay?
A relay is essentially an electrical switch that is controlled by electricity rather than a manual hand operation. It uses a small amount of power to control a much larger amount of power. This makes them useful for protecting sensitive control circuits from high-power loads or for allowing low-power circuits (like those from microcontrollers) to switch higher-power devices.
Key Components
A basic relay consists of a few main parts:
- Electromagnet (Coil): This is the part that receives the control signal. When voltage is applied to the coil, it creates a magnetic field.
- Armature: A movable metal part that is attracted by the magnetic field when the coil is energized.
- Contacts: These are the actual switch terminals. They are typically described as:
- Common (COM): The pivot point of the switch.
- Normally Open (NO): This contact is open (no connection) when the coil is not energized.
- Normally Closed (NC): This contact is closed (connected) when the coil is not energized.
How Relays Work
When voltage is applied to the relay's coil, the electromagnet is energized. This magnetic field pulls the armature, causing the common contact to switch positions:
- The connection between Common (COM) and Normally Closed (NC) is broken.
- The connection between Common (COM) and Normally Open (NO) is made.
When the voltage to the coil is removed, the magnetic field collapses, and a spring or the armature's own stiffness pulls it back to its original position, restoring the connection between Common (COM) and Normally Closed (NC) and breaking the connection between Common (COM) and Normally Open (NO).
Connecting and Using a Relay
Using a relay involves two main circuits:
- The Control Circuit: This is the low-power circuit that energizes the coil.
- The Load Circuit: This is the high-power circuit containing the device you want to switch.
Here’s how you typically connect them, incorporating information from the reference:
1. Connecting the Control Circuit (Coil)
- Connect the two terminals of the relay's coil to your control signal source (e.g., a microcontroller pin, a switch, a sensor output). Ensure the voltage and current supplied match the relay's specifications. Polarity might matter for some relays with integrated protection diodes, but generally not for the coil itself on standard relays.
2. Connecting the Load Circuit (Contacts)
This is where you connect the device you want to control. The reference highlights the connection points for the device that the relay will power.
- Identify the Common (COM) terminal: This is the terminal that switches between the NO and NC contacts.
- Connect the power source: One side of the power source for your device (e.g., the positive terminal of a battery or the hot wire from the mains) is typically connected to the Common (COM) terminal of the relay contacts.
- Connect the device: The device you want to power (like a light, motor, or appliance) has two terminals.
- Connect one terminal of the device to the other side of the power source (e.g., the negative terminal or the neutral wire).
- Connect the other terminal of the device to either the Normally Open (NO) or the Normally Closed (NC) terminal of the relay contacts, depending on how you want the device to behave when the coil is not energized.
Based on the reference:
- Normally Open (NO) Terminal: This connects to the device you want to power when the coil receives sufficient voltage to energize. The device remains off when the relay has no power (coil not energized) and switches on when the relay receives power (coil energized).
- Normally Closed (NC) Terminal: This terminal connects to the device you want to power when the relay receives no power (coil not energized). The device will be off when the coil is energized.
Here's a simple representation of terminal functions:
Terminal Type | State When Coil NOT Energized | State When Coil IS Energized | Connect Device Here If... |
---|---|---|---|
Common (COM) | Connected to NC | Connected to NO | Connects to the power source for the device |
Normally Open (NO) | Disconnected from COM | Connected to COM | You want the device OFF when the coil is off, ON when coil is on. |
Normally Closed (NC) | Connected to COM | Disconnected from COM | You want the device ON when the coil is off, OFF when coil is on. |
Practical Example: Switching a Light
Imagine you want to turn on a 120V AC light using a 5V DC microcontroller signal.
- Control Circuit: Connect the microcontroller's 5V output pin and ground to the two terminals of a 5V relay coil.
- Load Circuit:
- Connect the Common (COM) terminal of the relay contacts to the hot wire (black wire) from your 120V AC power source.
- Connect one terminal of the light bulb to the Normally Open (NO) terminal of the relay contacts.
- Connect the other terminal of the light bulb to the neutral wire (white wire) from your 120V AC power source.
Now, when the microcontroller outputs 5V, the relay coil energizes, the COM contact switches to the NO contact, completing the 120V circuit, and the light turns on. When the microcontroller output is 0V, the coil de-energizes, the COM contact returns to the NC position, breaking the connection to the NO terminal, and the light turns off.
Using a relay allows the low-voltage microcontroller to safely control the high-voltage light without direct connection.