I have a 5v wire that runs from my arduino along the frame of my truck to a switch at the rear and back. I want to put a filter on the signal wire coming back just to filter out any spikes and noise that might be picked up by that wire, just to be safe. How do I pick the capacitance value to use for this sort of application?
And if I wanted to filter a 12V hot line (presumably straight off the alternator) to get a cleaner 12V wire that I can later divide and use with Arduino input pin, what kind of capacitor and/or circuit would I use here?
It depends of course on your particular application, but are you not trying to solve a problem where none exists?
I discovered Arduino because of this very problem: noise in an automotive application.
A year or so ago I made a little electronic device for my 45 year old car, using what is called a 555 timer. In case you don’t know, this is an 8-pin IC chip that became available in the 1970’s, when IC chips had just started to appear on the market. On the workbench and in the car (with the engine not running) the circuit worked perfectly. But when the engine was running the circuit did weird things. I tried everything to try and isolate the circuit from noise – ceramic capacitors, electrolytic capacitors, inductors, metal shields, in every possible combination. Nothing worked.
I then trawled the internet and discovered that it was a well-known problem with the 555-timer in automotive applications – called “false triggering”. Somewhere someone made the comment that he had given up on 555-timers because of that, and had switched to microcontrollers. What are those? I asked myself.
I then happened to see an Arduino in a shop, bought one, and got hooked.
I have since implemented the circuit with an ATtiny85 chip (for which I wrote the code on my Arduino) and it has worked faultlessly ever since. The circuit was much simpler than the one I had built previously, and I used NO capacitors whatsoever. I power the ATtiny from the car’s 12 volt battery simply via an 820 Ω resistor and a 5 v zener diode to earth.