Newbie Here
I'm having trouble with an LM35 temperature sensor. The serial read is ouputting the temperature as being ~416C and ~782 F. I have used multiple sketches for the sensor on the internet and it keeps outputting the same temperatures. Could it be the the temp sensor is malfunctioning? Or have I missed something with my setup? Much regards, TheFoofinator.
(UPDATE): Testing the output Voltage reads 4.16V, and Input is 4.98V.
(I am new to this site, so I have supplied the images as Attached files, as I have no image sharing website to store the images).
Sketch:
int outputpin= 0;
//this sets the ground pin to LOW and the input voltage pin to high
void setup()
{
Serial.begin(9600);
}
//main loop
void loop()
{
int rawvoltage= analogRead(outputpin);
float millivolts= (rawvoltage/1024.0) * 5000;
float celsius= millivolts/10;
Serial.print(celsius);
Serial.print(" degrees Celsius, ");
Serial.print((celsius * 9)/5 + 32);
Serial.println(" degrees Fahrenheit");
delay(100);
}
![IMG_20140903_192800[1].jpg](https://europe1.discourse-cdn.com/arduino/original/3X/3/3/334b23843be92c118dbfe33bffc2175d3632bc85.jpg)
