Problem with LM35

Hello,
I'm actually in a school project and I have a problem with my temperature sensor (LM35).
I use a bread board to wire my LM35.
The LM35 is wired to the Arduino (5V to the left pin, Analog pin to the mid pin, GND to the right pin).
The goal of my project is to show the temperature on a LCD display to the users.
So I used a power supply to heat the sensor(to see if my program works). The power supply is linked to the left pin of the LM35 sensor.
When i check if the voltage at the left pin of the LM35 sensor, the voltage is accurate, the voltage that i get is the voltage that the supply voltage plus the Arduino offers, till that everything is fine.
Whereas when I check my program the temperature does not change when I do change the voltage in my power supply.
My program:

float temp;
int tempPin = A0;
void setup()
{
Serial.begin(9600);
}

void loop()
{
temp = analogRead(tempPin);
finaltemp = temp * (Supply voltage * 1000 / 1024) / 10)
/*

We get the actual voltage by doing: Supply voltage / 1024.

We multiply by 1000 to convert Volt to milliVolt.
10 is constant, 10 mV correspond to 1°C
*/
Serial.print("The temperature is ");
Serial.print(finaltemp);
Serial.print("*C.");
Serial.println();
Serial.print("Good road ! ");
Serial.println();
Serial.print("--------------------------");
Serial.println();
delay(10000);

(this is not the complete program, in the latest I've done i get the Supply voltage by measuring the voltage at the left pin of the LM35)
I'd like to know if you've any idea or advice to help me in this problem.

Thanks and sorry for my english :slight_smile:

thewarfr:
So I used a power supply to heat the sensor(to see if my program works). The power supply is linked to the left pin of the LM35 sensor.

Show a diagram of what you have connected as it appears you have no idea about how the sensor works.
It absorbs heat through the body of the device, applying an additional voltage to "heat it up" will certainly blow things up somewhere.

Did you define the variables Supplyvoltage and finaltemp?

Is that a space in Supplyvoltage? Spaces are not allowed in variable names.

So I used a power supply to heat the sensor(to see if my program works).

How about a hair dryer? And, maybe ice water and boiling water to check the calibration? (You'd need to waterproof it if you use water.)

The power supply is linked to the left pin of the LM35 sensor.

Bonjour le STI2D.
C’est pas bien de mélanger les fils de masse avec un Lm35 il lui faut un fil de masse rien qu’à lui.

LM35 Ground wire doesn’t be connected to any other ground path but directly from the LM35 to the arduino.

I think that the subject is for the French bacalauréat section STI2D. Sorry if I mistake.
When it is for an exam in french section we help but we absolutely don’t make.