kuro_ng
Newbie level 6
alright. I will hook it up now and post result. Thanks FvM.
---------- Post added at 18:10 ---------- Previous post was at 16:35 ----------
hi FvM
I got them hook up and using this code to embeded to my arduino
unsigned long now;
unsigned long lastSample;
unsigned int sampleSize;
unsigned int highCount;
unsigned long lastOutput;
float temperature;
float hcf, ssf;
int sensorPin = 2;
void setup()
{
Serial.begin(9600);
Serial.println("HELLO!");
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, LOW);
lastSample = 0;
sampleSize = 0;
highCount = 0;
lastOutput = 0;
temperature = 0;
}
void loop()
{
now = micros();
if (now - lastOutput > 500000) {
hcf = highCount;
ssf = sampleSize;
temperature = ((hcf / ssf) -0.32)/0.0047;// convert step to temperature
Serial.print(highCount);
Serial.print(" / ");
Serial.print(sampleSize);
Serial.print(" temp: ");
Serial.println(temperature);
lastOutput = now;
sampleSize = 0;
highCount = 0;
}
if (now - lastSample > 100) {
sampleSize++;
highCount = highCount + digitalRead(sensorPin);
lastSample = now;
} else {
delayMicroseconds(10);
}
}
the temperature come out, but keep jump insanely like other diagrams, it even reduce voltage when I move my hand over. I use the fesnel lens and tube to lead IR rays but doesn't help.
temperature I got from thermistor is 1.817 V and doesn't change no matter I do with hot or cold items.
the output of thermopile .7 some thing V. it does change to .9 when I move my hand over.
I still dont know what I do wrong. Do you have any idea?
---------- Post added at 18:10 ---------- Previous post was at 16:35 ----------
hi FvM
I got them hook up and using this code to embeded to my arduino
unsigned long now;
unsigned long lastSample;
unsigned int sampleSize;
unsigned int highCount;
unsigned long lastOutput;
float temperature;
float hcf, ssf;
int sensorPin = 2;
void setup()
{
Serial.begin(9600);
Serial.println("HELLO!");
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, LOW);
lastSample = 0;
sampleSize = 0;
highCount = 0;
lastOutput = 0;
temperature = 0;
}
void loop()
{
now = micros();
if (now - lastOutput > 500000) {
hcf = highCount;
ssf = sampleSize;
temperature = ((hcf / ssf) -0.32)/0.0047;// convert step to temperature
Serial.print(highCount);
Serial.print(" / ");
Serial.print(sampleSize);
Serial.print(" temp: ");
Serial.println(temperature);
lastOutput = now;
sampleSize = 0;
highCount = 0;
}
if (now - lastSample > 100) {
sampleSize++;
highCount = highCount + digitalRead(sensorPin);
lastSample = now;
} else {
delayMicroseconds(10);
}
}
the temperature come out, but keep jump insanely like other diagrams, it even reduce voltage when I move my hand over. I use the fesnel lens and tube to lead IR rays but doesn't help.
temperature I got from thermistor is 1.817 V and doesn't change no matter I do with hot or cold items.
the output of thermopile .7 some thing V. it does change to .9 when I move my hand over.
I still dont know what I do wrong. Do you have any idea?