Interfacing to PT1000 w/ limited range of interest
hi all,
im not sure if right forum, seemed closest match.
i want interface arduino pt1000 rtd temperature sensor. range of interest 85c 95c corresponds 1328 ohms 1366 ohms.
i have breadboarded circuit , using 25 ohm variable resistor simulate rtd sensor.
so, reading "sensor" value, performing operation on range of values interested in , serially outputting pc. , working.....
but getting integer values, whereas want 0.1 resolution.
is possible serial output?
later interfacing lcd, maybe can on lcd?
here code....
any advice appreciated!
im not sure if right forum, seemed closest match.
i want interface arduino pt1000 rtd temperature sensor. range of interest 85c 95c corresponds 1328 ohms 1366 ohms.
i have breadboarded circuit , using 25 ohm variable resistor simulate rtd sensor.
so, reading "sensor" value, performing operation on range of values interested in , serially outputting pc. , working.....
but getting integer values, whereas want 0.1 resolution.
is possible serial output?
later interfacing lcd, maybe can on lcd?
here code....
code: [select]
/*
rtd analog input
read value of rtd/pot, save
variable, calculate temp
circuit:
* wheatstone bridge feeds diff amp attached analog input 0
*/
int sensorvalue = 0; // variable store value coming sensor
int tempvalue = 0; // variable store calculated temp
void setup() {
serial.begin(9600);
}
void loop() {
// read value sensor:
int sensorvalue = analogread(0);
tempvalue = ((sensorvalue-225)/54)+85;
serial.println(tempvalue);
delay(10);
}
any advice appreciated!

you're being bitten "integer division". in c++ 150/54 (for example) 2. not 2.777 or 2.8 2. expression ((sensorvalue-225)/54) loses lot of precision.
you can try using floats or doubles work real numbers prior converting integer:
adding real number forces real-number computation, , final result converted integer when write result tempvalue.
--
the gadget shield: accelerometer, rgb led, ir transmit/receive, light sensor, potentiometers, pushbuttons
you can try using floats or doubles work real numbers prior converting integer:
code: [select]
tempvalue = ((sensorvalue-225.0)/54)+85;adding real number forces real-number computation, , final result converted integer when write result tempvalue.
--
the gadget shield: accelerometer, rgb led, ir transmit/receive, light sensor, potentiometers, pushbuttons
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Interfacing to PT1000 w/ limited range of interest
arduino
Comments
Post a Comment