I’ve been beating my head against this for a day or two, and I am stumped.
I am trying to measure car battery voltage.
I have a simple voltage divider with 47K and 20K resistors. I have a 1.5uF cap to ground as well to filter noise (I have a lot of noise at 1.5Khz and 3Khz). This is connected to an A/D pin.
With 12.7V input, I should be getting a reading of:
1024 * (12.7 / 5) * 20 / (47 + 20) = 776.
I’m consistently getting readings of about 713.
I’ve checked everything I can think of. I checked Vcc; it’s 5.03V.
I even added this code:
The voltage is steady (it’s connected to a 225Ah battery). Could the cap be pulling down the voltage? It doesn’t seem to make sense.