Dexter Thermal Infrared Sensor returns strange values

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Fri Oct 05, 2012 5:38 pm

Hi!

We are trying to build a robot that detects a tea light using Dexter Industries Thermal Infrared sensor and Kirk Thompson's drivers (http://lejos.svn.sourceforge.net/viewvc ... iew=markup , r6598).

But when we first tested the sensor by running a program that in a loop measured the object temperature and printed it on the LCD-screen, the temperature difference between an object in the room and the tea light was only 3 degrees Celsius. So we read the manual and learned about the emissivity coefficient, and started playing around with it. But we got results from -170 degrees up to over the maximum 380 degrees Celsius, and with some emissivity coefficients the temperature jumped up and down between these values. As the sensor saves the emissivity value on it's memory, we tried resetting the emissivity back to a value of 1.0f, which should be default, we get realistic results again, but we still sometimes get results such as -170 degrees, but then it usually helps to restart the program. Also we get very different temperature values if we tries a coefficient, change to a second coefficient and then change back to the first one again. For example, first time we tried 0.53f temperature in the room was 23 degrees, we changed to 0.54f got results below -100 degrees and back to 0.53f again, temperature was around -60 degrees.
Why is it like this? Before we started experimenting with the emissivity coefficient we got proper readings every time, but now it fails 1 out of 3 times we start the program with the default value.

Which coefficient sould we use to detect the tea light?

//Torbjörn and Tomas
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby gloomyandy » Fri Oct 05, 2012 8:12 pm

You may want to post the source of your test program so that we can take a look at it...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3012
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Fri Oct 05, 2012 10:05 pm

Here's the code, nothing special, just a simple loop to display the object and ambient temperatures. Before we changed the emissivity coefficient this class actually could detect a tealight by saving the readings in a list as a average temperature and if the object temperature was more than 2 degrees above the average the alarm went of. But as you understand, a lot of things are 2 degrees above the temperature of the room, a foot, a radiator, some spot on the wall... :?

Code: Select all
import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.SensorPort;

public class HeatDetector extends Thread {

   DThermalIR thermal;
   
   public HeatDetector(SensorPort port) {
      thermal = new DThermalIR(port);
      //thermal.setEmissivity(0.53f);
      System.out.println(thermal.readEmissivity());
      Button.ENTER.waitForPressAndRelease();
      start();
   }
   
   public void run(){
      while(true){
         float obj = thermal.readObject();
         float amb = thermal.readAmbient();
         LCD.clear();
         LCD.drawString("ObjTemp=" + (int)obj, 1, 1);
         LCD.drawString("AmbTemp=" + (int)amb, 1, 2);
         if(obj > amb + 2) {
            //Play warning sound
         }
         try {
            sleep(400);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
      }
   }
}
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby skoehler » Fri Oct 05, 2012 10:59 pm

When you draw the String "abc99" on the LCD at the exact same position you previously printed "def123", then what you get on the LCD screen is "abc993".
skoehler
leJOS Team Member
 
Posts: 1128
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Sat Oct 06, 2012 9:48 am

But we are using LCD.clear(); before printing the new values as you can see in the code, doesn't it help?
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby skoehler » Sat Oct 06, 2012 12:51 pm

PABoyz wrote:But we are using LCD.clear(); before printing the new values as you can see in the code, doesn't it help?

Sorry, didn't see that.
skoehler
leJOS Team Member
 
Posts: 1128
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Tue Oct 09, 2012 11:47 am

Hi,
We have done some more testing and the problem with our misreadings can be solved by unplugging and reconnecting the sensor after the emissivity coefficient was changed.
However, we still have problems, detecting the flame. With an emissivity value of 1.0 the difference between the air temperature (measured with readObject()) and the measured temperature of the flame was only 3 degrees Celsius with the sensor 10 cm away from the flame. With the sensor 2 cm from the flame the difference was 80 degrees.
We tried using other emissitive values, and the difference was with some values up to 140 degrees, but with the air temperature steady at -30 degrees C and the flame 110 degrees. But, this was with the sensor only a few cm from the flame, with a distance of 10 cm the difference was hardly noticeable.

According to Dexter Industires it is possible to detect a flame from a distance of 2 meters. Right now we are doubting that.
Any ideas?
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby TechnoX » Tue Oct 09, 2012 5:55 pm

Have you tried the sensor with Mindstorms NXT-G?
To rule out malfunction of the sensor.

Dexter provides NXT-G blocks for the sensor here:
http://www.dexterindustries.com/download.html
TechnoX
Novice
 
Posts: 51
Joined: Tue May 03, 2011 5:57 pm
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Wed Oct 10, 2012 9:09 pm

No, not yet, but we have been thinking about it and that will be the next step. But we think still it will be hard to see if the sensor is malfunctioning, or if it is just us trying to achieve something impossible, because the sensor is supposed to measure the temperature of an objects surface, but a flame doesn't really have a surface. But at the same time, it is an IR sensor, and the flame is emitting infrared radiation.
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby TechnoX » Thu Oct 11, 2012 9:13 pm

PABoyz wrote:According to Dexter Industires it is possible to detect a flame from a distance of 2 meters. Right now we are doubting that.
Any ideas?


2 meter seems like a very long distance for such a sensor.
Where did you read that?

A comment on their wiki says:
A difference of "5°C at 2 meters might be too much for this TIR. If you can get it closer, you should be able to detect that sort of temperature. If you’re building a cat trainer, you should be able to detect the temp of a cat (about 30 C?) vs the ambient temp (about 25 C) without a problem, but you might need to be closer to it than 2 meters."
- http://dexterindustries.com/manual/ther ... ed-sensor/

I had some problems with a raw MLX sensor. It had too wide view angle and it measure the average value of everything.
Maybe you can reduce the view angle of the sensor. Perhaps use a cover with a small pin hole. But in that case it will read the average between the small heat in the pinhole, and the cover...
TechnoX
Novice
 
Posts: 51
Joined: Tue May 03, 2011 5:57 pm
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Tue Oct 16, 2012 9:08 pm

TechnoX wrote:
PABoyz wrote:According to Dexter Industires it is possible to detect a flame from a distance of 2 meters. Right now we are doubting that.
Any ideas?


2 meter seems like a very long distance for such a sensor.
Where did you read that?

A comment on their wiki says:
A difference of "5°C at 2 meters might be too much for this TIR. If you can get it closer, you should be able to detect that sort of temperature. If you’re building a cat trainer, you should be able to detect the temp of a cat (about 30 C?) vs the ambient temp (about 25 C) without a problem, but you might need to be closer to it than 2 meters."
- http://dexterindustries.com/manual/ther ... ed-sensor/

I had some problems with a raw MLX sensor. It had too wide view angle and it measure the average value of everything.
Maybe you can reduce the view angle of the sensor. Perhaps use a cover with a small pin hole. But in that case it will read the average between the small heat in the pinhole, and the cover...


We read it here: http://dexterindustries.com/TIR_Sensor.html
According to our tests it's possible to detect a feet inside a shoe at 1.5 metres and a temperature difference at 3 degrees C or more.

We will test the sensor using LEGOs programming language soon, and we might also try to reduce the lens' focal length by using some pin hole as you suggest if it still doesn't work.
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Tue Oct 23, 2012 12:00 pm

We tried the sensor using LEGO's G-brick system and the result is the same. We still have to unplug the sensor and reconnect it or we get negative and strange values after we have changed the emissivity value. After replugging the sensor the temperature of the room is around 21-22 degrees Celsius for all emissivity values we've tried. The sensor reads a temperature difference of only 2 degrees at a distance of 0.5 meter. Should it be like this, or is it just our sensor that is broken?
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden

Re: Dexter Thermal Infrared Sensor returns strange values

Postby kirkpthompson » Wed Oct 24, 2012 1:31 pm

Hi.

I recommend that you summarize your tests and results and send an email to Dexter Industries asking if this is expected behavior for the sensor. If not, I suspect they would support their product line and get you a replacement.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 285
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Dexter Thermal Infrared Sensor returns strange values

Postby PABoyz » Mon Nov 05, 2012 10:21 pm

We have recived an answer from Dexter and they say that this is suspected behavior apart from that we have to unconnect and reconnect the sensor somtimes to not get misreadings.
They think that the problem is that we read the sensor to often and therefore overloads it. They recommend a delay of 1s after reading and setting the emissivty and 0.1s between each object or ambient reading. However, we have the same problem when we're using the brick programming language with Dexter's bricks, so we don't think that this is the solution. Furthermore does our program only read the object temperature with an delay of 0.4s.
PABoyz
New User
 
Posts: 12
Joined: Mon May 14, 2012 10:30 am
Location: Sweden


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff