Arduino temperature sensor counting back

I am trying to get my new velleman vma320 to work with my arduino. It doensn't work at all, the temperature goes down its heated up. I've tried everything. Can somebody help me? Here is my code...

int SensorPin = A0;

void setup() {

  Serial.begin(9600);

}

void loop() {

  //reading
  int sensorvalue = analogRead(SensorPin);
  Serial.print("value: ");
  Serial.print(sensorvalue);

  //voltage
  float voltage = sensorvalue * 5.0;
  voltage /= 1024.0;
  Serial.print(", volts: ");
  Serial.print(voltage); 

  //temperature
  float temperature = (voltage - 0.5) * 100 ;
  Serial.print(" degrees C");
  Serial.println(temperature);

}

Is it something I have done wrong? Or is it just the sensor? I tried it with two sensors.

If you can help me that would be awesome.

Thanks in advance, Jens Van den Eede.

@Charlie125, the Introductory Tutorials section is where you GIVE advice to people, not where you SEEK advice. It says very clearly
I'M SERIOUS - DON'T PUT YOUR QUESTIONS HERE
and
PLEASE DON'T POST YOUR QUESTIONS IN THIS TUTORIAL SECTION

...R

I am trying to get my new velleman vma320 to work with my arduino.

Do you think that it might have been a good idea to post a link to the hardware you are trying to use?

Why do you think that temperature and voltage are in a linear relationship? I'd be very surprised if the sensor couldn't measure a temperature of -10C.

Hi,
Welcome to the forum, thanks for putting your code in code tags.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Can you please post a link to data/spec of the Velleman VMA320 please?

Thanks.. Tom.. :slight_smile: