Arduino noise quickshifter

Dear

Hey I made myself a quickshifter (motorcycle ignition cut-out) with an Arduino. The problem is that I have noise on my input pin, it gets high by the noise of the running engine. (I used pull-down resistor for the switch) I read a post where someone explained that he used a capacitor to eliminate this. Can anyone tell me how I need to connect such a capacitor? Do I just need to put it across the switch?

Kind regards

Stan

I wrote a post where someone explained that he used a capacitor to eliminate this.

You wrote that post? Or you read that post?

One leg of the capacitor goes to the digital pin. The other goes to ground.

Yeah read indeed, sorry haha
and okay thank you, i will test it out soon.

Do you happen to know which capacity of capacitor is good for this application?

StanSegers:
Do you happen to know which capacity of capacitor is good for this application?

A typical bypass cap is in the 0.1uF range. Much will depend on the output impedance of whatever is driving the pin. If the output device has a very high impedance I'd work on a buffer for that in addition to filter caps...

Capacitors have a limited range of effectiveness; you might also consider having multiple caps; 0.1uF to help with lower-frequency noise and a 33pF for high-frequency noise.