Ethernet Shield and analog input

Hi, I have a new Arduino UNO with Ethernet Shiled w5100. I have attached a lcd display and it works fine; also I can access to the shield via web browser.
However, any analog input (with shield inserted) have the maximum values (5v), With or without something attached. If I left the shiled, anything works (I can read correctly the analog values).

Can you help me, please?

Thanks a lot, Roberto.

Some ethernet shields use analog pins for the SD card slot, I think they are pins A0 and A1. One is "write protect" and the other is "card present". Try the other analog pins and see if that is your problem.

1 Like

Thanks for the reply, but ALL analog inputs are at the max value, not only A0 and A1.

Please post a link the the ethernet shield you are using.

Do your analog inputs have any thing connected or are they floating?

They are floating, but don't work even if I connected something. All analog input are stable at 1023.

The only thing I can think of that would affect all the analog pins is the AREF pin. It is the pin on the Arduino two above D13, next to a GND pin. Try bending that pin on the ethernet shield so it doesn't insert into the AREF socket on the Arduino.

That would be my last guess.

They are floating, but don't work even if I connected something. All analog input are stable at 1023.

Connect the pins to ground and see if they are still reading 1023. What type of device/gizmo do you want to connect to the pins?

Hi, I have solved (I think) without the AREF pin of the shield. Now the analog pins have floating values if anything is attached. But, what's the problem? What change with or without the AREF pin?
I have to connect the LM35 sensor temperature.

Thanks!

If the AREF pin is grounded, that would result in the result always being 1023. The AREF pin is used to determine the maximum value of the analog conversion, so if AREF is zero volts, all conversions would result in the 1023 value.

What does the AREF pin have to do with the LM35? Does it require an analog conversion using an external voltage reference?

Hi, this is the function that I use to read the analog value from LM35:

double readLM35Temp(){
double temp = 0.0
int val = 0; //[0..1023]
int nread = 20;
double somma = 0.0;

for (int i=0; i<nread; i++){
val = analogRead( LM35PIN ); // legge il dato convertito della tensione sul pin LM35PIN
temp = ( 100.0 * 1.1 * val ) / 1024.0; // Vref=1,1V (riferimento interno)
somma += temp; // lo aggiunge alla somma delle temperature lette
delay( 50 ); // aspetta 50ms
}
return ( somma / nread ); // restituisce la temperatura media

}

I don't know if the AREF pin is used or not...

If there is no connection required to the AREF pin and no call to analogReference(EXTERNAL), then it isn't used.

Ok, in the sketch I have analogReference( INTERNAL ).
But why AREF with the ethernet shiled modify the analog inputs? It's a shield problem?
Thanks

It would appear that the shield has that AREF pin grounded by mistake. That would be a shield fault. If it is grounded and not set to EXTERNAL, it could damage the internal AREF supply if you left that shield pin connected to the Arduino. You will be ok as long as you leave that pin disconnected.