Practical case: Latching Alarm System

Latching Alarm System prototype (Maker Style)

Level: Basic. Build a self-latching relay circuit to maintain an alarm state after a momentary trigger.

Objective and use case

You will build a basic «memory» circuit using an electromechanical relay, often called a latching or holding circuit. A momentary press of a trigger button will activate an alarm (LED), which will remain active even after the button is released, until a separate reset button is pressed.

  • Security Systems: Used in simple burglar alarms where a tripped sensor keeps the siren on until a user resets it.
  • Industrial Safety: Commonly used in «Start/Stop» motor control stations.
  • Fault Indicators: Captures transient error signals so operators can see a fault occurred even if the condition clears.

Expected outcome:
* Initial state: LED is OFF.
* Action 1: Momentarily press the «Trigger» button → LED turns ON and relay clicks.
* Action 2: Release «Trigger» button → LED remains ON (Latched).
* Action 3: Press «Reset» button → LED turns OFF and relay releases.

Target audience: Beginners familiar with basic circuits and relay operation.

Materials

  • V1: 12 V DC power supply, function: Main power source
  • K1: SPDT Relay (12 V Coil), function: Electromechanical switch and memory element
  • S1: Pushbutton (Normally Open – NO), function: Trigger signal
  • S2: Pushbutton (Normally Closed – NC), function: Reset signal
  • R1: 1 kΩ resistor, function: Current limiting for LED
  • D1: Red LED, function: Visual alarm indicator
  • D2: 1N4007 Diode, function: Flyback protection for the coil

Wiring guide

Connect the components using the following node definitions: VCC (12 V), 0 (Ground), feed_line, latch_node.

  • V1 (DC Source): Connect Positive to VCC and Negative to 0.
  • S2 (Reset Button – NC): Connect between VCC and feed_line.
  • S1 (Trigger Button – NO): Connect between feed_line and latch_node.
  • K1 (Relay Coil): Connect one side to latch_node and the other side to 0.
  • K1 (Relay Common Contact – COM): Connect to feed_line.
  • K1 (Relay Normally Open Contact – NO): Connect to latch_node.
  • D2 (Protection Diode): Connect Cathode (stripe) to latch_node and Anode to 0.
  • R1 (Resistor): Connect between latch_node and node led_anode.
  • D1 (LED): Connect Anode to led_anode and Cathode to 0.

Note: S2 allows current to flow to the circuit. S1 initially energizes the coil. Once K1 energizes, the COM-NO internal connection bypasses S1, keeping the coil powered from the feed_line.

Conceptual block diagram

Conceptual block diagram — Relay Latching Circuit
Quick read: inputs → main block → output (actuator or measurement). This summarizes the ASCII schematic below.

Schematic

Title: Practical case: Latching Alarm System

      (Main Power)
        VCC 12 V
           |
           V
  [ S2: Reset (NC) ]
           |
      (feed_line)
           |
           |    (Path A: Manual Trigger)
           +--> [ S1: Trigger (NO) ] ------------------+
           |                                           |
           |                                           V
           |                                     (latch_node)
           |                                           |
           |    (Path B: Self-Latching)                +----------> [ R1: 1k ] --> [ D1: LED ] --> GND
           +--> [ K1: Contact (NO) ] ------------------+           (Visual Alarm)
                         ^                             |
                         |                             |
                         |                             +----------> [ K1: Coil || D2(Rev) ] --> GND
                         |                                         (Relay Magnet & Protection)
                         |                                                  |
                         +----------------(Magnetic Link)-------------------+
Electrical Schematic

Electrical diagram

Electrical diagram for case: Latching alarm system
Generated from the validated SPICE netlist for this case.

🔒 This electrical diagram is premium. With the 7-day pass or the monthly membership you can unlock the complete didactic material and the print-ready PDF pack.🔓 See premium access plans

Measurements and tests

Follow these steps to validate the latching behavior:

  1. Coil Continuity Check: Before applying power, use a multimeter in Ohms mode to measure the relay coil pins. You should read a resistance value (typically 100 Ω to 400 Ω depending on the relay).
  2. Standby Check: Power on the circuit. Measure voltage between latch_node and 0. It should be 0 V. The LED should be OFF.
  3. Trigger Test: Press and hold S1. Measure voltage at latch_node. It should rise to approx 12 V. The LED should turn ON.
  4. Latching Test: Release S1. The voltage at latch_node must remain at 12 V, and the LED must stay ON. Listen for the relay; it should not click off.
  5. Reset Test: Press S2 (Reset). The voltage at latch_node should drop to 0 V instantly. The LED turns OFF. Release S2; the LED remains OFF.

