How to Build Logic Control Circuits with Relays: From Signal Switching to Motor Drive
Views: 200  Author: Fanhar Relay  Time: 2025.12.11

Relays, as classic electrically controlled switching components, are powerful because they can use small current signals to control the switching and toggling of large current loads, and implement basic logic functions. This control method, based on physical contacts, holds advantages in noise immunity, electrical isolation, and power handling capacity that are difficult for semiconductor devices to replace.


Relay Fundamentals: Deep Dive into Core Components


In order to use relays effectively in the construction of logic circuits, it is necessary to have a comprehensive understanding of their underlying architecture and operational attributes.


Core Components:

Coil: To use relays effectively in the construction of logic circuits, a comprehensive understanding of their underlying architecture and operational attributes is necessary. Key parameters are Coil Voltage (e.g., 5V, 12V, 24V DC) and Coil Resistance, which determine the drive current required.

Contacts: The "output" and actuator of the relay.Configurations can be:

Single Pole Single Throw (SPST): Similar to a basic toggle, possessing simply On and Off states.

Single Pole Double Throw (SPDT): The core of logic circuits. A Common terminal (COM) can alternate between the Normally Closed (NC) and Normally Open (NO) contacts.

Double Pole Double Throw (DPDT): Equivalent to two interconnected SPDT relays, key for complex switching like motor direction control.


Key Electrical Parameters:

Contact Rating:  This is the maximum voltage and current that the contacts can safely handle, whether it is AC or DC.

Operate/Release Time: This limits the maximum switching frequency of the relay in the millisecond range.


Relay Implementation of Basic Logic Functions


The following are classic circuits using SPDT relays to build basic logic gates. Note that these are "equivalent circuits" implementing logic functions, not modern digital integrated circuits.


Logic "NOT" Gate (Inverter)

Goal: The output state consistently contrasts with the input state.

Circuit Analysis:When the input is LOW, the coil remains de-energised, causing COM to connect to Vcc via the NC contact, resulting in a HIGH output.

When the input is high, the coil becomes energised. This causes the common (COM) terminal to separate from the normally closed (NC) terminal and connect to the normally open (NO) terminal (which is either floating or grounded). This results in a low output.

Engineering Practice:A flyback diode is considered to be essential.  It is connected in reverse parallel across the coil (cathode to V+). This means that the back EMF (electromotive force) produced by the coil during deactivation can be reduced. Damage to the driving transistor or microcontroller I/O pin is prevented by this.

Basic "NOT" gate relay circuit, note the flyback diode D1 across the coil


Logic "OR" Gate

Goal: The output is HIGH if any of the multiple inputs is HIGH.

Circuit Analysis:The Normally Open (NO) contacts of two (or more) relays are connected in parallel.

If input is in the HIGH state, the corresponding normally open contact closes, thereby connecting Vcc to the output. This connects Vcc to the output.

Application Scenario: A "Start" switch is required to initiate operation of a multi-location start control device.


"OR" gate circuit implemented using two relays

Logic "AND" Gate

Goal: The output is HIGH only when all inputs are HIGH concurrently.

Circuit Analysis:The normally open (NO) contacts of many relays are interconnected in series.

All NO contacts close simultaneously to create a complete path from Vcc to the output only when all inputs are HIGH.

Application Scenario: Thanks to safety interlock control, the machine cannot start unless both the 'Guard Door Closed' and 'Start Button Pressed' conditions are met.


Classic Engineering Application: DC Motor Direction Control System


This is one of the most representative applications of relay logic switching, namely building an H-bridge drive circuit.


Option 1: Compact Single-Relay Solution

Motor reversal circuit using one DPDT relay

Working Principle:

Resting/Default State: Coil de-energized, motor terminals A+, B-, motor rotates in one direction (e.g., forward).

Activated State: When the coil is turned on, both sets of contacts switch at the same time. The motor terminals change from A+ to B+, and the motor's polarity changes, making it spin in the opposite way.

Advantages: Simple circuit, few components, low cost. As it is mechanically connected, short circuits in the power supply are naturally avoided.

