Signal for a Latching Relay

Bio77

Well-known member
I was wondering how long of a 5V signal pulse is needed from a microcontroller to flip a latching relay? Also, what if the signal were applied for for a longer time, would the relay change states? Or does it latch only after the signal goes back to 0V?
 
I'm not sure how long it needs to be applied for it to latch, that's a good question that I would hope is answered by the datasheet. It shouldn't need to go back to 0V for the relay to latch, it just needs to have enough current for enough time. Applying the signal for a longer time shouldn't affect anything, reversing the polarity of the signal is the only way to switch the relay state. Do you have a datasheet for the relay you're looking at using?
 
The datasheet for the EA2-5SNJ says 2mS...

I pulse for 5mS just to be safe.

It does not have to return to 0V to latch but you do need an opposite polarity pulse to unlatch.

I can show you a shortcut though, and you don't have to worry about any of this.
 
Last edited by a moderator:
[See the circuit below]

Forget pulsing, just set the pin HIGH and leave it high.

The relay will latch because of the current flowing through C1 as it charges. Once it's fully charged current flow will stop, but the relay will remain latched. The most important bit though, is that C1 is now charged up to the positive voltage you applied.

When you're ready to unlatch just pull the pin back low.

Now the positive end of C1 is grounded, which means the relay coil will get a negative pulse as the capacitor discharges.


Since you don't know the state of a latching relay at power on (it could have been latched when the last guy unplugged power from the pedal) it's a good idea do to a LATCH / UNLATCH cycle at power on.

Now, as a disclaimer, I don't know how robust a PIC (or other microcontroller is), but an ATTINY/ATMEGA can handle it. I set one up to latch / unlatch 100 times per second and left it running for several days.

If you need to control multiple relays from the same microcontroller you'll want a push-pull amplifier to take the load off the microcontroller, but for a single relay all you need is a capacitor.

1656367962405.png
 
Last edited by a moderator:
While we're at it, here's one more little trick to reduce the power consumption of a NON latching relay.

This works similar to a startup capacitor on an electric motor.

It takes more current to LATCH a non-latching relay than it does to HOLD a non-latching relay closed.

When Pin 6 goes high (and C1 is discharged) C1 will effectively be shorted so R1 is out of the circuit, K1 gets a nice burst of current to latch.

C1 will quickly charge up and effectively OPEN. Now R1 comes into play to do it's thing.

The current through the relay coil will now be limited by R1. The value needed depends on the relay, I usually go slightly below the highest resistance that will hold the relay closed.

1656368294402.png
 
I just looked at the TQ2-L-5V they recommend 10 ms. I was confused about the way the relay resets. I thought it was a mechanical device and you just hit it with sequential pulses to set and reset. I hadn't considered switching the polarity of the pulse.
[See the circuit below]

Forget pulsing, just set the pin HIGH and leave it high.

The relay will latch because of the current flowing through C1 as it charges. Once it's fully charged current flow will stop, but the relay will remain latched. The most important bit though, is that C1 is now charged up to the positive voltage you applied.

When you're ready to unlatch just pull the pin back low.

Now the positive end of C1 is grounded, which means the relay coil will get a negative pulse as the capacitor discharges.

Now, as a disclaimer, I don't know how robust a PIC (or other microcontroller is), but an ATTINY/ATMEGA can handle it. I set one up to latch / unlatch 100 times per second and left it running for several days.

If you need to control multiple relays from the same microcontroller you'll want a push-pull amplifier to take the load off the microcontroller, but for a single relay all you need is a capacitor.

View attachment 27835
Thanks for this, Robert. This is very elegant.

I am using a PIC. I've been modifying a CODA relay, which is a non-latching.
 
While we're at it, here's one more little trick to reduce the power consumption of a NON latching relay.

This works similar to a startup capacitor on an electric motor.

It takes more current to LATCH a non-latching relay than it does to HOLD a non-latching relay closed.

When Pin 6 goes high (and C1 is discharged) C1 will effectively be shorted so R1 is out of the circuit, K1 gets a nice burst of current to latch.

C1 will quickly charge up and effectively OPEN. Now R1 comes into play to do it's thing.

The current through the relay coil will now be limited by R1. The value needed depends on the relay, I usually go slightly below the highest resistance that will hold the relay closed.

View attachment 27836
Awesome! Thank you.
 
The TQ2-L-5V will latch at 5mS as well, I've used them with the Intelligent Relay Bypass quite a few times.

There's really no reason to skimp though, if you're going to pulse go ahead and do it for 10mS if that's what the datasheet says.
 
Back
Top