-1

I'm trying to control this bistable latching Relay (RT314F03)

After not being able to switch the relay I was wondering if that's even possible. While the Relay is rated for 3V, its "Rated Coil Power" is 600mW, which would require 180 mA at 3.3V from the GPIO, far exceeding the 16 mA a GPIO can provide. So basically I just wanted to confirm that this is a deal-breaker for my approach or if this is salvageable in any way. Maybe I just don't understand the purpose of the "Rated Coil Power" and it has nothing to do with this.

Alternatively, I would be looking at using a signal voltage converter using an optocoupler. Is this the most feasible solution if controlling a relay doesn't work?

I am not trying to control a high current load, basically just trying to convert a 3.3v logic signal to a 24v logic signal.

The logic signal is to be processed by a S7-1214.

5
  • Please edit your question and add all requirements to the question instead of using comments for this purpose.
    – Bodo
    Commented Dec 20, 2022 at 12:50
  • Will do. I missed that the load-side is relevant for my alternative idea.
    – Rune
    Commented Dec 20, 2022 at 12:56
  • 1
    You will need transistors to control the relay anyway. If isolation between the Rasp.Pi and the PLC (which you forgot to mention in the question) is not required, a single transistor could be sufficient to drive one of the PLC's inputs. As already written in an answer, controlling a bistable relay is more complicated. You would need at least two transistors and two flyback diodes for one two-coil relay. A single coil version would be even more difficult. Adding more details about the PLC would help us to provide a more detailed solution.
    – Bodo
    Commented Dec 20, 2022 at 13:43
  • see also electronics.stackexchange.com/q/261629
    – Bodo
    Commented Dec 20, 2022 at 13:53
  • The relay will work. You won't need 180 mA of coil current : the "Rated Coil Power" may be considered as a worst case; similar relays I've used required approx 30%-40% of "rated", but that's still too much for a GPIO pin! But even after reading the PLD data sheet, your application is unclear. Do you need a logic input (i.e. low current), or are you switching power to the PLD? If it's logic, the relay is overkill (but it will work); if it's power you need to switch, your choice of the latching relay makes good sense.
    – Seamus
    Commented Dec 25, 2022 at 8:11

4 Answers 4

0

I have never heard of "Rated Coil Power" which seems a nonsense term.

To switch a high current load you NEED a transistor or MOSFET. There a gazillion articles on this.

Logic level converters do what they claim i.e. convert logic levels NOT provide amplification and only output minuscule current.

Frankly a latching relay doesn't really make sense if you are planning to drive it with a computer - just use a normal relay.
It is actually harder to program than a normal relay.

4
  • 1
    I took that term directly from the linked datasheet of the relay. There wasn't really a choice "for" a latching relay, it's just what I already had here and I see no issue programming it. I am not looking for a high current load, just converting a 3.3v logic signal from a linux based machine to a 24v input signal that a plc can use.
    – Rune
    Commented Dec 20, 2022 at 12:14
  • I am familiar with "Rated Coil Power" from the automotive industry, around 1980, "Rated Coil Power" is the value of power used by the coil when the rated voltage is applied. It breaks down to rated operating power is equal to the rated coil voltage × rated operating current or watts. Remember there was not much electronics in automotive in that time frame.
    – Gil
    Commented Dec 20, 2022 at 20:10
  • @Rune your question asked about switching a relay which requires 180mA. This is a high current in the context of a Pi GPIO.
    – Milliways
    Commented Dec 20, 2022 at 20:49
  • I see, that solves most of my question whether the "rated coil power" is the current that the GPIO would have needed to provide to work directly with the relay. In that case I am aware that it's far beyond what the Pi can do.
    – Rune
    Commented Dec 21, 2022 at 9:06
0

Adding to dingo27mobile's answer:

I have no personal experience with PLCs.

According to the PLC examples I found, the inputs seem to be designed for a high-side switch between +24V and an input.

The best solution would be an optocoupler with its output between +24V and an input.

If I understand the data sheet correct, the voltage at the input must be at least 15V for logical 1 and at most 5V for logical 0. At 15V it will draw 2.5mA.

I think with this MOSFET solution, R1 must be small enough that the voltage drop over R1 is less than 24V - 15V = 9V at a current of 2.5mA.

With the proposed 1k resistor, the voltage drop would be 2.5V. The maximum resistance would be 9V / 2.5 mA = 3.6 kOhm.

