Filtering 5V and 12V in a noisy automotive environment

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?

To be clear, the power supply for the Arduino is pretty clean. It comes from a special 5V switching regulator package that is designed to power RC receivers, which are as sensitive to voltage noise as anything, so I figure that should be pretty clean.

It is unlikely that your 12V comes straight off the alternator.

What is your 5V wire for ? Sending power to some device you are turning off and on ? Sending digital signals along it ?

The 5v line is just a switch. I'm not particularly worried about it, honestly, but I am curious how to pick a capacitor value to clean up any inducted signals.

The 12v line is my concern. What I mean is it comes off the battery, but while the car is running, the alternator and many other things on the vehicle make the signal very dirty. If I run this signal through, say a inductive sensor, and then divide it and feed it into an input pin, I'll need to either clean up the 12V signal, or clean up the split (< 5v) signal. I hope this makes sense.

With a wire of any length, I would install .01uF caps at each end and maybe in the middle too to bypass RF to ground. I would also install a 5.1V Zener or transorb on the wire to keep spikes out of the micro. The cleanest power in the car is at available at the battery terminals. The battery is effectively a giant capacitor. To get the cleanest power back to an accessory, tap off of both terminals and don't use the body ground. Fuse both wires near the battery.

torriem:
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?

One of the biggest "glitch" sources in an automotive power system is power drain spikes. To eliminate these, use a series diode and a capacitor to filter the incoming 12 volts. If a voltage drop spike comes along, the diode will block it and the capacitor will fill in the gap.

A capacitor alone doesn't do much, because there is so much current available in an automotive system to charge-discharge the capacitor. The series diode with a small capacitor (maybe 1uF) should work very well for an Arduino input. If you need to filter a 12V power supply, you'd probably want to increase the capacitor to 1000uF or more.

A more "traditional" filter, is a series inductor, followed by a parallel capacitor to ground. The larger the inductor and capacitor values, the more effective the filter. The inductor has to be rated for whatever current is flowing through it to the load.

torriem:
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?

The item you need is Isolated DC - DC Converters. I saw tons of them when I was in Shenzhen.

An inductor, in series, and a 1200uf 35v cap to GND after that is what I've seen used for 12v filter.

Isolated DC - DC Converters has Isolated DC voltage rating from few hundreds up to few thousands volts, plus it might have over voltage, over current, short circuit protection, and since it might run at few Mhz at switch circuit, all the car spikes and noise will be drop out.

Sure, but a DC-DC converter will cost a lot more.

Not from Shenzhen, more less all IC manufacturers have local reps or distributors at Shenzhen. if not either it is out of business or going out

I'd guess a coil and a cap are under $2.

db2db:
I'd guess a coil and a cap are under $2.

I guess you are a way over estimated the price, the cap could be cost 10-20 cents base on qty at market of Shenzhen. I do not do BOM (Bill of materials). please don't count me on price.

Most of us - especially us working in real production- have to use large US distributors like Digikey, and that's what I based my pricing on.

torriem:
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.

This might be not the case, OP solve the 5v problem and facing 12v only.

few plans for OP;-

plan A
Power Supply Filter, L-C Type. It is cheaper and simpler, and worth to try first. ( credited by db2db )

plan B
Isolated DC-DC converter. offer additional protection and higher noise reject rate.

plan C
Wireless power technology, it might be worth to note on calendar since you might need to wait few more months.
It offers the possibility of "cutting the last cord", thereby removing the last remaining wired connections required to power and
recharge. It is base on similar technology as Isolated DC-DC converter and noise reject rate is great. Now you need to make sure Arduino design is wireless and power cable is last cord.

I rigged a basic power supply some time ago. Basically a choke for both ground and hot, a cap in between, and a resistor and zener to ground to take out any load dumps. I can't remember the values, but it seemed to work pretty well.

My concern was 60Hz and up interference; google for LC circuits to get an idea of the values.

Use components that are rated for at least 75VDC as load dumps can spike that high.

It's important to filter ground as well if you can.