Go Down

Topic: kty 10 linearisation (Read 942 times) previous topic - next topic

ogvito

Jun 21, 2010, 11:15 am Last Edit: Jun 21, 2010, 11:54 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?

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);

}

any help from you good people would much apriciated :)

vito (thats my name :))

PaulS

There needs to be a keywords.txt file accompanying any Arduino specific library, with the appropriate entry to make the include line turn red. The math.h file is not Arduino-specific, so it will not turn red.

You know that you put the equation in in a way that is syntactically correct if the program compiles. You know that you put the equation in in a way that is logically correct if the program then produces valid results,

ogvito

first of, thank you!
so if I understand this right, math.h will not turn red even if I put it in corectly?
can you show me what you mean with keywords.txt, pleese.
and how do you think I should put and wich formula in the equation?

THANK YOU

PaulS

Quote
so if I understand this right, math.h will not turn red even if I put it in corectly?


Correct.

Quote
can you show me what you mean with keywords.txt, pleese.


http://arduino.cc/en/Hacking/LibraryTutorial would be a good place to start if you are developing a library. If you are just using a library, you don't need to know how other people develop keywords.txt files.

Every library comes with a keywords.txt file. Feel free to browse some of them.

Quote
how do you think I should put and wich formula in the equation?


Start with the data sheet for your sensor...

ogvito

THANK YOU!!!
I`ll get right on it, and I`ll let you know what is the result.

Go Up