The resistance must be big enough that

  1. with a conductive MOSFET the current does not exceed the MOSFET's specifications, and

With 24V and 1k the current would be 24 mA. Check the MOSFET's data sheet.

  1. the power at the resistor does not exceed the resistor's spec.

With 24V and 1k the power would be U * U / R = 24 V * 24 V / 1000 Ohm = 0.576 W. So I would recommend a 1W resistor. Another option would be a 2.2k 0.5W resistor (actual power 0.262 W) or maybe 2.7k 0.25W (actual 0.213 W).

0

The Question and Answers here contain some confusion and misinformation.

The bistable latching relay retains its state even after power to the coil is removed. This gives it an advantage in efficiency over conventional relays since the coil need not be powered beyond the few milliseconds required to reach the desired state. This bi-stable operation can make the latching relay more efficient even than solid-state alternatives. It has two stable states, whereas a conventional relay always falls back to its un-powered state (NO or NC) when coil power is removed.

AFAIK, "Rated Coil Power" is not an industry standard term, nor even widely used by latching relay manufacturers. In fact, it's not even defined in the data sheet for the subject latching relay. However, it may be inferred that this is the manufacturer's attempt to communicate the worst-case drive current required to ensure the relay contacts are driven to their specified state.

This brings up another interesting point: Selecting a relay with the lowest-rated coil voltage leads to the challenge of sourcing the highest-rated coil current! The OP's question is sadly lacking in details, but the coil current required could have been significantly reduced by using a part with a higher coil voltage rating. Also, in general, it's never a good idea to drive an inductive load from a GPIO.

In one sense, the question asked here is useful for illustrating how NOT to design a latching relay interface. Higher coil voltages yield lower current requirements, and generally simplify the design.

coil current vs coil voltage

There are several sound approaches to designing an interface to drive relay coils from a Raspberry Pi GPIO. The simplest and most reliable for many low-powered relays utilize the simple bipolar transistor as a low-side switch - as shown in the schematic below.

Bipolar transistors are ideal for interfacing RPi's GPIO pins to external loads. A bipolar transistor is driven by base current, but even at 3.3V, GPIO pins can easily source enough current to drive small signal transistors such as the 2N3904 or 2N2222A into saturation. Some may suggest that a MOSFET transistor be used, but they can't justify the added complexity and/or reduced performance of a device that may require 7-10 volts of gate drive, or cost much more than a bipolar.

schematic

simulate this circuit – Schematic created using CircuitLab

-1

Ditch the relay. Get mosfet, something like BS170.

<+24V> - <resistor 1k> - - <Drain - BS170 - Source > -

Gate of BS170 is your input - connect a GPIO pin to it. This circuit basically converts voltage level from 3.3 to 24V, but INVERTS the output, so when you want HIGH on output, you must put LOW on input.

enter image description here

6
  • Thanks a lot, together with what Bodo provided, I think I now understand the overall approach. So the resistor R1 is used to limit the current that would be drained with an open transistor? But it has to be sufficiently small compared to the PLC input resistance so the voltage at the input is still registered as high?
    – Rune
    Commented Dec 20, 2022 at 14:52
  • 1
    @Rune R1 is used to pull the input to 24V when the MOSFET is not conductive and limits the current when it is. Add details about the PLC and its inputs to the question. If it contains an internal pull-up resistor, R1 may not be necessary.
    – Bodo
    Commented Dec 20, 2022 at 18:06
  • Added the PLC. Sorry, I completely failed to understand why it's relevant until now. So given that the PLC specifies 4mA at 24V, 2.5mA at 15V and 1mA at 5V, can I assume an input resistance of 5kΩ-6kΩ? That would be sufficient, no? And if that was the case, I can remove R1 and move R2 between the MOSFET and ground to limit the current for when the MOSFET is conductive?
    – Rune
    Commented Dec 21, 2022 at 9:40
  • do not put resistor between mosfets source and groud, put it between drain and plc input. Depends on your PLC. I would use a 4,7k R1 in this case and not change schematic, but have no idea of PLC input requirement. Commented Dec 21, 2022 at 16:34
  • 1
    @Rune: Can you explain how this is going to work? I ask because Figure 5 in the BS170 data sheet suggests that driving the Gate at 3.3V is marginal; i.e. the FET is just barely conducting.
    – Seamus
    Commented Dec 22, 2022 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.