I have an arduino set up and programmed to take analog input but for some reason, when one changes, the other changes as well. I've tried changing around which inputs I use and a number of other random things, but nothing seems to help.
Does anyone have any idea why this would happen or how to stop it?
Does anyone have any idea why this would happen or how to stop it?
If there is nothing wired to a analog input pin, it will be in a 'floating' condition and just read noise and it's value can be effected by adjacent analog input pins that are wired and being used. There is no real problem with this, but you could wire pull-down resistors to quite them down, or program them to be digital output pins.
Now if the pins are wired to something and you are seeing values change based on other inputs then that is something else. I would have to see the external wiring in that event.
I would consider an analog to digital converter as a "capacitor", which charges to the input voltage for the digitization. Since we're using micro controllers, we only have one such digitizer and all input pins share it with a multiplexer. Say input one has a voltage 4V and the digitizer "capacitor" has been charged up to 4V as a result. Then you switch to input 2 that has nothing connected to it. It will have no way to get rid of the charges on the capacitor so the digitization is still 4V. Hope this analogy helps understanding.
No, the sample-and-hold capacitor is not connected to the pins! Its just cross-talk due to the 1 or 2pF between the pins - MOSFET input stages are 10,000Mohms or more so this tiny capacitance can drive them easily.
That's the typical minimum input impedance (DC) of CMOS logic, in practice the resistance of the packaging and board will dominate - SiO2 is pretty much a perfect insulator. In practice protection circuitry may reduce it, but for practical purposes you can think of it as a perfect insulator.