Arduino Uno Analog Pins

Hi All,

My analog pins are not floating when not connected.

using analogRead(A0) I continuously get a read out of 14

similar on A1 I get a read out of 15 and so on.

If i connect to ground, it stays at 14 and does not go to zero. Am I making a mistake or is it broken?

Thanks!

Hello,

please post your code and we will tell you where the mistake was made. Running blind, I will assume that you aren't reading A0 or A1 at all but have discovered that the built in Definition for A0 is pin 14.

Django_87:
Hi All,

My analog pins are not floating when not connected.

using analogRead(A0) I continuously get a read out of 14

similar on A1 I get a read out of 15 and so on.

If i connect to ground, it stays at 14 and does not go to zero. Am I making a mistake or is it broken?

Thanks!

Assuming you are just doing an analogRead() and then printing the results,
Run this example

Then there are a number of other reasons why the value may not be zero when all of the analog pins are grounded (lift only the single pin you wish to measure.

The No. 1 reason for strange analog values is your DC voltage going to the UNO is 'not clean' ... that is, perhaps the use of a power transformer that is putting out too much AC ripple. Even a PC USB port can sometimes be a problem is the voltage drops too far below 5.0V

Other issues may be AC and RF radiation in the immediate prototyping/test area. Such things as a nearby cellphone, a TV/Video monitor or even those personal fans that sit on the desk.

Essentially any RF or magnetic fields around your test board can be a problem. If you have had your uC chip out of the socket, did it get re-inserted without any bent pins?

Ray

You might have code that is basically the same as this bad counterexample

#define AnalogPin A0
void setup() { Serial.begin(9600); }
void loop() {

   analogRead(AnalogPin);
   Serial.println(AnalogPin);

   delay(500);
}

This should behave exactly as you describe your issue.
Be happy: nothing is broken, nothing is wrong.
Compare carefully with other examples, see and understand the difference