Go Down

Topic: DUE pins always reading HIGH (Read 667 times) previous topic - next topic

MittenMuffins

Hey everyone,

I just purchased the DUE for a project and I've been having nothing but issues.

First off, if I do an analog read on any of the A pins without anything connected, it gives me serial values that fluctuate anywhere between 22 and 300. I'm not sure if this is a noise issue or what...

Secondly, using this code without anything connected, it will always give me a HIGH value with serial read.
Code: [Select]
void setup() {
  pinMode (22, INPUT);      //just a random pin, tried a handful already, same results
  Serial.begin(9600);

}

void loop() {

    Serial.println(digitalRead(22));
    delay(500);
 
}


I've been searching for 2 days now to find an answer to this. Is there a problem with the board itself, or am I missing something?

Thanks!

AWOL

Quote
Secondly, using this code without anything connected, it will always give me a HIGH

If you've got nothing connected, what did you expect to read?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

MittenMuffins

Quote
If you've got nothing connected, what did you expect to read?


Forgive me, I'm still new at this. I expected it to read 0, but I assume that a pull down connected would solve it. :smiley-red:

Will pull-downs also solve the weird analog readings?


MarkT

Why read a pin that's not connected to anything and then worry about it?

INPUT pins float (unless internal pullups are engaged), that's because they are
effectively open-circuit and respond to any nearby fields.

This is nothing Due or even Arduino specific, all CMOS inputs are like this, inputs
connect only to MOSFET gates and MOSFET gates are insulated by silicon dioxide
which is a phenomenally good insulator.
[ I won't respond to messages, use the forum please ]

Go Up