SPICE netlist and simulation

Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)

* Latching Alarm System
.width out=256
* Based on Practical Breadboard Case

* ==========================================
* Power Supply
* ==========================================
* V1: 12V Main Supply
V1 VCC 0 DC 12

* ==========================================
* Control Inputs (User Stimuli)
* ==========================================
* S1 (Trigger Button - NO): 
* Simulating a press (Close) at 10ms for 5ms duration.
* Pulse: 0V (Open) -> 5V (Closed) -> 0V (Open)
V_S1_ctrl ctrl_s1 0 PULSE(0 5 10m 100u 100u 5m 100m)

* S2 (Reset Button - NC):
* Simulating a press (Open) at 40ms for 5ms duration.
* ... (truncated in public view) ...

Copy this content into a .cir file and run with ngspice.

🔒 Part of this section is premium. With the 7-day pass or the monthly membership you can access the full content (materials, wiring, detailed build, validation, troubleshooting, variants and checklist) and download the complete print-ready PDF pack.

* Latching Alarm System
.width out=256
* Based on Practical Breadboard Case

* ==========================================
* Power Supply
* ==========================================
* V1: 12V Main Supply
V1 VCC 0 DC 12

* ==========================================
* Control Inputs (User Stimuli)
* ==========================================
* S1 (Trigger Button - NO): 
* Simulating a press (Close) at 10ms for 5ms duration.
* Pulse: 0V (Open) -> 5V (Closed) -> 0V (Open)
V_S1_ctrl ctrl_s1 0 PULSE(0 5 10m 100u 100u 5m 100m)

* S2 (Reset Button - NC):
* Simulating a press (Open) at 40ms for 5ms duration.
* Pulse: 5V (Closed/Idle) -> 0V (Open/Pressed) -> 5V (Closed/Idle)
* Note: This voltage represents the connectivity state (High = Conducting).
V_S2_ctrl ctrl_s2 0 PULSE(5 0 40m 100u 100u 5m 100m)

* ==========================================
* Circuit Components
* ==========================================

* S2: Reset Switch (NC)
* Connects VCC to feed_line.
* Controlled by ctrl_s2 (Active High logic for NC behavior).
S2 VCC feed_line ctrl_s2 0 SW_IDEAL

* S1: Trigger Switch (NO)
* Connects feed_line to latch_node.
* Controlled by ctrl_s1 (Active High logic for NO behavior).
S1 feed_line latch_node ctrl_s1 0 SW_IDEAL

* K1: Relay Implementation
* 1. Coil: Modeled as Inductance + Series Resistance
*    Connects latch_node to Ground (0).
*    100 Ohm resistance is typical for a 12V relay coil.
R_coil latch_node k1_internal 100
L_coil k1_internal 0 10m

* 2. Relay Contact (Switch):
*    Connects feed_line (COM) to latch_node (NO).
*    Controlled by the voltage across the coil (latch_node).
*    Threshold set to 6V (Pull-in) with hysteresis.
S_relay feed_line latch_node latch_node 0 SW_RELAY

* D2: Flyback Protection Diode
* Cathode to latch_node, Anode to 0.
D2 0 latch_node 1N4007

* Alarm Indicator (LED + Resistor)
* R1: Current limiting
R1 latch_node led_anode 1k
* D1: Red LED
D1 led_anode 0 LED_RED

* Floating Node Prevention
* High impedance pull-down for feed_line when S2 opens
R_float feed_line 0 100Meg

* ==========================================
* Models
* ==========================================
* Ideal switch for buttons (Vt=2.5V logic threshold)
.model SW_IDEAL SW(Vt=2.5 Ron=0.01 Roff=100Meg)

* Relay switch model (Picks up at 6V, drops out at 4V)
.model SW_RELAY SW(Vt=6 Vh=2 Ron=0.01 Roff=100Meg)

* 1N4007 Diode Model
.model 1N4007 D(Is=7n Rs=0.04 N=1.5 Cjo=20p BV=1000 IBV=5u)

* Generic Red LED Model
.model LED_RED D(Is=1a N=4 Rs=4)

