LM35 No temp read out

Hello,

I recieved my 1st Arduino today and i have tested it with the LM35 Temp sensor.

I have uploaded this code:

float temp; int tempPin = 0; void setup() { Serial.begin(9600); } void loop() { temp = analogRead(tempPin); temp = temp * 0.48828125; Serial.print(“TEMPRATURE = “); Serial.print(temp); Serial.print(”*C”); Serial.println(); delay(1000); }

It says upload complete.

When i click on the Serial Monitor i get no temp read outs.

The orange LED is constanly ON.

The LM35 works fine as i get a read out on my DVM.

I have the output pin to A0 on the board.

Do use code tags and format your code so it's readable (the IDE can be told to fix the line formatting, which in and of itself is helpful in finding bugs with incorrect nesting)

float temp;
int tempPin = 0; 
void setup() { 
  Serial.begin(9600); 
} 
void loop() {
  temp = analogRead(tempPin); 
  temp = temp * 0.48828125; 
  Serial.print("TEMPERATURE = "); 
  Serial.print(temp); 
  Serial.print("*C"); 
  Serial.println(); 
  delay(1000); 
}

I don't see the problem...

 //int tempPin = 0;
int tempPin = A0;

Pin 0 is the Serial RX pin.

Welcome to the forum. Learn how to post your code using the code tags </> icon in the tool bar. You will bring up the word code twice within brackets, and you place your code between the two words.

Also, your code should have individual statements on different lines. The next time you post, your code should look like this

float temp;
int tempPin = 0;
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  temp = analogRead(tempPin);
  temp = temp * 0.48828125;
  Serial.print("TEMPRATURE = ");
  Serial.print(temp);
  Serial.print("*C");
  Serial.println();
  delay(1000);
}

Still dosnt seem to work, i have copied your code.

I get this error see attched image, what does this mean?

See attached

Delete the first line. You have defined setup twice

if you are still stuck try the example in this link

http://wiki.epalsite.com/index.php?title=Starter_Kit_for_Arduino#Lesson_20_Temperature_Measurement

Thanks for the replies.

All sorted now :-)

Hi, To help others, what was the problem and how did you fix it?

Tom.... :)