In this circuit, what is the capacitor for in the switch?

Hi, I'm getting ready to build an arduino morse code keyer, which is a device that takes two inputs (two switches) and then makes morse code sounds (short & long) depending on switch was pressed.

Attached is a circuit diagram. On the diagram, the two input switches are on the right side, labeled right paddle and left paddle.

What function do the capacitors serve in a digital-pin switch such as these? What will happen if I omit them? Does it have to do with debouncing?

More detail on this project is here, if you want to read it: https://groups.io/g/radioartisan/attachment/8289/0/Arduino%20Manual_Eng_%20K3NG_CW_Keyer_v5.3.pdf

Thanks.

What capacitor? C3,4,6

For outputs, C1 C2 are probably there to round off the rectangle pulses to remove high frequency components.
There really should be a series dropping resistor on these pins of some low value, maybe 10 to 100Ωs.

If inputs, they absorb glitches.

Yes, debouncing.

It may work fine without them. You can always use software debouncing too.

@larry C1 and C2

zirconx:
What function do the capacitors serve in a digital-pin switch such as these? What will happen if I omit them? Does it have to do with debouncing?

No, because using a microprocessor, de-bouncing will be manged in the code.

A Morse keyer is used to control a radio transmitter. The capacitors are to bypass the radiated RF from that transmitter from getting into the keyer circuitry and interfering with its execution of code. An HF transmitter generates RF of similar frequencies to the microprocessor clock. :astonished:

Once you know that, you will know whether or not you need them. :grinning:

So I probably don't need the capacitors for practicing morse code (unconnected to a radio). And may or may not need them when I start transmitting.

Turns out this is not as hard as I thought it would be. I didn't add any other components (resistors, capacitors, etc), just wired everything together. My audio is pretty low since I am not using the amplifying transistor shown in the circuit, but it does work.

Thanks for the help.

Haven't seen a "bug" in quite a while, figured newcomers these days would use a keyboard. :slight_smile:
dah dah dit dit dit, dit dit dit dah dah.

Thanks gawd they took that requirement out of the FCC HAM license.

outsider:
Haven't seen a "bug" in quite a while, figured newcomers these days would use a keyboard. :slight_smile:
dah dah dit dit dit, dit dit dit dah dah.

That’s not a bug, just a paddle. A bug is a purely mechanical contraption that sends dits and dahs all by itself without electronics.

Google “Vibroplex bug” and you’ll understand where the name came from.

https://ag6qr.net/index.php/keys-bugs-paddles-and-keyers-a-terminology-introduction/

dah dit dah

Turns out they are necessary. I discovered that when I touch the keyer circuit, it would trigger the keyer. A capacitor between the switch and ground fixed it.

I would add a stiffer pull up resistor and not just rely on the internal (weak) pullups - perhaps 1k or 2k2,
if the pin is that sensitive to capacitive interference.

MarkT:
I would add a stiffer pull up resistor and not just rely on the internal (weak) pullups - perhaps 1k or 2k2,
if the pin is that sensitive to capacitive interference.

I tried a 1k, 10k, and a 15k (to vcc). All caused the circuit to trigger (as if I had pressed the paddle switch) constantly.

A capacitor does solve the false triggering issue though.

Paul__B:
No, because using a microprocessor, de-bouncing will be manged in the code.

That's quite a lot stronger of a denial than it should be. A resistor+capacitor like that forms a low pass filter, which is one of the cheaper ways to hardware-debounce a switch.

While you are correct that the primary purpose is providing noise resistance, it will also provide debouncing at the same time.