* ==========================================
* Simulation Directives
* ==========================================
* Transient analysis: 100us step, 60ms total time
* Covers Trigger (10ms) and Reset (40ms) events
.tran 100u 60m

* Output variables
* V(latch_node) is the ALARM STATE (Output)
* V(feed_line) shows power delivery
.print tran V(latch_node) V(feed_line) V(ctrl_s1) V(ctrl_s2) I(L_COIL)

.op
.end

Simulation Results (Transient Analysis)

Simulation Results (Transient Analysis)

Analysis: The simulation accurately demonstrates the latching logic. At 10ms, the trigger pulse (S1) energizes the coil, causing ‘latch_node’ to rise to ~12V. The circuit successfully latches, maintaining 12V output after S1 opens. At 40ms, the reset pulse (S2) cuts power, dropping ‘latch_node’ to ~0V, where it remains even after S2 closes again.
Show raw data table (2796 rows)
Index   time            v(latch_node)   v(feed_line)    v(ctrl_s1)      v(ctrl_s2)      l_coil#branch
0	0.000000e+00	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
1	1.000000e-06	2.399953e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
2	2.000000e-06	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
3	4.000000e-06	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
4	8.000000e-06	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
5	1.600000e-05	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
6	3.200000e-05	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
7	6.400000e-05	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
8	1.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
9	2.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
10	3.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
11	4.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
12	5.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
13	6.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
14	7.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
15	8.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
16	9.280000e-04	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
17	1.028000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
18	1.128000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
19	1.228000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
20	1.328000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
21	1.428000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
22	1.528000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
23	1.628000e-03	2.399952e-05	1.200000e+01	0.000000e+00	5.000000e+00	2.399952e-07
... (2772 more rows) ...

Common mistakes and how to avoid them

  1. Using a Normally Open button for Reset: If S2 is NO instead of NC, the circuit will never receive power to start. Ensure S2 conducts current by default.
  2. Connecting the latch to NC contact: If you connect the latch_node to the Relay’s NC pin instead of NO, the relay will turn on immediately upon power-up and oscillate or buzz (buzzer effect). Always use the NO pin for self-latching.
  3. LED burns out immediately: Forgetting R1 allows excessive current through the LED. Always verify the resistor value before powering up.

Troubleshooting

  • Symptom: LED turns on when S1 is pressed but turns off immediately when released.
    • Cause: The latching path is broken.
    • Fix: Check the connection between K1 (COM), K1 (NO), and the latch_node. Ensure the relay contacts are parallel to S1.
  • Symptom: Relay buzzes loudly or chatters.
    • Cause: Power supply voltage is too low or unstable.
    • Fix: Ensure V1 provides stable 12 V and can supply enough current for the coil.
  • Symptom: Circuit cannot be reset.
    • Cause: S2 is bypassed or faulty (shorted).
    • Fix: Check S2 with a multimeter; it must break the connection (Open) when pressed.

Possible improvements and extensions

  1. Audible Alarm: Connect a 12 V active buzzer in parallel with the LED (between latch_node and 0) to add sound to the alarm.
  2. High Power Control: Use a DPDT relay. Use the first set of contacts for the 12 V logic latching (as described above) and the second set of contacts to switch a completely separate high-voltage load, like a 120 V/230 V lamp.

More Practical Cases on Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.

Quick Quiz

Question 1: What is the primary function of the self-latching relay circuit described?




Question 2: Which component acts as the 'memory element' in this circuit?




Question 3: What happens to the LED when the 'Trigger' button is released?




Question 4: What type of switch is typically used for the 'Reset' button in a standard latching circuit to break the current?




Question 5: What is the specific function of the diode (D2) placed across the relay coil?




Question 6: Which real-world application is mentioned for this type of circuit?




Question 7: What is the voltage of the DC power supply (V1) specified in the materials list?




Question 8: What action is required to turn the LED OFF once it is latched?




Question 9: What is the function of the resistor (R1) connected to the LED?




Question 10: In the expected outcome, what is the initial state of the LED before any buttons are pressed?




Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me:


Practical case: DC motor control with relay and pushbutton

DC motor control with relay and pushbutton prototype (Maker Style)

Level: Basic. Learn how to isolate a low-power control signal from a high-power motor circuit using an electromagnetic relay.

Objective and use case

In this practical case, you will build a circuit that utilizes a small pushbutton and a relay to control a high-current DC motor. The relay acts as an electromagnetic switch, allowing the low-power control side to activate the high-power load side without direct electrical connection between the distinct power rails (if separate grounds are used) or simply to handle currents exceeding the switch’s rating.

