Designing a Low-Cost Latching Magnetic Relay for DIY Robotics

Read this article in clean Markdown format for LLMs and AI context.

Ever tried to make a robot that can hold a position without constantly draining the battery? That’s the moment a latching magnetic relay shines. It lets you keep a switch closed (or open) with just a tiny pulse of power, perfect for battery‑run bots that need to stay still for minutes or hours.

Why a Latching Relay Matters

In most hobby projects we use a regular relay. Every time the robot moves, the coil has to stay energized. That means the battery is always feeding the coil, and the heat adds up fast. A latching relay, on the other hand, remembers its last state. You give it a short “set” pulse, it clicks and stays there. A second “reset” pulse flips it back. The result is lower power draw, less heat, and longer run time – exactly what a field robot or a small rover needs.

Core Idea of a Magnetic Latching Relay

At its heart a magnetic latching relay is just a tiny electromagnet that moves a piece of iron (the armature) into one of two positions. When the armature moves, it either makes or breaks a set of contacts. The clever part is that the magnetic field is kept alive by a permanent magnet once the armature has moved. No continuous current is needed.

The Coil

The coil is a length of insulated copper wire wound around a small iron core. When current flows, the coil creates a magnetic field that pulls the armature. For a low‑cost build we can use 30‑AWG enamel wire and a ferrite rod from an old radio.

The Magnet

A small neodymium disc magnet (about 3 mm thick) does the “hold” job. After the coil pulls the armature, the magnet’s field keeps it in place. When you send a reverse pulse, the coil’s field overpowers the permanent magnet and flips the armature back.

The Contact

Two spring‑loaded metal strips act as the switch contacts. One strip is fixed, the other is attached to the moving armature. When the armature snaps over, the strips touch and the circuit closes. A second set of contacts can be wired for the “reset” function.

Step‑By‑Step Build Guide

Below is a practical path you can follow with parts you likely have on a bench. I built the first version for a small robotic gripper that needed to stay closed while lifting a weight. The result was a relay that held the grip for 30 minutes on a single 200 mAh cell.

1. Gather Materials

  • 30‑AWG enamel copper wire (about 10 m)
  • Ferrite rod, 6 mm diameter, 30 mm long
  • Neodymium disc magnet, 5 mm dia, 2 mm thick
  • Two small spring steel strips (0.2 mm thick)
  • A piece of non‑magnetic plastic or acrylic for the housing (1 cm × 2 cm × 0.5 cm)
  • Solder, heat‑shrink tubing, and a small PCB or perfboard
  • A 5 V supply for testing (or a battery pack)

2. Wind the Coil

Wrap the enamel wire tightly around the ferrite rod, leaving about 5 mm of wire free at each end for leads. Aim for 50 turns; this gives enough pull force without needing a lot of current. Keep the winding neat – overlapping turns cause hot spots.

After winding, sand the ends lightly to expose the copper, then tin them with solder. This makes later connections reliable.

3. Build the Magnetic Circuit

Cut a small slot in the plastic housing to hold the ferrite rod and the magnet side by side. Place the magnet so its north pole faces the coil’s end. The armature – a tiny piece of soft iron about 3 mm × 2 mm × 0.5 mm – sits on a pivot that lets it swing between two positions.

When the coil is energized, the magnetic field pulls the armature toward the coil side, compressing a spring that holds it in place. When the coil is pulsed in reverse (swap the leads), the field pushes the armature back, letting the permanent magnet hold it in the opposite spot.

4. Add the Contacts

Attach one spring steel strip to the fixed side of the housing. The second strip is glued to the armature. When the armature moves, the strips touch and the circuit closes. For a reset contact, place a second pair of strips on the opposite side of the armature.

Make sure the contact gap is about 0.1 mm when closed – just enough to carry a few amps without welding together. A tiny piece of sandpaper can be used to fine‑tune the gap.

5. Wire the Control Circuit

Connect the coil leads to a simple H‑bridge made from two N‑MOSFETs (or use a DPDT relay for a quick test). The H‑bridge lets you apply the pulse in either direction. Add a 10 µF capacitor across the coil to tame the voltage spike when the current stops – this protects the MOSFETs and reduces audible click.

A 100 Ω resistor in series with the coil limits the current to about 100 mA at 5 V, which is safe for the wire and the battery.

6. Test and Tune

Power the coil with a short 100 ms pulse. You should hear a faint “click” as the armature snaps. Measure the voltage across the contacts – it should go from open (high) to closed (low). Reverse the pulse and watch the armature move back.

If the armature sticks, try a stronger magnet or add a tiny steel shim to the armature to increase its magnetic attraction. If it doesn’t move, check the coil resistance; too many turns or a broken wire will limit the pull force.

7. Mount in Your Robot

Once the relay works on the bench, glue the housing onto the robot’s frame. Run the contact wires to the motor driver or sensor circuit. Because the relay stays latched, you can power the robot’s main functions while the coil is idle – a big win for battery life.

Tips from the Lab

  • Use heat‑shrink on all solder joints. It keeps the enamel wire from fraying when the armature vibrates.
  • Keep the coil short – longer wire adds resistance and needs more voltage.
  • Label the leads. When you wire the H‑bridge, swapping the polarity will give you the opposite state, and it’s easy to lose track in a cramped robot chassis.
  • Safety first: Even a small neodymium magnet can snap fingers shut. Handle it with gloves and keep it away from credit cards.

Closing Thoughts

A latching magnetic relay is a simple, cheap way to give your DIY robot a memory function without draining the battery. By winding a few turns of wire, adding a tiny permanent magnet, and setting up a couple of contacts, you get a reliable switch that stays set until you tell it otherwise. I’ve used this design in a line‑following bot, a small arm, and even a garden‑monitoring rover. Each time the relay saved a few milliamps of draw, and that adds up when you’re running on a coin cell.

Give it a try on your next project. The parts are cheap, the steps are clear, and the payoff – longer run time and less heat – feels like a professional upgrade for a hobbyist’s bench.

Reactions
Do you have any feedback or ideas on how we can improve this page?