Single-coil latching relay. Pulse duration

I'm using the Panasonic TQ4-L-5V, which is a single-coil latching relay. I'll be triggering it using an ATtiny to send set/reset pulses. How long should the pulse duration be?

The datasheet specifies a maximum set time of 3 ms (without contact bounce??). Does that mean I should aim for exactly 3 ms, or is something like 5 ms better to ensure reliable switching?

https://api.pim.na.industrial.panasonic.com/file_stream/main/fileversion/4514

Also, I'm not using a flyback diode across the coil. From what I've read, it's common not to use diodes with single-coil latching relays that only receive brief pulses. Can anyone confirm if this is the correct approach?

Yes.

But it's better to use.

How are you driving the relay by the way?
The coil current is more than 20mA (I don't know which version you have, neither what Attiny you use).

Compare the two quotes and explain why you would use 5ms

"I'm not sure... Isn't it a bit strange to specify the maximum pulse time? Wouldn't the minimum pulse time be more relevant?"

Im using Attiny 84. Here is a interesting post I found about using diode or not.

Found this now:
Datasheet, page 17:
"Regarding the set and reset pulse time, for the purpose of reliable operation under ambient temperature fluctuations and different operating conditions, we recommend setting the coil applied set and reset pulse time to 10 ms or more at the rated coil voltage."

But the question to use diode or not remains

Why not to use? For sure it's not a question of price or size...
So are you driving the coil directly from pin? Did you control the currents?

Edit: I totally missed it was single coil

You can't use a diode on a single coil latching relay because you need to reverse the voltage and you will cause a short circuit.

Yes I know.. Thats why I find diodes and single coil latching relays confusing... (on "standard" relay I always use a diode but on pulse relays I dont know...

You will need an H-bridge circuit in order to operate that relay. The flyback diodes can be incorporated in that circuit. You will need 4 diodes.

Better if you bought the two coil relay.

Why H bridge? .. 4 diodes for a single relay?? Just did this code that Im gonna try

#include <ezButton.h>

#define BUTTON_PIN     7  // SW
#define LED_PIN        2  // LED
#define RELAY_A_POS    4  // Relay A +
#define RELAY_A_NEG    5  // Relay A -
#define RELAY_B_POS    3  // Relay B +
#define RELAY_B_NEG    6  // Relay B -

const unsigned long PULSE_DURATION = 12; // ms
bool relaysOn = false;

ezButton button(BUTTON_PIN); // Debounced button

void setup() {
  pinMode(LED_PIN, OUTPUT);

  pinMode(RELAY_A_POS, OUTPUT);
  pinMode(RELAY_A_NEG, OUTPUT);
  pinMode(RELAY_B_POS, OUTPUT);
  pinMode(RELAY_B_NEG, OUTPUT);

  // Make sure all pins start LOW
  digitalWrite(RELAY_A_POS, LOW);
  digitalWrite(RELAY_A_NEG, LOW);
  digitalWrite(RELAY_B_POS, LOW);
  digitalWrite(RELAY_B_NEG, LOW);

  // Set unused pins HIGH to avoid floating
  pinMode(0, OUTPUT); digitalWrite(0, HIGH);  
  pinMode(1, OUTPUT); digitalWrite(1, HIGH);  
  pinMode(8, OUTPUT); digitalWrite(8, HIGH);  
  pinMode(9, OUTPUT); digitalWrite(9, HIGH);  
  
  // Debounce setup
  button.setDebounceTime(50);

  // Always start in RESET mode with LED off
  pulseRelay(RELAY_A_NEG, RELAY_A_POS); // Reset relay A
  pulseRelay(RELAY_B_NEG, RELAY_B_POS); // Reset relay B
  digitalWrite(LED_PIN, LOW);           // LED off
  relaysOn = false;
}

void loop() {
  button.loop();

  if (button.isPressed()) {
    if (!relaysOn) {
      pulseRelay(RELAY_A_POS, RELAY_A_NEG); // Set relay A
      pulseRelay(RELAY_B_POS, RELAY_B_NEG); // Set relay B
      relaysOn = true;
      digitalWrite(LED_PIN, HIGH); // Turn on LED
    } else {
      pulseRelay(RELAY_A_NEG, RELAY_A_POS); // Reset relay A
      pulseRelay(RELAY_B_NEG, RELAY_B_POS); // Reset relay B
      relaysOn = false;
      digitalWrite(LED_PIN, LOW); // Turn off LED
    }
  }
}

// Sends a polarity pulse to the relay coil
void pulseRelay(uint8_t highPin, uint8_t lowPin) {
  digitalWrite(highPin, HIGH);
  digitalWrite(lowPin, LOW);
  delay(PULSE_DURATION);
  digitalWrite(highPin, LOW);
  digitalWrite(lowPin, LOW);
}

So what will prevent the flyback voltage from frying your Arduino?

Try your code a dozen times and let us know what happens?

This post explains it with the conclusion:
We have positive margin on the I/O pin stress rating because 16.8mA < 40mA
So now we know that the ATTINY can drive the relay reliably and it can absorb the inductive kick-back without damage.

https://forum.pedalpcb.com/threads/flyback-diodes-and-relays.3576/#post-28437

Is it wrong?

Not if the coil is liable to overheat if the pulse is too long

Sounds like it.
It's a different relay and he made quite a few assumptions
He never said he actually tried it or has a working circuit to test his theory so it your call.

I'm familiar with that way of reversing polarity but with the possibility of the flyback voltage frying your Arduino I would not tell someone to try it.

He is calculating with the same relay as Im using... Panasonic TQ2-L-5V.

So I guess if I wanna have extra protection (maybe not needed but anyway..) I can use back-to-back Zeners. So two diodes for one relay.

Yes TQ2-L-5V. Its a single coil latching relay. (pulse type) According to the datasheet its 20mA. Im planning to set the pulse to the coil direct from the attiny 84

I though it was for the TQ2 he says "Panasonic's TQ2 "
The kickback voltage is directly related to the coil inductance. I see no mention of inductance in his calculations. Again, if you decide to try it let us know what happens.

Zeners.
Will a zener be fast enough?
Will a zener limit the voltage to less than 5V?

Yes sorry! TQ2 is the one im using (not 4) Its a dpdt.. Post now edited

As I said his calculations make no mention of inductance so how does he know the kickback voltage. You can try all kinds of tricks if you want. Let us know what happens.
It only takes a few microseconds to burn out a CMOS device.

1 Like