Why it is useful:
* Automotive systems: Used in starter motors where a small ignition key switch triggers a massive solenoid (relay) to crank the engine.
* Industrial automation: Allows low-voltage PLCs (24 V) to switch high-voltage AC or DC motors (110 V/220 V) safely.
* Safety isolation: Keeps high voltages away from the user interface (buttons and switches).
* Component protection: Prevents burning out delicate switches by offloading the high current switching to the relay contacts.

Expected outcome:
* When the pushbutton is pressed, the relay makes an audible «click.»
* The DC motor starts spinning immediately upon the click.
* Voltage across the relay coil measures 5 V (or rated control voltage).
* The flyback diode protects the switch from high-voltage spikes when the button is released.

Target audience and level: Students and hobbyists understanding basic electromechanical switching (Basic).

Materials

  • V1: 5 V DC voltage source, function: Control circuit power supply.
  • V2: 12 V DC voltage source, function: Motor (Power) circuit supply.
  • S1: Momentary Pushbutton (Normally Open), function: Control switch.
  • K1: SPDT Relay (5 V Coil), function: Electromechanical isolation and switching.
  • D1: 1N4007 Diode, function: Flyback/Freewheeling diode for coil protection.
  • M1: 12 V DC Motor, function: High-power load.

Wiring guide

This guide uses SPICE-friendly node names to define the connections. The nodes are: V_CTRL (5 V), V_PWR (12 V), COIL_IN, MOTOR_IN, and 0 (Ground).

  • V1 (Positive): Connects to node V_CTRL.
  • V1 (Negative): Connects to node 0.
  • V2 (Positive): Connects to node V_PWR.
  • V2 (Negative): Connects to node 0.
  • S1: Connects between node V_CTRL and node COIL_IN.
  • K1 (Coil terminal A): Connects to node COIL_IN.
  • K1 (Coil terminal B): Connects to node 0.
  • D1 (Cathode/Striped side): Connects to node COIL_IN.
  • D1 (Anode): Connects to node 0.
  • K1 (Common/COM Contact): Connects to node V_PWR.
  • K1 (Normally Open/NO Contact): Connects to node MOTOR_IN.
  • M1 (Positive): Connects to node MOTOR_IN.
  • M1 (Negative): Connects to node 0.

Note: In a physical application requiring galvanic isolation, the ground 0 for the control side (V1) and the power side (V2) would be kept separate. For this basic simulation model, they share a common reference.

Conceptual block diagram

Conceptual block diagram — Relay-Based Motor Control
Quick read: inputs → main block → output (actuator or measurement). This summarizes the ASCII schematic below.

Schematic

+---------------------------------------------------------------------------------------------------------+
|                          DC MOTOR CONTROL WITH RELAY (UNIFIED DIAGRAM)                                  |
+---------------------------------------------------------------------------------------------------------+

      (High Power Loop: 12 V)
      [ V2: 12 V Source ] --(Node: V_PWR)--> [ K1: Relay Switch (COM->NO) ] --(Node: MOTOR_IN)--> [ M1: 12 V Motor ] --> [ GND ]
                                                        ^
                                                        |
                                                 (Magnetic Link)
                                                        |
      (Control Loop: 5 V)                                |
      [ V1: 5 V Source ] --(Node: V_CTRL)--> [ S1: Pushbutton ] --(Node: COIL_IN)--> [ Parallel: K1 Coil || D1 (Rev) ] --> [ GND ]

+---------------------------------------------------------------------------------------------------------+
|  LEGEND & NOTES:                                                                                        |
|  -->  : Signal/Power Flow                                                                               |
|  ||   : Components in Parallel (Coil and Diode share Node COIL_IN and GND)                              |
|  Rev  : Diode D1 is Reverse Biased (Cathode to COIL_IN, Anode to GND) to suppress flyback voltage.      |
|  Link : The current in the Control Loop generates the magnetic field to close the Switch in the Power Loop. |
+---------------------------------------------------------------------------------------------------------+
Schematic (ASCII)

Electrical diagram

Electrical diagram for case: DC motor control with relay and pushbutton
Generated from the validated SPICE netlist for this case.

🔒 This electrical diagram is premium. With the 7-day pass or the monthly membership you can unlock the complete didactic material and the print-ready PDF pack.🔓 See premium access plans

Measurements and tests

Follow these steps to validate your circuit assembly:

  1. Coil Voltage Check:

    • Set your multimeter to DC Voltage (20 V range).
    • Connect probes across the relay coil terminals (COIL_IN and 0).
    • Press S1. The reading should jump from 0 V to approx. 5 V.
  2. Audible Confirmation:

    • Press and release S1. Listen for the mechanical «click» of the relay armature moving. If you do not hear it, the coil is not energizing.
  3. Load Voltage Verification:

    • Connect the multimeter across the motor terminals.
    • Press S1. The multimeter should read approx. 12 V (voltage of V2) and the motor should spin.
    • Release S1. The voltage should drop to 0 V and the motor should coast to a stop.
  4. Flyback Diode Test (Advanced):

    • Without D1, monitoring COIL_IN with an oscilloscope would reveal a large negative voltage spike when S1 is released. With D1 installed, this spike is clamped to approx. -0.7 V, protecting S1.

SPICE netlist and simulation

Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)

* Practical case: DC motor control with relay and pushbutton

* --- Models ---
* Generic Pushbutton Switch Model (Voltage Controlled)
.model SW_PB SW(Vt=2.5 Vh=0.1 Ron=0.01 Roff=10Meg)
* Relay Contact Switch Model (Controlled by Coil Voltage)
.model SW_RELAY SW(Vt=3.5 Vh=0.2 Ron=0.05 Roff=10Meg)
* 1N4007 Diode Model
.model D1N4007 D(IS=7.07e-9 RS=0.034 N=1.7 BV=1000 IBV=5e-6 CJO=1e-11 TT=1e-7)

* --- Power Supplies ---
* V1: Control Circuit Power (5V)
V1 V_CTRL 0 DC 5
* V2: Motor Circuit Power (12V)
V2 V_PWR 0 DC 12

* --- Control Circuit (Input) ---
* S1: Pushbutton.
* Modeled as a voltage-controlled switch driven by a PULSE source (V_ACT)
* to simulate the physical act of pressing the button.
* ... (truncated in public view) ...

Copy this content into a .cir file and run with ngspice.

🔒 Part of this section is premium. With the 7-day pass or the monthly membership you can access the full content (materials, wiring, detailed build, validation, troubleshooting, variants and checklist) and download the complete print-ready PDF pack.

* Practical case: DC motor control with relay and pushbutton

* --- Models ---
* Generic Pushbutton Switch Model (Voltage Controlled)
.model SW_PB SW(Vt=2.5 Vh=0.1 Ron=0.01 Roff=10Meg)
* Relay Contact Switch Model (Controlled by Coil Voltage)
.model SW_RELAY SW(Vt=3.5 Vh=0.2 Ron=0.05 Roff=10Meg)
* 1N4007 Diode Model
.model D1N4007 D(IS=7.07e-9 RS=0.034 N=1.7 BV=1000 IBV=5e-6 CJO=1e-11 TT=1e-7)

* --- Power Supplies ---
* V1: Control Circuit Power (5V)
V1 V_CTRL 0 DC 5
* V2: Motor Circuit Power (12V)
V2 V_PWR 0 DC 12

* --- Control Circuit (Input) ---
* S1: Pushbutton.
* Modeled as a voltage-controlled switch driven by a PULSE source (V_ACT)
* to simulate the physical act of pressing the button.
* Wiring: Connects V_CTRL to COIL_IN.
V_ACT ACT_NODE 0 PULSE(0 5 10m 1u 1u 245m 1s)
S1 V_CTRL COIL_IN ACT_NODE 0 SW_PB

* K1: Relay Coil
* Wiring: Coil Terminal A to COIL_IN, Coil Terminal B to 0.
* Modeled as Inductor + Resistor in series.
R_K1_COIL COIL_IN K1_INT 60
L_K1_COIL K1_INT 0 100m

* D1: Flyback Diode
* Wiring: Cathode to COIL_IN, Anode to 0.
* SPICE Syntax: D   
D1 0 COIL_IN D1N4007

* --- Power Circuit (Output) ---
* K1: Relay Contact (Switch)
* Wiring: Common (COM) to V_PWR, Normally Open (NO) to MOTOR_IN.
* Controlled by the voltage at node COIL_IN.
S_K1_SW V_PWR MOTOR_IN COIL_IN 0 SW_RELAY

