Small or no read input on pins A5,A4 and A3

Hi all,
im still testing my self made arduino board and wondered about the analog in pins. I followed the "AnalogReadSerial" Example but wondered that i wont get the same values on pins A3,A4,A5 (arround 0..2) then on the other three pins A0,A1,A2(arround 0..1024).
Is that a normal behaviour ?
I tested this with...

void setup() {  Serial.begin(9600); }

void loop() {
  int sensorValueA0 = analogRead(A0);delay(1);       
  int sensorValueA1 = analogRead(A1);delay(1);       
  int sensorValueA2 = analogRead(A2);delay(1);       
  int sensorValueA3 = analogRead(A3);delay(1);       
  int sensorValueA4 = analogRead(A4);delay(1);       
  int sensorValueA5 = analogRead(A5);delay(1);       
  Serial.print(sensorValueA0);Serial.print(" ");
  Serial.print(sensorValueA1);Serial.print(" ");
  Serial.print(sensorValueA2);Serial.print(" ");
  Serial.print(sensorValueA3);Serial.print(" ");
  Serial.print(sensorValueA4);Serial.print(" ");
  Serial.println(sensorValueA5);    
}

On the serial monitor runs...

(..)
240 295 400 1 0 0
(..)

Maybe the last three pins are broken or sth :frowning: . However a decleration with pinMode( ..., OUTPUT); and digitalWrite on those pins (A0..A5) works fine.

Thanks & Greetings,
MosFett

Unless some valid signal is wired to a analog input pin, reading it's value is meaningless as all your measuring is pin noise and random capacitance coupled crosstalk voltages. Ground all the analog pins and then run your sketch, see if they differ.

With A0..A4 on GND and A5 on the poti i get zeros only, if i "open" or "close" the poti doesnt matter :frowning: on pin A0 it works fine.

Sounds like you may have blown the ADC MUX to me...

MosFett:
With A0..A4 on GND and A5 on the poti i get zeros only, if i "open" or "close" the poti doesnt matter :frowning: on pin A0 it works fine.

No idea how you've wired A5 - a diagram please.

The way to test analog inputs is to connect each input to GND, it should read 0,
then connect it to 3V3 rail and it should read about 670. Repeat for each input.

If an analog isn't connected the voltage read on it is essentially meaningless, ignore it.

Like i said, i followed this example ( http://arduino.cc/en/Tutorial/ReadAnalogVoltage ), but changed it in that way, that now the poti is connected to pin A5 and all the other pins (A0..A4) are connected to GND.
I fear majenko is right :S

MosFett:
Like i said, i followed this example ( http://arduino.cc/en/Tutorial/ReadAnalogVoltage ), but changed it in that way, that now the poti is connected to pin A5 and all the other pins (A0..A4) are connected to GND.
I fear majenko is right :S

Majenko is always right ]:smiley:

You got a spare? You should always have a spare... At last count I had 19 of different makes and styles, not counting my own...

At least you should have a spare chip to hand :stuck_out_tongue:

You want to hear something funny :slight_smile: ?
I drilled that shitty that the chip socket didnt fit so i simply soldered the 168 directly to the board xD

And now ... GRnmbl stupidself -.-

Now im building another board with a 328 AND a socket

This is a home-build? Then maybe it's the board that's at fault, not the chip?

Thats why i checked the connection with those A0..A5 pins in OUTPUT mode with digitalWrite, with LEDs they are all on.That says at least that the connection is ok :. .

Yep. Sounds reasonable.

Try checking them as a digital input as well, see if that works. If it does, but you're still not getting analogRead() working on just some pins then I would suspect the ADC front-end MUX.

Hmm... digitalRead works on A0..A3, A4 and A5 dont answer.

MosFett:
Hmm... digitalRead works on A0..A3, A4 and A5 dont answer.

Check for resistance between pins and ground. It could be a partial short that isn't low enough resistance to stop digitalWrite but low enough to pull the pin down when in input mode.

ohh.. ahm i dont know exactly what u mean with your last post :drooling_face:

Just a wild stab in the dark, which if a direct connection to 5V or 3.3v doesn't yeild a positive result is highly unlikely to be the case.

I suspect, since the output works, but neither digital nor analog inputs work, that the IO ports may have been blown (maybe by excess heat?) at point A on this block diagram. That is the only point common to both inputs but not the output. I was hoping the ADC feed would be connected to the other side of the SLEEP block, as that would be an active part that could be crippled in many ways, but alas not.

Hmm... digitalRead works on A0..A3, A4 and A5 dont answer.

I've heard this before try reading each analog pin twice and only using the second value.

Mark

Ah that makes sense
Thx for the response. I ll try and test it vs. the 328 tomorrow.

I've heard this before try reading each analog pin twice and only using the second value.

That only cures the problem with too high an input impedance on the pins.

thx holmes but that didnt work :slight_smile: