Dual latch Relay Circuit Setup

Hi Guys,

I will apologise straight off for the lack of circuit diagram. But I will explain what I am trying to do as best as possible.

I have the dual altching relay model of this relay. I am trying to configure it so that I can both latch it either way with my arduino. A wise person on this forum has guided me to understand that in the diagram. I think 5v is applied to the + pin and then when setting or resetting the relay, I have to set either side to low? Is this correct?

I have also read that I should employ resistors and diodes to protect the arduino from getting fried.

Any help on how I would set this circuit up would be much appreciated. Thank you for your time.

First of all open the data sheet and find your specific relay description (section Dimensions), to identify the coil connectors and polarity. Eventually the same information is printed near the relay pins. Or give the full type ID of your relays, so that we can find the essential details pertaining to exactly that type.

In either case you need at least 2 transistors, better a H-bridge, to drive such a relay. The Arduino outputs are incapable of sourcing that much current or voltage as required to toggle the relays.

lots more data is needed.

latching relays on that data sheet offer either a single coil. you use an H-bridge to revere power
and it shows two coils. one to set one direction, the other for the second direction.

-U is a single coil, you alter ground and power
-K is 2 coil, you need to bring one to ground to make that side work.

very easy to use two coils. but you need two pins from your Arduino.

YOU CANNOT POWER DIRECTLY from the Arudino.
at 5V each coil uses 150 mA.
you must use a transistor. very easy, couple of cents for a transistor, resistors and the required diode.

power goes to the relay coils, always hot.
you only close the circuit on the coil you want to power.
only needs a few ms to power the coil.

for a single coil, you need to use an H-Bridge.

pins from the Arduino are on the left.
you need 4 transistors, 2 are to be PNP, and two NPN
or use an h-bridge on a chip.

H-bridge is the magic word.
But, there is a BUT ...

Building this circuit with discrete devices you will have to make absolutely sure, that certain conditions won't happen if you don't want to fry the transistors in the circuit. As the transistors need a time (ok, pretty short, but they are fast) to switch from ON-OFF or OFF-ON you might run into a situation where the current is shortened through two transistors with any load in between which will fry at least one, maybe both transistors.

There for my recommendation is to use a special IC for that which is designed to avoid that shortening situation.
A suitable H-Bridge IC is the L293D, which is pretty common in the Arduino world and pretty cheap, coming with internal protection diodes and it's inputs can be directly connected to the Arduino outputs without addt'l resistors.

The following links give you some more detailed information how to use the circuit; in your project just replace the motor with the single coil of your latched relay - polarity of the coil is irrelevant as you can switch the state back and forth by the Arduino.

http://www.me.umn.edu/courses/me2011/arduino/technotes/dcmotors/L293/L293.html
and

I'd wait for feedback about the really used relay. If it has separate set and reset coils, two transistors will be perfectly sufficient, a full H-bridge is required only for a single coil relay. For insiders: just the same difference as with unipolar and bipolar stepper motors :slight_smile:

DrDiettrich:
For insiders: just the same difference as with unipolar and bipolar stepper motors :slight_smile:

yes, once you get familiar with a coil, you soon realize that a solenoid, a relay a stepper, are all just coils and are treated the same basic way

dave-in-nj:
yes, once you get familiar with a coil, you soon realize that a solenoid, a relay a stepper, are all just coils and are treated the same basic way

Right, but as we know from resistors in parallel and in series, multiple coils can be combined in several ways, with distinct behaviour :wink:

Separate 5V supply is needed but H-bridge is not needed (I've used these). Only 2 outputs needed. Remember to use a pulse (HIGH) to set or reset the relay (do not leave the outputs continuously high). A pulse duration of 40ms works well.

For a single coil you can use a "poor man's H-bridge"

Wow thank you so much for all your replies everyone. I am sorry for not making it clear. The relay i am using is the double Latch Relay.

It is the G5RLk1EDC5

it takes 5v. I also have some of the single coil, although I am pretty sure that the double altch will be more suitable for my project.

From the datahseet it has 9 pins. 6 pins for the current that is being switched. That is 2 pins for NC, 2 for C, and 2 for NO.

It also has a + a reset and set.

I have TIP120s and 2n3904 transistors..probably more lying around. Would these be sufficient. I have also ordered some from china..

I am pretty sure that the way I connect it is:

5v to the +, then make Reset and set outputs which I pulse into either state. I just have to be careful with backflush EMF and alot of the other things you guys mentioned.

I have diodes and transistors and resistors. Is there any sure fire way of selecting the right one or is it setup the circuit and test current and voltage?

Arduino 5v - > middle pin

Arduino output pin --> Diode ->transistor --> reset

Arduino output pin --> Diode ->transistor --> set

Is this the right setup for a double latching relay?

Is this the right setup for a double latching relay?

The diodes need to be connected across the center tapped coil as shown in the diagram.

Diode 1: Anode to relay pin 1, cathode to relay pin 9.
Diode 2: Anode to relay pin 8, cathode to relay pin 9.

Here's a simple test script:

const byte ledPin = 13;            // LED pin (shows relay status)
const byte setPin =  6;            // connect to relay coil "S" pin
const byte resetPin = 7;           // connect to relay coil "R" pin

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(setPin, OUTPUT);
  pinMode(resetPin, OUTPUT);
}