* M1: DC Motor
* Wiring: Positive to MOTOR_IN, Negative to 0.
* Modeled as an RL load (Resistance + Inductance).
R_M1 MOTOR_IN M1_INT 20
L_M1 M1_INT 0 10m

* --- Analysis Directives ---
.op
.tran 0.1m 250m

* --- Output Printing ---
* Must define INPUT (COIL_IN) and OUTPUT (MOTOR_IN)
.print tran V(COIL_IN) V(MOTOR_IN) V(ACT_NODE) I(L_M1)

.end

Simulation Results (Transient Analysis)

Simulation Results (Transient Analysis)

Analysis: The simulation shows the control signal (V_ACT) going high at 10ms. Consequently, the coil voltage (V(COIL_IN)) rises to ~5V. This triggers the relay switch, causing the motor input voltage (V(MOTOR_IN)) to jump from near 0V to ~12V, and current flows through the motor load.
Show raw data table (2535 rows)
Index   time            v(coil_in)      v(motor_in)     v(act_node)     l_m1#branch
0	0.000000e+00	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
1	1.000000e-06	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
2	2.000000e-06	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
3	4.000000e-06	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
4	8.000000e-06	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
5	1.600000e-05	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
6	3.200000e-05	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
7	6.400000e-05	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
8	1.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
9	2.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
10	3.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
11	4.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
12	5.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
13	6.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
14	7.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
15	8.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
16	9.280000e-04	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
17	1.028000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
18	1.128000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
19	1.228000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
20	1.328000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
21	1.428000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
22	1.528000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
23	1.628000e-03	2.999953e-05	2.399995e-05	0.000000e+00	1.199998e-06
... (2511 more rows) ...

Common mistakes and how to avoid them

  1. Omitting the Flyback Diode (D1):

    • Error: Leaving out the diode across the relay coil.
    • Consequence: The collapsing magnetic field generates a high-voltage spike (back EMF) that can arc across the switch contacts or destroy transistor drivers in future circuits.
    • Solution: Always install a diode in reverse bias (Cathode to positive) across inductive loads.
  2. Using the Wrong Relay Contacts (NC vs NO):

    • Error: Connecting the motor to the Normally Closed (NC) pin instead of Normally Open (NO).
    • Consequence: The motor runs continuously when the button is not pressed and stops when it is pressed.
    • Solution: Identify the NO pin using the datasheet or a continuity test before soldering.
  3. Mixing Power Rails:

    • Error: Connecting the 12 V motor supply directly to the 5 V coil.
    • Consequence: The relay coil will overheat and likely burn out due to over-voltage.
    • Solution: Ensure the coil voltage matches the control supply (V1) and the contact rating matches the motor supply (V2).

Troubleshooting

  • Symptom: Relay clicks, but motor does not run.

    • Cause: Burnt relay contacts or loose wire between COM/NO and the motor.
    • Fix: Check continuity across COM and NO while the relay is held active.
  • Symptom: Relay does not click when S1 is pressed.

    • Cause: Coil wiring error or S1 is faulty.
    • Fix: Measure voltage at the coil terminals while pressing S1. If 0 V, check S1.
  • Symptom: Circuit resets or sparks occur at S1.

    • Cause: Lack of flyback diode causing arcing.
    • Fix: Install D1 immediately across the coil terminals.

Possible improvements and extensions

  1. Transistor Driver: Replace the direct pushbutton connection with an NPN transistor (e.g., 2N2222) to control the relay using a weak signal from an Arduino or microcontroller.
  2. Self-Latching Circuit: Add a second relay contact or wire the relay in a «latching» configuration with a separate «Stop» button (NC), so you don’t have to hold S1 to keep the motor running.

More Practical Cases on Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.

Quick Quiz

Question 1: What is the primary function of the relay in the described circuit?




Question 2: Why is a relay useful for component protection in this circuit?




Question 3: What happens immediately after the relay makes an audible 'click' in the expected outcome?




Question 4: Why is this circuit configuration commonly used in automotive starter systems?




Question 5: What is the role of the low-power control side in this setup?




Question 6: In industrial automation, what does this relay setup allow low-voltage PLCs to do?




Question 7: How does this relay setup provide safety isolation?




Question 8: What component is used as the user interface to trigger the circuit in this practical case?




Question 9: If separate grounds are used, what is the relationship between the control and load power rails?




Question 10: What physical phenomenon causes the relay to switch contacts?




Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me: