You wrote:

> I'm using 3.9k and 1.2k ohms for my voltage divider.. Is this to high? I changed them for 39 and 12

> ohms but it was too low and the PV short-circuited!

3.9K and 1.2K are borderline OK resistor values for a 21 volt (assumed low impedance? PV == PhotoVoltaic array?), feeding an Arduino's A2D input pin. However, if the PV voltage goes *any* higher than 21 volts, then the voltage going into the A2D pin will go above 5 volts, and that's very bad for the A2D and bad for sane readings. I'd suggest increasing the 3.9K resistor to 4.3K or 4.7K, unless you are *certain* that the input voltage will never ever exceed 21 volts. (39 and 12 ohms are way off; just calculate the current draw and the power dissipation!) At DC, your voltage divider is drawing about 4 mA, which is huge compared to the disturbances the A2D makes to its inputs.

Am I correct that your capacitor is in parallel with the 1.2K resistor? (If not, please describe your circuit in more detail.) Without knowing the value of your capacitor, we cannot figure out the RC time constant for your ad-hoc filter, so we can't fully understand your circuit or its behavior. By the way, using an electrolytic cap in a signal-filtering role is just asking for trouble; they leak like sieves. Unless you're doing something fancy, a ceramic cap or a polyester film one should be fine. Note that the tolerance on non-precision caps is very wide, so either measure C or buy one with say +/- 20% tolerance.

If the C is parallel to the 1.2K resistor, and had a value of, say 1 uF (0.000001 Farads), then the RC combo will act like a first-order low pass filter with a knee in the response at:

F_hz = 1/(2*Pi*R*C) = 132 Hz. So this RC combo would filter out signal components above 132 Hz, as a first-order (rather gradual) filter.

I suggest you first work on getting sane A2D readings with just a voltage divider,without the capacitor.

Hope this helps.