Multi Sensor LM35

Dear all

Please, I need help
I want to use five Lm35 temperature sensors in my project because it is available for me.
here is the arduino program used and the fritzing sketch.

list of component
1- Arduino Uno
2- LM35 sensor * 05
3- Capacitor (100 nF) * 05

The results I obtained are very incoherent.
but The results obtained with one sensor are good and stables

Please, I need help.

===============================================================================

#define Ambient 0
#define Glass 1
#define Backsheet 2
#define Outlet 3
#define Room 4
#define Delay 100
const int cycles = 20;

void setup(){
Serial.begin(9600);
Serial.println(“CLEARDATA”);
Serial.println(“LABEL,Temps,T_amb (C),T_glass (C),T_backsheet (C),T_outlet (C),T_room (C)”);
}

void loop(){
float T_amb = 0.0;
float T_glass = 0.0;
float T_backsheet = 0.0;
float T_outlet = 0.0;
float T_room = 0.0;

for(int i = 0; i < cycles; i++){
int Ambient_Value = analogRead(Ambient);
int Glass_Value = analogRead(Glass);
int Backsheet_Value = analogRead(Backsheet);
int Outlet_Value = analogRead(Outlet);
int Room_Value = analogRead(Room);

float Temp_Ambient = (5.0 * 100.0 * Ambient_Value) / 1023;
float Temp_Glass = (5.0 * 100.0 * Glass_Value) / 1023;
float Temp_Backsheet = (5.0 * 100.0 * Backsheet_Value) / 1023;
float Temp_Outlet = (5.0 * 100.0 * Outlet_Value) / 1023;
float Temp_Room = (5.0 * 100.0 * Room_Value) / 1023;

T_amb += Temp_Ambient;
T_glass += Temp_Glass;
T_backsheet += Temp_Backsheet;
T_outlet += Temp_Outlet;
T_room += Temp_Room;

delay(Delay);
}
T_amb /= cycles;
T_glass /= cycles;
T_backsheet /= cycles;
T_outlet /= cycles;
T_room /= cycles;

Serial.print(“DATA,TIME,”);
Serial.print(T_amb);
Serial.print(" “);
Serial.print(T_glass);
Serial.print(” “);
Serial.print(T_backsheet);
Serial.print(” “);
Serial.print(T_outlet);
Serial.print(” ");
Serial.println(T_room);
}

===============================================================================

I would try taking 2 analog reads for each sensor. Ignore the first read and record the second. This will let the input capacitance of the analog input settle between channel changes.

    int dummy = analogRead(Ambient); 
    int Ambient_Value = analogRead(Ambient);
    dummy = analogRead(Glass);                                                  
    int Glass_Value = analogRead(Glass);
    dummy = analogRead(Backsheet); 
    int Backsheet_Value = analogRead(Backsheet);
    dummy = analogRead(Outlet); 
    int Outlet_Value = analogRead(Outlet);
    dummy = analogRead(Room); 
    int Room_Value = analogRead(Room);

You mention 0.1uf (100nf) caps. They are missing from the diagram, where are they?

Thanks groundFungus.

Sorry for the wrong .jpg file attached
Here is the new one.

groundFungus: I would try taking 2 analog reads for each sensor. Ignore the first read and record the second. This will let the input capacitance of the analog input settle between channel changes.

This is definitely not needed, the LM35 output impedance is an ohm or so, well below the 10k limit above which crosstalk can become an issue.

Ekoe_Aloys: The results I obtained are very incoherent.

Perhaps you should actually describe what the results actually are, we sort of need to know this...

BTW its normal to use a load resistor with the sensor, though I don't know it that's important here.

what pinnumbers are in use it should be A0 or 14, A1 or 15 etc. for stabilty read every sensor double so radanlog and line below again, so the analog channel is on its value.

shooter: what pinnumbers are in use it should be A0 or 14, A1 or 15 etc. for stabilty read every sensor double so radanlog

No, the LM35 has a low output impedance, this double reading is completely unnecessary, I've explained this already. Please stop spreading this myth if you don't understand the issue. Any signal source of 10k impedance or less will read perfectly fine with just one call to analogRead after switching pins. Only for higher imput impedances will switching pins allow for detectable cross-talk via the ADC sample capacitor.

Just a quick thought - do you have long cables (more than a foot or so)? If so can you describe how they are wired and how long. Do they run near any mains wiring?