Go Down

Topic: kty 10 linear (Read 1 time) previous topic - next topic

ogvito

Jun 17, 2010, 04:15 pm Last Edit: Jun 18, 2010, 08:34 am by ogvito Reason: 1
hy everyone!
I am trying to make a temperature sensor and linearise it,...
I hope You uderstand what I mean... I am not yet familiar with the whole terminologie :( but I am working on it :)
I want to make a temperature sensor with kty 10 and arduino, wich will give me a reading in celsius on a 8x2 LCD display.
I want to do it, but I cant get the math.h library to work...
it wont turn red when I try to include it, and I have no way of knowing if I put in the equation coretly... using sqr, and rt functions is crutial if I want a linear masuremant, right?

any help from you good people would much apriciated :)

vito (thats my name :))

ogvito

#1
Jun 18, 2010, 08:28 am Last Edit: Jun 18, 2010, 08:34 am by ogvito Reason: 1
THIS IS WHAT I HAVE SO FAR, BUT IT IS NOWHERE NEAR CLOSE TO MY GOAL...


#include <LiquidCrystal.h>

double vrednost = 0;
int backLight = 13; //pin 13 nadzor osvetlitve zaslona (control of display backlight)
LiquidCrystal lcd(10,11,12,13,14,15,16);
int analogPin=4;
int analogValue = 0;
float napetost = 0; //napetost = voltage

void setup()
{
 Serial.begin(9600);
 pinMode(backLight, OUTPUT);
 digitalWrite(backLight,HIGH);
 lcd.begin(2,16);
 lcd.clear();
 
}

void loop()
{
 analogValue = analogRead(analogPin);
 napetost = analogValue * 1023 / 8 / 150; //napetost = VOLTAGE, and I need to put in the equation wich linearises the reading, but am not shure how to do it
 Serial.print(napetost); //napetost = voltage
 Serial.println("C");
 lcd.clear();
 lcd.setCursor(1,0);
 lcd.print(napetost);
   lcd.setCursor(1,1);
 lcd.print("stopinj C"); //STOPINJ = DEGREES CELSIUS
 
 delay(100);
 
}

laxman

I am trying to make a temperature sensor and linearise it,.

Go Up