Analog I/O Port Interference

Hey guys, I'm new to the world of micro controllers and circuits and I've been having some problems with my Arduino Uno, I'm getting tons of interference with the analog I/O ports from static and such when I'm trying to read input voltage, is there any reliable way to fix this? I've considered getting a breadboard, but that will take a few days yet, is there anything else? Will a breadboard even help?

The impedance of an input of the Arduino has a very high impedance. If nothing is connected to the input, you get lots of noise. Rule of thumb is to connect an analog signal with a maximum of 10k impedance (output impedance of the analog circuit that is) to an analog input of the Arduino.

Erdin's 100% correct. If the ADC pins are floating, you just read garbage. ADC channels not being used are best pulled to ground with a resistor, eg 10K.

oric_dan: Erdin's 100% correct. If the ADC pins are floating, you just read garbage. ADC channels not being used are best pulled to ground with a resistor, eg 10K.

Isn't it enough to just not read the analog pins that have nothing wired to them? :D

They won't effect the reading of analog pins that do have stuff properly wired to them.

Lefty

retrolefty:

oric_dan: Erdin's 100% correct. If the ADC pins are floating, you just read garbage. ADC channels not being used are best pulled to ground with a resistor, eg 10K.

Isn't it enough to just not read the analog pins that have nothing wired to them? :D

They won't effect the reading of analog pins that do have stuff properly wired to them.

Lefty

Considering they all share the same Sample-and-Hold buffer and actual ADC sampling hardware, then yes, they can affect the other channels. Anything left over in the S&H capacitor from the previously scanned (but unconnected) input could have an adverse affect. A 10K resistor to ground helps to stabilise the contents of the S&H buffer by bleeding any charge off to ground.

Or that's the theory anyway.

It all depends, of course, on how the Arduino configures the ADC, and whether it actively scans channels that aren't being read, etc. Forcing an analogue input pin to be a digital input is also a good way of isolating it. Do a digitalRead() on each of the un-used analogue pins, and they will be switched into digital mode, isolating the ADC hardware from those pins. Again, they should then be pulled down to ground to stop them floating and causing excess current drain from the internal logic constantly flipping states.

retrolefty:

oric_dan: Erdin's 100% correct. If the ADC pins are floating, you just read garbage. ADC channels not being used are best pulled to ground with a resistor, eg 10K.

Isn't it enough to just not read the analog pins that have nothing wired to them? :D

They won't effect the reading of analog pins that do have stuff properly wired to them.

Lefty

Yeah, I'm probably one of the few guys around here that thinks unused input pins should be terminated. Well, except for these guys,

14.2.6 Unconnected Pins

If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, float- ing inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).

The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up. In this case, the pull-up will be disabled during reset. If low power consumption during reset is important, it is recommended to use an external pull-up or pull-down. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output.

They do mention digital pins, so maybe analog pins don't care. [!!!]