Pages: [1]   Go Down
Author Topic: kty 10 linearisation  (Read 880 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad but I am working on it smiley
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 smiley

vito (thats my name smiley)
« Last Edit: June 21, 2010, 04:54:52 am by ogvito » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: