Hey guys,
I purchased perfboard, solder and a Hakko 888. I've soldered everything together, but still no dice. Removed all of the analogReference calls, using 5 volt reference again. Arduino reads 4.99v on it's own 5v reference without voltage divider, and (11 ADC) 3.60v going through the divider.
Picture of the board I've soldered is attached, and amended code posted.
Before this, I tried 10k and 220 ohm resistors on the breadboard, with the same problem. Very funny, skewed readings. I'm not one to give up, but this just seems to be unattainable for me.
#define ANALOG_INPUT A2
#define ANALOG_RESOLUTION 1024.0
#define VREF 5
#define R1 1000000.0
#define R2 8200.0
const float voltageDividerRatio = (R2 / (R1 + R2));
void setup() {
Serial.begin(9600);
pinMode(ANALOG_INPUT, INPUT);
}
void loop() {
float vout = (analogRead(ANALOG_INPUT) * VREF) / ANALOG_RESOLUTION;
float vin = vout / voltageDividerRatio;
Serial.print(analogRead(ANALOG_INPUT), 3);
Serial.print(" ");
Serial.print(vout, 3);
Serial.print(" ");
Serial.print(vin, 3);
Serial.println();
delay (1000);
}