Disadvantage: It only has two speeds. It can go forward or backward. It cannot regulate its speed.


Option 2: Flexible Dual-Relay Solution

Motor direction control circuit using two relays

Working Principle:

Forward: Only the "Forward Relay" energizes. Current path: Power + Relay1 contact M+ M- Relay2's NC terminal Power -.

Reverse: Only the "Reverse Relay" energizes. Current pathway: Power + Relay2 contact M- M+ Relay1's NC terminal Power -.

Stop: Both relays are de-energized.

Advantages:

High Flexibility: Easy to add a "Stop" state.

Easy to Implement Interlocking: The logic of control guarantees that both relays cannot activate at the same time, thus preventing a power supply short circuit.

Disadvantage: Requires additional interlocking logic (could be mechanically interlocked contactors or electrical logic interlocking in the circuit).


System Integration and Practical Considerations

Complete motor reversal circuit integrating control switch

This diagram shows how user input (Fwd/Rev switch) is integrated into the control logic. Different switch positions provide different current paths for the relay coils, determining the motor state.


Complete system view from power source to load

This diagram emphasizes system integrity:

Power Section: BAT1/BAT2 (power source), MOT_1 (load), RLY1 (actuator).

Control Section: "Polarity Control Circuitry" (Relay Driver Circuit). This part can be built using transistors, microcontrollers, logic chips, etc., and serves as the intelligent control brain.


Advanced Design and Reliability Engineering


To turn a schematic circuit into a stable and reliable product, the following engineering details must be considered:

Coil Drive Circuit Design:

Microcontroller I/O pins have limited drive capability; a transistor or MOSFET must be used as a switch to drive the relay coil.

Calculate the value of the base resistor required to ensure that the transistor saturates and provides the coil with sufficient current.


Contact Protection Circuit (Arc Suppression):

When breaking inductive loads like motors, intense arcing occurs between contacts, eroding them and shortening their lifespan.

RC Snubber Circuit: Connect a resistor and capacitor in series, then in parallel across the contacts. This effectively absorbs energy and suppresses arcs.

Metal Oxide Varistor (MOV): To absorb voltage spikes, connect across the contacts.


Hardware Interlock:

In the dual-relay solution, it is absolutely critical to ensure that the Forward and Reverse relays never energize simultaneously, as this would cause a direct short circuit across the power supply terminals with disastrous consequences.

Method 1: Employ mechanically linked contactors that, when one is engaged, physically preclude the engagement of the other.

Method 2: Implement electrical interlocking at the drive circuit level, for instance, by connecting the normally closed contact of one relay in series with the coil of another relay.


Status Indication and Diagnostics:

Parallel an LED indicator across the relay coil to visually display the current status.

The control loop should have a fuse or PTC resettable fuse for overcurrent protection.


Summary: Relay Advantages and Limitations


Advantages:

High Electrical Isolation: The insulation voltage for control, that is to say the coil, and load, that is to say the contacts, can reach levels of thousands of volts.

High Power Capacity: A small relay can easily control kilowatt-level AC loads.

Strong Noise Immunity: Insensitive to ESD and surges.

Intuitive Design: Circuits are easy to understand and debug.


Limitations:

Slow Speed: Mechanical action, response time in milliseconds, unsuitable for high-frequency PWM speed control.

Finite Lifespan: Mechanical structures are subject to wear and fatigue; electrical contacts erode.

Size and power consumption:  In terms of size, relays are larger than both solid-state relays (SSRs) and metal-oxide-semiconductor field-effect transistors (MOSFETs). In order to maintain their state, relays require a continuous current.


Conclusion


Relay logic control is a classic bridge connecting the digital world to the physical world of power. Although largely replaced by semiconductors in pure signal processing, it remains one of the best choices in applications requiring safe, reliable control of high-power loads (especially motors, lights, heaters, etc.) and the implementation of simple logic functions. A deep understanding of their principles and engineering design considerations is a valuable fundamental skill for any electronics, electrical, or automation engineer. 

TOP