single coil bistable / latching relay

Hi,

so far I have used bistable relays with 2 separate coils for SET and RESET. I control them from an Arduino with 2 pins like shown in attachment "img0072.png". This works fine.

Now I want to use single coil bistable relays where you need a voltage pulse to set / latch the relay and then a reverse polarity pulse to reset / unlatch. I'm having a hard time coming up with a circuit or finding one.

What I have found is the circuit in attached "latching Relay-5.gif".
(source: 101 - 200 Transistor Circuits)

Is this the best way to control this from an Arduino? Where would I put the protection diodes? Or don't I need them in this case?

Is there any better way to control a single coil bistable relay from an Arduino?

One condition is that the relay does not move when power fails. This is the main reason why I use bistable relays.

img0072.png

latching Relay-5.gif

Hi.

Looks to me like that should do the trick, this is less trouble than using an H-bridge.
The protection diodes go over the collector and emitter of each transistor, pointing up in that drawing, and as close as possible to the coil.

You could consider using some more transistors, and then use one output to switch on and off, if you need to save outputs.
There's more ways to save pins, especially when you would be using more than a single relay.

so something like the attached circuit would work?

I have plenty of spare pins on this project and only one relay. So no need to save pins.

5fdc3416ace772641aba48dc59440fe1b2f78f68.png
1ccf144c090118078364ade0dcd6cfa9347a6967.gif

So you are making a "poor man's H-bridge" then. Does the same job, with 25% efficiency. :grinning:

OK, in that circuit, the relay coil only ever sees two thirds of the supply voltage, so if you operate from a 5 V supply, the relay must operate reliably from 3 V. If the relay is in fact, specified for 5 V, then you need to supply the circuit with at least 8 V, or 12 if that is what is powering your Arduino.

Now as long as the transistors are specified for at least twice the supply voltage (and 500 mA), the diodes are in fact, quite unnecessary as the 47 Ohm resistors perform their job. (The third circuit is wrong in any case. :astonished: )

The base resistors should be 1 k.

Also, the common advice that the diodes should be "as close as possible to the coil" represents a complete misunderstanding of their purpose.

How would you do it? I'm open to any suggestions on how to approach this in a better way...

You can do it that way given the constraints I explained - you need to use 60% more supply voltage than that required to operate the coil. The inefficiency will not matter greatly because you are only using brief pulses to switch the relay.

I gather that this will in fact be mains operated, and that your concern is the "memory" of the relay rather than power efficiency.

The alternative is to use an H-bridge. If in fact, your relay is 120 Ohms and operates at 5 V, then it will require about 42 mA; there should be some CMOS logic devices capable of driving this current, possibly using a number of gates in parallel. (Note you can parallel gates in an array, but not Arduino pins.) Any logic device output is already half of an H-bridge; it is only a matter of the current you require it to drive.

Thanks Paul. I haven't quite decided on a particular relay model yet. It just looks like the single coil versions are a bit cheaper than the 2-coil ones I'm using now. The one model I'm looking at has a coil resistance of 42 Ohms and is rated for 5V.

This is part of a controller for RGB and white LED strips that has 12V power supply. The relay switches power to the strip on and off on the +12V side, MOSFETs on the GND side PWM the individual colours. The relay works together with a normal SPDT wall switch so both the switch or the relay can be used to switch the LEDs on or off regardless of what position the other one is in. By using a bistable relay I'm avoiding the relay changing position in case of power failure, which could cause the lights to be switched on unnecessarily when power comes back (and noone is home, for example).

Full circuit diagram and a photo of the first assembled controller attached.

Since the controller has a 12V power supply, it shouldn't be a problem to supply more than 5V to the relay circuit. But I'm beginning to wonder if it is worth the hassle changing the circuit to accommodate the single coil relay to save less than £1 per controller.

Arduino_Dimmable_LED_Switch_RGBWU - Schematic.pdf (72.1 KB)

hmmmm, there was an issue uploading the photo. trying again...

Actually, I would call your concept, bad design.

If you want the default to off, you use the (ordinary, normally off) relay alone to control the lights, and use your wall switch (or better yet, a push button) to control the Arduino in addition to your remote control. When it powers up, it first reads the wall switch and considers that position "off".

If you really want the relay to "remember" its position, you just use the EEPROM in the Arduino. That's what it is there for.

And if switching mains, use a SSR.

I have designed it this way so that I can still switch the white LED strip on and off using the wall switch even if the Arduino has failed for some reason.

I use a similar circuit to your original, but use a couple of channels of a Darlington array (ULN2003) to drive the relay coil. See attached.

It's a bit of a waste if you're only using two channels of the ULN2003, but it works very will. I use the Arduino to pulse (for approx 10ms) pin 1 or 2 depending on the direction required. I'm using the spare channels of the ULN2003 for other duties, but I simplified the diagram to keep it clear.

Cheers,

Ian.

Thanks. That looks simple enough.
I see you use 5V. Does the relay have a 5V or 3.3V coil?

yesyes:
I see you use 5V. Does the relay have a 5V or 3.3V coil?

I've used it with 5v & 4.5V relay coils. Not tried with 3.3v versions, but can't see it being an issue, as long as you drop the voltage to suit. I believe the ULN2003 will switch quite happily with 3.3v logic as well.

Cheers,

Ian.

I meant these 47 Ohm resistors. As Paul has pointed out, these resistors will drop some of the voltage. It doesn't seem to be a problem with your relays.

Yes, there is obviously some drop from the resistors, but not enough to cause problems. Certainly not with the small Omron relays I'm using. I initially used the 5v coil version, and later moved to the 4.5v version. This was only due to product availability though, and not to cure any problems.

Ian.

yesyes:
I have designed it this way so that I can still switch the white LED strip on and off using the wall switch even if the Arduino has failed for some reason.

Again, I find that a rather inappropriate design consideration. Whatever makes you think the Arduino will "fail"?

There is some small possibility the program could crash, generally from impulse interference from the power circuitry that you are controlling. That is why you have a watchdog timer available to restart it in such circumstances, so that is adequately provided for.

The power supply to the Arduino could fail. It might be a consideration then to fail with the lights on using normally closed contacts on the relay if the illumination is important. Again, using the EEPROM to remember the last determined state will mean that the lights will not spuriously switch on merely due to a power outage. On the other hand, the power supply to your 12 V LEDs is equally likely to fail, so you get no light anyway.

The simplicity of using a single, ordinary relay should outweigh any advantage of using a latching relay in a "two-way" configuration with the wall switch.

And I recently had to replace the wall switch to my daughter's en-suite light. It broke from years of use - I hardly need to explain why.

I'm afraid we have to agree to disagree on this one. The fail safe was a requirement by 3 wives (mine and those of 2 other friends who use the same system in their house; not all 3 my wives :smiley: ). They don't want to do their make-up in the dark when (not if!) "our stuff" fails. :wink:
And it is not completely unheard of that an Arduino fails.

Also, a normal relay draws a current to stay on, a bistable one doesn't and therefore helps a bit to save some energy (minimal, I know, but it adds up throughout the house).