I have an Arduino Nano. No pins have connections except for two, the 5V pin connects directly to any one of the analog pins, A0-A7, through a jumper wire. In my loop, I use AnalogRead() to read the values of A0 through A7. I print() these values to the Serial Monitor. When I disconnect the jumper, all three values read about 170. When I attach the jumper from 5V to any of the seven pins (A0-A7), then all 7 values (A0-A7) jump up to over 900. But I do notice that the pin which has the jumper has a value of 1023.
I would have expected this to happen only to the pin that I connected the jumper to.
Another thing that is strange is that when connecting the 5V to pin A0 or A1, the loop seems to continue, but when I connect it to A2-A7, the loop seems to freeze until I disconnect it.
What am I doing wrong? I need to be able to detect when each of the analog pins have voltage applied to them. Is the Nano faulty? Or is the programmer (me) faulty?
My project needs to determine when each of the 8 pins have a voltage applied, independently.
First, terminate all the Analog Channels/Pins (A0 - A7) to GND through 8x4.7 k pull-down resistors in order to prevent the pins from being into float states.
Very interesting! I need clarification, though. Are you saying that I need to terminate all the UNUSED pins? Or that all of my analog pins need to have a 4.7k resistor regardless?
Mark
1. After power up, all IO pins of NANO except A6, A7 come up as "input digital lines". A6 and A7 are always "input analog lines".
2. If the lines are not terminated by external pull-down resistors, then they are termed as "input floating lines" and may assume any logic level by picking up the environmental electrical "noise signal".
3. A0 to A5 lines become "input analog lines" when the the following code is executed: