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.