I was reading theory that:

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays src

So in case they are electro-mechanically operated and the state of switch is to be monitered, for counting or some better reason, how is debounce achieved in EM relay?

  • \$\begingroup\$ The same as any other switch: use an RC circuit and schmitt trigger, or do it in software. \$\endgroup\$ Jun 1 '15 at 15:44
  • 1
    \$\begingroup\$ Why should debouncing be required? Relays operate relatively slow-acting devices such as motors which do not require debouncing. \$\endgroup\$ Jun 1 '15 at 15:44
  • \$\begingroup\$ Why should debouncing be required? Because the contacts are pieces of metal - when you whack them together, they bounce apart. This produces an essentially random series of contact opening and closing which can last tens of milliseconds. I've seen it and dealt with it. Using an RC/Schmitt trigger is the standard approach. There also exist purely digital dedicated chips to do the job, such as the MC14490. \$\endgroup\$ Jun 1 '15 at 16:05

There are two main methods- one is based on timing and uses software or a low-pass filter and a Schmitt trigger. The principle is that the bounce will only last a bounded amount of time, perhaps 10ms-20ms for a small relay, so by ignoring transitions after the relay has started to change state for a certain amount of time you can get a clean (albeit perhaps slightly delayed, depending on the exact method) signal.

The second method, more rarely used, uses the normally-open and normally-closed contacts to set and reset an RS latch (for example, two cross-coupled NAND or NOR gates). This works because the relay does not bounce between the two states, rather one contact bounces then the other. This is not used so much because it's a bit more complex.

If you are intending to monitor a power relay it's important to observe both the minimum voltage and current specifications in order to get reliable contact detection.

All the above considerations are the same as you would follow debouncing a toggle switch or tact switch, however the relay contacts may not be as forgiving of inadequate current/voltage as most small switches.

  • \$\begingroup\$ Also see the MC14490 for a purely digital approach. \$\endgroup\$ Jun 1 '15 at 16:06
  • \$\begingroup\$ @WhatRoughBeast I'd almost forgotten about that one- uses a clock so it's a hardware implementation of what we'd usually do in firmware/software. MC14490 datasheet \$\endgroup\$ Jun 1 '15 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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