void loop() {
  // Set the relay
  digitalWrite (setPin, HIGH);
  delay (40);
  digitalWrite (setPin, LOW);
  digitalWrite (ledPin, HIGH);

  // Wait 1 second
  delay(1000);

  // Reset the relay
  digitalWrite (resetPin, HIGH);
  delay (40);
  digitalWrite (resetPin, LOW);
  digitalWrite (ledPin, LOW);

  // Wait 1 second
  delay(1000);
}

The diodes need to be connected across the center tapped coil as shown in the diagram.

Diode 1: Anode to relay pin 1, cathode to relay pin 9.
Diode 2: Anode to relay pin 8, cathode to relay pin 9.

Thank you for your reply.

I do not currently have the transistor that you specified , but I do have 2n3904. Will these work until I can source the ones specified?

Thank you so much for the test script, it is exactly what I needed.

Will any cathode do? Does the downwards arrow mean to ground, except we do not want the arduino and the 5v to have common ground?

you have provided the diagram for a single latch relay. Will the same script and circuit work for the double latch?

Thank you for your continued response.

Yes, the 2N3904 should work OK. Most any diode would do ... IN4448, 1N914, IN4004, 1N4005, 1N4006, 1N4007 and others.

Does the downwards arrow mean to ground, except we do not want the arduino and the 5v to have common ground?

for any diode, this is the anode side -----l>|------ this is the cathode side

The long line side does not mean "to ground". In this application, this end of the diode (cathode) connects to the center pin of the relay coil (+5V).

you have provided the diagram for a single latch relay. Will the same script and circuit work for the double latch?

No, it's for the double-winding Latching Type.

You may have a different relay contact configuration. The SPDT (single pole double throw) type "1C" (form-C). Yes, it will work for this type also.

Thank you again for your response, I will attempt to make something following your guidelines after i finish work tonight.

I was referring to the hollow white downward arrow, is this ground?

If not I was curious as to how the circuit is grounded? I am a beginner at this stuff, but from the diagram you provided it looks as if the current from the high pulse will trail back out the left pin of the opposite transistor?

Once again thank you for your time.

After looking over the diagram further.

Does the white hollow arrow mean 5v? That would mean that 5v goes into the collecter, then the base is pulsed and the emitter delivers the current towards either reset or set? then the back flush of emf travels through the diode back into the centre pin?

You better use the circuit diagram in #8. The H-bridge circuit in #3 is too specialized and simplified, will work only under certain conditions. The weakest point is the restriction of the supply voltage, which is supposed to equal the logic HIGH voltage of the driving output pin, under load. Even then the top transistors may not turn fully on, due to the voltage drop in the base resistors. If a base current of only 1mA is required, this will drop 1-3V on the 1-3k base resistors, another 0.7V on B-E, and 0.4V on the C-E of the bottom transistors, so that less than 3V is left for the coil :frowning:
Increasing +V doesn't help, because the emitter voltage can not exceed the base voltage, which is determined by the connected controller output pin. In practice the top transistors should be PNP, with another NPN transistor driving their base.

The hollow arrows mean ground. The diodes let the back flush rush into the power source.

Thank you for your reply. I am building the circuit now. Is the external 5v supply mandatory or is this the only way doing it this method?

Would this mean I would need two power supplies for every one of my projects? Would it be possible to have 1 main external supply that feeds all of the relays around the house through cat6? I know there would be a voltage drop, so you would up the voltage at the start, is there anyway however to ensure that 5v goes into the circuit at the end?

Thank you so much for your guidance

Hi There,

You better use the circuit diagram in #8.

I attempted the circuit. I have enclosed pictures but will describe as best as possible

arduino pin 6 -> 470 resitor to base of transistor, with left pin leading to ground and right pin leading a common line which splits off into 1 pin of relay (of the 3 pins), the other is a diode pointing towards a line that is fed 5v from an external power source. This is repeated for pin 7.

I then used the script your provided, no clicking noise when hot is not attached and no switching when it is.

I feel i have possibly confused myself somehow and done things wrong. The bit that worries me the most is around the input area. I have attached pictures to attempt to assist my explanation.

Thank you

Test your circuit by disconnecting the base resistors from the controller, and connect them momentarily to Vcc to switch the relay. You can also add a LED (+resistor) to the output pins, for visual feedback.