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).
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.
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.
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.
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
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.