I am interested in automating button presses with digital outputs from a microcontroller. I've soldered leads to the button contacts and I was planning on programmatically shorting these leads together, using a relay or something similar.

One of my unique challenges is that I'd like to do debounce testing of the button. So I was originally looking at using a solid-state relay (SSR) to avoid any additional switch bounce that could be contributed from a mechanical relay. The only issue with using an SSR is that the SSR boards I can find are reserved for AC load switching and in my application the load is DC, albeit very low current DC.

I feel like I've heard of using IGBTs for something like this. But I'm not sure how to design that, especially considering I don't know the expected collector or emitter voltages and ideally I'd like the solution to be agnostic to them.

Basically, I want the functionality of a mechanical relay (with very low load current requirements) with the speed/precision of an SSR, but I don't know what to Google to find it.

Can anybody suggest some keywords or products that accomplish this in a straightforward way?


1 Answer 1


There are no good substitutes:

  • Relays may not bounce the same way as the buttons they're emulating. They certainly will [bounce], but maybe too consistently, considering the buttons can be pressed from any angle, at any rate. Almost certainly with a different duration and range of patterns of bounce. Tactile switches are usually pretty good, at least; but the worst case (especially say for aged equipment in poor environmental conditions) can be pretty ratty.
  • So you'd like a solid-state version, so as to program your own bounce patterns -- fair enough. SSRs aren't very fast though (typically some ~ms turn-on/off times). That's a problem for emulating bounce in the same time scale (~ms).
  • We can approach a more accurate solution in regards to timing, but we give up a variety of assumptions in the process. For example, we can use analog switches, which are fast and suitable for logic level signals, but now we must be common-ground with the EUT (equipment under test), and run at equal or greater supply voltage (the signal voltage must be within the switch's supply range).
  • Or if we do the same with single transistors (JFETs and BJTs are options here -- both offer uni- or bi-directional operation, depending on type), we can make our own analog switch, perhaps without as strict supply voltage limitations, but still very much common-ground required, and with poorer signal performance than purpose-made CMOS switches (i.e., more charge or current injection, some voltage offset).
  • Or if we drop the bidirectional limit, then we need further assumptions about the driver, like whether it uses fixed/pulsed DC to scan, or if reversal is included as in a matrix. And if that matrix uses diodes by itself already, or if it will behave if we add them ourselves, etc.

So the closer we approach some parameters (like timing), the more restrictive our options (common mode range / supply voltage, bidirectional support, voltage/current/charge errors..), and the more we must know about the EUT to guarantee correct operation.

Note that SSRs have poor on/off resistance ratio, and other parameters. Likie, probably for something like this, you'd choose a small opto part, with 10s or even 100s of ohms Rds(on)? Likely that would satisfy a great number of applications. But that still leaves some ~nA of leakage (likely ~nA in practice, but the datasheet may only guarantee ~µA because it's faster to test), and also some 10s or 100s of pF off-state capacitance.

The speed at least can be improved, say with the Microchip HT0440, or, given its poor availability, maybe a discrete equivalent instead (say using a transformer + oscillator to supply the gate voltage). This can have some ~µs of response time, which should be good enough for a lot of cases.

It's not clear how general this needs to be: keep in mind, mechanical contacts, when open, have GΩ or TΩ easily (largely limited by surface leakage), and close in fractions of a nanosecond to milliohms of resistance. It's simply impossible to emulate the sheer speed and dynamic range of a true mechanical contact. For as inconsistent as they can be (in timing and reliability), they have truly impressive performance when they do.

And to be clear, these edge cases can be relevant for some -- not necessarily pathological cases, but even just lazy cases too. Take for example, putting a 0.1µF cap across the contact, partly to supply "wetting current" and partly to filter debounce. Well, that cap can discharge into the RLC loop formed by the contact and lead inductance -- with frequency content in the 10s of MHz as a result -- you can't emulate this with a solid-state switch!

On the upside, you probably aren't gaining any insight into the gross functionality of the system at this level of subtlety (i.e. the interface likely doesn't care how fast / bouncy (in terms of RF ringing) the signals are). I suppose it might still be of interest in certain EMC contexts (very strict emissions standards like for SIGINT?). Likewise, if you're replacing buttons or a keypad with extended hardware say on a cable, that's very much going to change the EMC response of the EUT, which makes it problematic as a testing solution; pneumatically-actuated fingers pressing the real switches might well be necessary in such a case. (Indeed, human body simulants are sometimes used in EMC testing of personal equipment like phones and such.)

  • 1
    \$\begingroup\$ Thanks for the very thorough and clear answer! I'll have to see if I can gather any other information that would simplify/add-specificity to the problem. If I understand you right, the high-speed, context-independent solution of my dreams doesn't exactly exist - so I have to either sacrifice speed or context-independence. \$\endgroup\$
    – SteevJobbs
    Oct 17, 2022 at 16:39
  • 1
    \$\begingroup\$ My specific application has expected de-bounce times of 5ms. Since my scope is limited to verification, I was able to find High-frequency RF Mechanical relays that have operating times <0.5ms including bounce that will provide sufficient speed to verify both the positive and negative case for de-bounce. cotorelay.com/wp-content/uploads/2014/09/… \$\endgroup\$
    – SteevJobbs
    Oct 17, 2022 at 17:42
  • \$\begingroup\$ @SteevJobbs Ah, nice find. A bit pricey, but, quite acceptable for test equipment purposes. \$\endgroup\$ Oct 17, 2022 at 18:28

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.