I have a nagging problem, which I have researched, but I wondered if someone could give an opinion.
My project basically reads battery voltages and accepts some inputs. I would like to add capacitors to reduce any noise picked up from the cables.
From my research:
I am thinking a Ceramic Capacitor 100pF 50V would be good for C1, to reduce any stray noise activating the input.
And a Electrolytic Capacitors Range 100uF 63v before the voltage divider C2, to filter noise.
(The voltage of the caps is high, but thats what I have available to me, from reading I believe this is ok)
These diagrams work, but as they are to reduce intermittant issues, I am finding it hard to fully test and to know if I am correct.
For diagram 1, what is the input signal ? I guess you understand that that arrangement will block DC and, depending on the value of the capacitor, lower frequency signals.
For diagram 2, why is A1 connected to ground ? The capacitor here will block higher frequency signals.
I am thinking a Ceramic Capacitor 100pF 50V would be good for C1, to reduce any stray noise activating the input.
Your first circuit won't work; a capacitor passes only AC, a diode only DC, put them in series as you have done and you have a circuit that won't pass any current at all, apart from a brief charging current to the capacitor.
And a Electrolytic Capacitors Range 100uF 63v before the voltage divider C2, to filter noise.
Put that capacitor across the 12k Ohm resistor. I don't exactly know how to calculate the value but you need to consider the highest frequency signal you want to pass then use a capacitor that will create a filter with a cut off above that frequency. There are online calculators that will give you capacitor values for RC filters, or, most likely, someone who can remember their college days better than me will come along and teach us both something. If it were me I'd use 0μ1 and see if it was OK.
[EDIT] I missed what 6v6gt noticed about A1 being grounded, same question, why?
In the "Capacitor 2" scenario, you squander your best opportunity to make an effective low pass filter by placing the capacitor at the input to the voltage divider. Also, 100uF is ridiculously large for such an application as noise filtering. As mentioned above, with those resistor values, you ought to be able to place a 100nF (0.1uF) cap in parallel with the 12k resistor (eliminate your mistaken grounding of A1).
There are more things you can add, if you get ambitious, like GND and VCC external clamping diodes, and TVS protection. But you need to at least get the basic circuit right.
100pF is only useful for shorting RF interference to ground at VHF and above, ie 100's of MHz and above,
your first circuit has the capacitor in series so its only useful for detecting a powerful radio signal!
If you suspect RF interference then start your divider with a 1nF ceramic capacitor to ground, with very short
leads. This will have basically no effect other than suppressing RF as 1nF is invisible at DC.
If your voltage divider impedance is around 1k to 10k, you don't really need to worry about noise pickup
unless some heavy EMI is present.
If the divider is 100k to 1M or so, you will need 100nF to ground on the analog pin to provide a low enough
source impedance to the ADC for accurate reading.
You may want more capacitance for low pass filtering if the signal has a lot of out-of-band noise (a battery
normally is quiet, unless its powering motors).
Thanks for your replies, that gives me something to go on and I will put a cap across the 12K resistor on the divider. I think for the other diagram, I´m going to do lots of testing and see what happens.
For your questions regarding the A1 pin being grounded. It to use differential reading from the votlage divider, as I cannot garantee I will have common neg between all the batteries. It was a puzzle I rasied a while back and this solution works a treat.
For your questions regarding the A1 pin being grounded. It to use differential reading from the voltage divider, as I cannot guarantee I will have common neg between all the batteries.
There's no point grounding one of the analogue inputs. You need to know what you are measuring and how. The Arduino A2D does not have a differential input, you have to join the grounds. Having joined them you achieve nothing by grounding an analogue input, it will just measure 0 all the time. The input you are measuring will measure with respect to ground. If your signal is differential then grounding one side will cause no end of problems. Please show your full schematic including both circuits, their power and proposed connections. When you do that then I or someone else can offer specific advice.