embedded software boot camp

Lowering power consumption tip #3 – Using Relays

Monday, November 2nd, 2009 by Nigel Jones

This is the third in a series of tips on lowering power consumption in embedded systems. Today’s topic concerns relays. It may be just the markets that I operate in, but relays seem to crop up in a very large percentage of the designs that I work on. If this is true for you, then today’s tip should be very helpful in reducing the power consumption of your system.

I’ll start by observing that relays consume a lot of power – at least in comparison to silicon based components, and thus anything that can be done to minimize their power consumption typically has a large impact on the overall consumption of the system. That being said, usually the thing that will reduce a relay’s power consumption the most is to simply use a latching relay. (A latching relay is designed to maintain its state once power is removed from its coil. Thus it only consumes power when switching – much like a CMOS gate). However, latching relays cannot be used in circumstances where it is important that the relays revert to a known state in the event of a loss of power. Most embedded systems that I work on require the relays to have this property. Thus in these cases, what can be done to minimize the relay’s power consumption?

If you look at the data sheet for a relay, you will see a plethora of parameters. However, the one of most interest is the operating current. (Relays are current operated devices. That is it is the presence of current flowing through the relay coil that generates a magnetic field that in turn produces the magneto-magnetic force that moves the relay armature). This current is the current required to actuate (pull-in) the relay. Not much can be done about this. However, once a relay is actuated, the current required to hold the relay in this state is typically anywhere between a third and two thirds less than the pull-in current. This current is called the holding current – and may or may not appear on the data sheet. Despite the fact that the holding current is so much less than the pull-in current, almost every design I see (including many of mine I might add) eschews the power savings that are up for grabs and instead simply puts the pull-in current through the relay the whole time the relay is activated.

So why is this? Well, the answer is that it turns out it isn’t trivial to switch from the pull-in current to the holding current. To see what I mean – read on!

The typical hardware to drive a relay consists of a microcontroller port pin connected to gate of an N channel FET (BJT’s are used, but if you are interested in reducing power, a FET is the way to go). The FET in turn is connected to the relay coil. Thus to turn the relay on, one need only configure the microcontroller port pin as an output and drive it high – a trivial exercise.

To use the holding current approach, you need to do the following.

  1. Connect the FET to a microcontroller port pin that can generate a PWM waveform. The hardware is otherwise unchanged.
  2. To turn the relay on, drive the port pin high as before.
  3. Delay for the pull in time of the relay. The pull in time is typically of the order of 10 – 100 ms.
  4. Switch the port pin over to a PWM output. The PWM depth of course dictates the effective current through the relay, and this is how you set the holding current. The other important parameter is the PWM frequency. Its period should be at most one tenth of the pull-in time. For example, a relay that has a pull in time of 10 ms, would require a PWM period of no more than 1 ms, giving a PWM frequency of 1 kHz. You can of course use higher frequencies – but then you are burning unnecessary power in charging and discharging the gate of the FET.
  5. To turn the relay off, you must disable the PWM output and then drive the port pin low.

Looking at this, it really doesn’t seem too hard. However compared to simply setting and clearing a port pin, it’s certainly a lot of work. Given that management doesn’t normally award points for reducing the power consumption of an embedded system, but does reward getting the system delivered on time, it’s hardly surprising that most systems don’t use this technique. Perhaps this post will start a tiny movement towards rectifying this situation.

Next Tip
Previous Tip
Home

Tags: , ,

12 Responses to “Lowering power consumption tip #3 – Using Relays”

  1. Kepa Diez says:

    A nice pice of information, as usual.But, I think that in most designs relays are used, when activated, to turn on a high power load (say, a 2000W heater element). In this case, is it worth to save 200 mW, when this only accounts for a 0.01% of the whole?There is no doubt that this technique can be very useful indeed, especially taking into account all the new low power and standby regulations, however I am afraid that it won't fit most projects.

  2. Nigel Jones says:

    I suspect that most readers will agree with you. However (as usual) I'd like to offer a contrary point of view. The 200mW you mention is of course insignificant in terms of the overall power consumption. However, it is unnecessary power consumption, whereas the 2000W heater is presumably necessary power consumption. Now clearly, one system saving 200 mW doesn't change much. However, if at any given time around the world there are a billion relays turned on by an embedded system, then the power savings would be 200 MW. As the saying goes, a billion here, a billion there and pretty soon you are talking real money!

  3. Kasper says:

    Regarding insignificant overall power savings: the relay is usually actuated by 5V or 12V. As Nigel said, the relay usually dominates the power budget. This means that a more expensive regulator might have to be chosen because of continuous output power requirements.Nigel, is there possibly an issue with EMI when holding a relay with PWM? What if two microcontroller outputs were used? One would control the operating, the other would control the holding, using a series resistor to limit the hold current.

  4. Nigel Jones says:

    I've never experienced an EMI problem using the technique. I suspect that the emissions are trivial compared to interrupting the load that the relay is switching. I have used two microprocessor ports – but not in the way you described. What I've done is generate a PWM signal that is the PWM source for multiple relays. Then through judicious external logic I can feed either a 1, 0, or PWM signal to any given relay.

  5. Jonathan Jones says:

    Presumably reducing the current through the relay coil will also reduce the force holding the contacts together.Could this result in the contacts running hotter and affect the reliability of the end product ? Ditto reduced resistance to vibration.This is more likely to be an issue if the relay contacts are run near their specified rating.

  6. Nigel Jones says:

    I'm sure that's possible – but I haven't observed it. If vibration was an issue with a product I probably wouldn't use the technique. There again if vibration was an issue I'd probably not use relays at all!

  7. Michiel says:

    I find it suspicious that there used to be some integrated solutions for PWM driving a relais, e.g. the UC3702 from texas instrument, but the chip is obsolete for some time and not recommended anymore in new designs. I found no replacements for these chips. Maxim has some relais drivers with power saving functions, but they lower the voltage with a linear regulator instead of using PWM (which is less efficient). Since the technology existed, but is no not used anymore, the cause is maybe EMC? In http://relays.tycoelectronics.com/appnotes/app_pdfs/PWM_application_note.pdf, a minimum PWM frequency of 20 kHz is recommended, although they also warn for EMC problems.

  8. Nigel Jones says:

    Michiel:Thanks for your informative comment.I'm skeptical that EMC is an issue. Many embedded systems contain switching regulators that are switching a lot more current at a lot higher frequencies – and often in discontinuous modes of operation. Now granted many of these designs use shielded coils which help to dramatically reduce emissions. However, I've also seen many designs that don't use shielded coils.As to the demise of the UC3702. I think the explanation is simply that people are using microprocessors to perform this function and hence the demand for the chips is drying up.I took a quick look at the Maxim solutions. They seemed unnecessarily complicated to me. Certainly they didn't seem to offer a compelling advantage over PWM.Regarding the Tyco recommended switching frequency. I can't say I disagree with them. However this is definitely a technique where you have to experiment to find the optimal setting. Switching at 20 kHz will work. However your switching losses will be ten times higher that switching at 2 kHz. Thus it's perfectly reasonable to start at 20 kHz to prove the technique, and then start dropping the frequency in order to cut down on your switching losses.Based on your comments it appears that you are researching this technique for a new project. If this is the case then I'd appreciate it if you'd post your results here as and when you implement whatever technique you end up using.

  9. Ben says:

    Good article. With regard to power savings using this technique being trivial compared to the current drawn by the switched load, let me offer a different point of view. Relays are sometimes used in instrumentation to do things like switch filters, attenuators, etc. into and out of a signal path. In this sort of application, you are not switching a high-current load. Thus, the power saved using the PWM technique could actually amount to a large percentage of your power budget.

  10. Jeet says:

    >> What I’ve done is generate a PWM signal that is the PWM source for multiple relays. Then through judicious external logic I can feed either a 1, 0, or PWM signal to any given relay.

    If you don’t mind sharing, what does this external logic look like? I am trying to figure out the most cost-effective, efficient way of being able to drive multiple relays with a 0,1, or PWM. Thanks!

    • Nigel Jones says:

      It’s just some basic combinatorial logic. Foe example if I have 4 relays, then I’ll have a quad 2 input AND gate and a quad 2 IP OR gate. I feed the PWM signal to one input pin of each AND gate. The other pin is the per relay PWM enable pin. When high it passes the PWM signal, when low it blocks it. The output of the AND gate feeds one of the inputs of the OR gate. The other input is the per relay logic level. If this input is high, then the relay is driven with a ‘1’. If it’s low, then the relay is driven by the output of the AND gate – which is either the PWM stream or a zero. Thus you can get a ‘0’, a ‘1’ or a PWM stream to each relay.

Leave a Reply