Problem with reading 0-12v potentiometer with analog input

Hi, I have a simple circuit where I need to read the values of a 12v potentiometer on my Arduino. I made a resistor divider using a 10k & 4.7k ohm resistors to limit the voltage to around 4v.

Using a multimeter, I can see that the output voltage changes and is within range (0 - 4v) as expected. But when the output is connected into my Arduino's A0 input, I don't get expected results (code below).

The output is always similar to (and does not respond to changing the resistance in the potentiometer):

1023
1023
0
288
1023
0
0
1023
1023
0
265
1023
0
0
1023
1023
0
258
1023
0
0
1023
1023
0
250
1023
0
0
979

The code I'm using is as simple as possible:

int reading = 0;
int inputPin = A0;

void setup() {
Serial.begin(9600);
}

void loop() {
reading = analogRead(inputPin);
Serial.println(reading);
delay(2);
}

Any idea why I'm getting this strange output? It seems to completely ignore my potentiometer although my multimeter shows expected voltage.

Your description says A0, your code says A5.

Whoops, that's actually a typo in my code. I am using A0 as the input currently. I've actually tried both wondering if my A0 input was broken but I get the same result using any analog input.

Are the grounds connected together?

And keep in mind, if the resistor divider is in the same order as the pot itself you don't have a linear curve.

They are connected together. I've tried sending the ground behind the resistor divider to the Arduino's ground and the 12v's ground. The serial output listed above is when the ground is connected to the 12v circuit. When I connect it to the Arduino I only get 0's printed. I am quite the beginner at this so I could be misunderstanding how to set something up.

With the multimeter, check the voltage between the Arduino's analog input and the Arduino's ground. I'm pretty sure the voltage you are measuring at the "output" of your pot/voltage divider is not the voltage the Arduino is seeing.

And, it would help if you show us a schematic. (You can hand-draw and scan it if you don't have the tools for making a schematic on your computer.)