Properly decouple Arduino in and output with opto coupler from engine noise

Thank you for the additional answers. I tried out different cutoff frequencies and found that even at a cutoff frequency off 339 Hz the Arduino can reliable detect input frequencies up to 1.4 kHz (210 km/h) which is more than enough. My DSO150 oscilloscope shows the wave is not a nice square signal anymore, but that does not matter to just get the frequency.

I will but the low-pass filter before the opto-coupler so the noise is not amplified. I don't have ceramic capacitors at home, is there a problem using a 1 µF electrolytic capacitor instead of the recommended 0.01 µF or 0.1 µF ceramic capacitor when I adjust the resistor?

To the problem of automotive power input: I think big voltage spikes should not happen as long as the battery and rectifier are in good shape. As far as I know, the ABS and engine ECU can also be damaged if there are any spikes. My voltmeter always shows 13.8 V while driving and a bit less while idling. I don't have a L7805CV at home and ordering takes long, so I will use a LM317 board and use a diode at the input (if some reason the polarity is reversed). Is a 1 µF electrolytic capacitor between the 5V and GND pin of the Arduino correct? Should I add more protection?

I will put the Arduino in a metal candy box and use an Ethernet cable for the four wires. I will then solder the cable shielding to box and connect the box also to ground.