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):
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.
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.)