Electronic circuits · no code

Self-Latching Relay Circuit

A start button and a stop button, like on an industrial machine: press Start and the relay holds itself on even after you let go. Press Stop to turn it off. A state is “remembered” without any chip.

  • LevelBeginner
  • Time30 min
  • Power9 V DC
  • CategoryMotors & robots

Bill of materials

Everything you need to build it, with the reference you will see on the schematic.

Bill of materials
Qty Part Ref.
1 Pushbutton S1
1 9 V relay (coil of about 330 Ω, one changeover contact) K1
1 Normally closed (NC) pushbutton with two wires S2
1 Diode 1N4007 D1
2 470 Ω resistor (yellow-violet-brown) R3, R4
1 green LED D2
1 red LED D3
1 9 V battery with snap clip BT1
1 Breadboard (400 tie-points or more)
4 Jumper wires

Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits

Schematic & wiring

On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.

Circuit diagram of “Self-Latching Relay Circuit”
Circuit diagram
Breadboard layout of “Self-Latching Relay Circuit”
Breadboard layout

Wire it step by step

  1. Place the components
    • Pushbutton S1 straddling the centre channel of the breadboard: two legs on top (3f and 5f) and two below (3e and 5e).
    • 1N4007 diode D1: the end with the silver stripe (cathode) in 9f and the other end (anode) in 6f.
    • 470 Ω resistor R3 (bands: yellow, violet, brown, gold): one leg in 9g and the other in 12g (either way round).
    • green LED D2: the long leg (+, anode) in 12h and the short leg (−, cathode, flat side) in 13h.
    • 470 Ω resistor R4 (bands: yellow, violet, brown, gold): one leg in 17f and the other in 14f (either way round).
    • red LED D3: the long leg (+, anode) in 14h and the short leg (−, cathode, flat side) in 15h.
  2. Add the jumper wires
    • Red wire: from 3j to the + (red) rail.
    • Orange wire: from 3d to 9j.
    • Black wire: from 13j to the − (blue) rail.
    • Black wire: from 15j to the − (blue) rail.
  3. Connect the external parts
    • 9 V relay (K1), one wire per terminal: A1 → 9i; A2 → 6j; COM → the + rail; NO → 9h; NC → 17j.
    • Normally closed (S2): one wire to 6i and the other wire to the − rail.
  4. Connect the battery
    • Connect the 9 V battery to its clip: the clip’s red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
  5. Test the circuit
    • At rest the red LED should be lit. Press and release S1 (Start): you hear the “click”, the green lights and stays on. Press and release S2 (Stop): another “click” and the red returns. Also try holding S2 down while pressing S1: the relay must not start. Measure the coil: with the relay latched there should be more than 6 V across its two terminals.

How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.

How does it work?

  1. 1At rest the coil gets no current and the red LED is on
  2. 2Pressing Start (S1) powers the relay coil and the relay pulls in
  3. 3The relay’s own contact feeds the coil: it “latches” itself and stays on after you release S1
  4. 4Pressing Stop (S2) cuts the coil, the relay drops out and the red LED returns

This is the “start-stop” circuit from electrical panels. Relay K1 has its coil between point N1 and the stop button S2 (normally closed: it passes current until you press it). The relay’s COM contact is tied to the positive and its NO terminal is tied to N1. Pressing S1 sends 9 V to the coil: the relay pulls in and COM joins NO, so now the contact itself feeds the coil even after you release S1. It “latches”. Pressing S2 opens the coil path, the relay drops out, the contact opens and you must press S1 again to restart. While S2 is held down S1 cannot start the relay. The green LED (with its 470 Ω resistor) lights while the relay is held and the red one at rest, through the NC contact. D1 (1N4007) absorbs the coil’s voltage spike on release. The coil draws about 27 mA through the buttons; it is a small current, but use a fresh battery: below about 7.5 V the relay may fail to latch. Here the contacts only drive LEDs; never connect them to household mains.

Testing & troubleshooting

What you should see

Start with S1 (0.5–0.9 s), stop with S2 (2.0–2.3 s)
Red LED before pressing≈ 15 mA
Green LED after releasing S1 (held)≈ 15 mA
Coil voltage while held≈ 8.91 V
Red LED after stopping with S2≈ 15 mA
With S2 held down, S1 cannot start it
Red LED (did not start)≈ 15 mA

Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.

If something does not work

The relay drops out when I release S1: it does not latch

The latching contact is not wired correctly: the relay’s COM terminal must go to the positive and NO must go to the same point as the coil (N1). Check you have not swapped them with NC, and that the battery is fresh.

The relay does not release when I press S2

It is almost always because S2 is a normally open button rather than a normally closed one: you need one that conducts at rest and opens when pressed. An ordinary pushbutton will not cut the coil.

It does not start when I press S1

Check that S2 conducts at rest (the multimeter on continuity should beep) and that the coil is properly connected between N1 and S2. Change the battery if it is below about 7.5 V.

Want to automate this circuit with code?

Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.