Temperature sensor not working


hi,
i have issue analogue temperature sensor. velleman vma320.
i have used code provided bellow , if apply heat, temperature goes down. have tried in multiple ways , used 2 sensor compare it. can't seem figure out.

this 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 possible sensor doesn't work properly? or code?

if can me awesome.

thanks in advance,
jens van den eede.

according way it's wired, voltage go down temperature goes up, , it's not linear.

look ntc formulas, b-coefficient formula.


Arduino Forum > Using Arduino > Sensors > Temperature sensor not working


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts