Shop OBEX P1 Docs P2 Docs Learn Events
Thermal Imaging with Parallax's New Heat Sensor — Parallax Forums

Thermal Imaging with Parallax's New Heat Sensor

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2010-10-26 15:39 in General Discussion
Parallax's new heat sensor, the MLX90614 Infrared Module is designed for non-contact measurement of temperature, averaged over a 90° field of view. Given, this wide field of view and a way to scan it, it occurred to me that it might be possible to construct a crude thermal imager.

In the earliest days of experimental television, a rotating Nipkow Disk containing a spiraled set of holes, along with a single photodetector, was used to scan the televised subject, one "pixel" at a time. The same technique can be used for thermal scanning as well. I started by milling a disk out of a thin paper/phenolic laminate (i.e. machinable cardboard) that could be attached to a servo horn. In it, at 22° intervals, are eight small holes at a progression of radii from the center. As each hole passes the heat sensor, it scans one line of pixels. So with eight holes, I can get an eight-line scan. Here's a photo of the disk attached to the front of my "heat camera":

attachment.php?attachmentid=55931

The disk is rotated with a miniature servo mounted to a piece of G10 fiberglass. The sensor module is mounted behind the G10 piece with a pair of spacers. In front of it, a small rectangular window has been cut into the G10 to restrict the field of view from the default circle to a square format. Here's a back view of the camera (a Board of Education with a BS2) mounted on a tripod:

attachment.php?attachmentid=55930

Each of the eight scan lines consists of 25 pixels, so there are 200 pixels total. As the servo increments, each scanned pixel value is read from the MLX90614 module and saved in the BASIC Stamp's EEPROM as a full word. There is room in the BS2 for three "heat pictures" when saved this way. No attempt is made to relate the raw data from the sensor to actual temperatures. That would be futile, since the temperatures of the disk and of the fiberglass mount get averaged in. What I'm interested are just the temperature differences within the field of view. These are read into a PC program that scales them to cover the complete gamut from light to dark and assigns a false color value to each pixel (lighter = hotter). Following are some sample heat images, alongside photos of the same subjects in the visible spectrum.

First is a soldering iron clamped in a stand. At 500°F or so it provides a good contrast with the background:

attachment.php?attachmentid=55932

Next is a four-burner stove. One burner is set to medium; another, to warm. Can you tell which these are?

attachment.php?attachmentid=55933

Last is a pair of ice cubes lying on a washcloth. Cold subjects are harder to image than warm ones. The reason is that the temperature difference with the background is smaller (32°F - 70°F for ice, versus 200°F - 70°F for a hot cup of coffee), so it's harder to get good contrast. A piece of dry ice would probably have made a much better picture.

attachment.php?attachmentid=55934

The hardest part of this project (aside from designing the two mechanical parts) was determining the correct servo pulse width for the beginning of each line. This required a lot of trial and error to get right, and it still tends to drift a little. A solution would be a transmissive optical sensor scanning the unused half of the disk to detect another set of holes, which could be precisely positioned.

Does this imaging setup have any value other than as a novelty? Probably not — mainly because the resolution is so crude. Also, the signal-to-noise ratio is rather poor, since each hole in the disk is such a small fraction of the total field of view. Most of what the sensor sees at any point in the scan is the disk itself, whose temperature is unknown and can vary across its diameter. (An aluminum disk might be better, since any thermal gradients would equilibrate quickly.) Nonetheless, it was fun just seeing if it could be done.

Many thanks to Chuck Gracey (Ken and Chip's dad) for sending me the sensor module to try. Chuck wrote the code for it, by the way. It's an excellent product!

-Phil

Post Edited (Phil Pilgrim (PhiPi)) : 9/22/2008 1:00:35 AM GMT
855 x 642 - 65K
855 x 642 - 58K
442 x 200 - 17K
467 x 200 - 12K
471 x 200 - 22K
«1

Comments

  • agfaagfa Posts: 295
    edited 2008-09-22 01:19
    very impressive, Phil.
  • John BondJohn Bond Posts: 369
    edited 2008-09-22 12:23
    Very impressive Phil - I'm talking about your vintage stove...

    The heat sensor's also pretty good too. It looks like you've been reading too much Logie Baird.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • SeariderSearider Posts: 290
    edited 2008-09-23 01:33
    Phil, this is way cool. Did you incrementaly move the disk or was it spining at a certain RPM?· If you took a reading from part of the disk without a hole, could you then subtract this reading form the image reading to remove the influence of the disk's tempurature?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2008-09-23 02:54
    · Please post your projects as often as possible. I Wiki'ed mechanical scan television a few months ago for some

    reason so I was pleasantly surprised to see this.· Nice.

    ··················· Thank-you
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-23 02:55
    Thanks, all, for your kind comments!

    Searider, the disk is moved incrementally. The MLX90614 sensor used in this module has a default settling time of 100ms, so a certain amount of "dwell" is required for each pixel. Also, in order to clear any influence from a prior line, the program sits for about a second at the beginning of each new line. Needless to say, a moving subject would be quite out of the question.

    Subtracting a baseline reading for each line is an intriguing idea, if only to eliminate the effect of temperature gradients across the disk. You may have noticed that the first and third scans seem to get gradually warmer near the bottom, which may be due to such a gradient. An aluminum disk, as I suggested above, might render this step unnecessary, though.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 9/23/2008 3:01:07 AM GMT
  • CHIPKENCHIPKEN Posts: 45
    edited 2008-09-23 03:54
    If you want to see more applications for the MlX90614 sensor see Tom Cantrell article, "Hot Enough for You", in the recent October issue of Circuit Cellar. He measures the temperature of his motorcycle engine during a short ride. He has some BS2 pbasic software to show how he made the temperature/time measurements.

    Chuck
  • SRLMSRLM Posts: 5,045
    edited 2008-09-23 04:27
    Amazing...
  • skylightskylight Posts: 1,915
    edited 2008-09-23 18:13
    Ingenious,I'm sure the project will stir up interest in other ways to scan for heat sources perhaps a sun locator for solar panels?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-23 19:25
    The heat sensor is insensitive to sunlight (and even candle flames, I've discovered). Sources that incandesce in the visible region have a black body radiation spectrum whose wavelengths are too short to register with such a sensor, apparently.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • SRLMSRLM Posts: 5,045
    edited 2008-09-23 19:50
    For solar panel tracking it would probably be easier just to use a grid of photo resistors or the like, and you get away with fewer moving parts.
  • skylightskylight Posts: 1,915
    edited 2008-09-23 20:23
    Perhaps then a motion tracker for animals and humans for autonomous photography or video
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-23 20:38
    As I've noted above, with such a small hole, compared to the overall field of view, the signal to noise ratio of my imager is pretty low, which makes small temperature differences difficult to image with any certainty. Also, each image requires about 30 seconds to obtain, so moving subjects are out of the question. A reasonably functioning tracker might well be fabricated using multiple MLX90614 modules along with a set of baffles, so each is looking at, say, one quadrant of the overall field of view. Then, using a pan-and-tilt mechanism, the modules could be aimed so that they all read the same temperature, similar to the way solar trackers follow the sun.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-25 16:26
    Phil, at what distance from the object did you run your imaging experiment?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-25 16:40
    Chris,

    Typically one and a half to two feet. The stove picture may have been more like three. I haven't tried anything much further away yet. I was thinking that if I got my car warmed up, it might make a decent large subject — especially if I raise the hood.

    I'm trying to figure out a way to get better vertical resolution without making the disk a lot larger. With a stepper, I could double it, since I could use both halves of the disk. But there are other possibilities using coded sequences of holes, rather than just a single hole at a time. These would involve some postprocessing, similar to that of a CT scan. They would also improve the s/n, since more of the subject would be visible at once.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • denodeno Posts: 242
    edited 2008-09-28 12:18
    Phil, Enjoyed your post...very well done.· For what it is worth, your workbench looks just like my work bench....

    Deno
  • WhitWhit Posts: 4,191
    edited 2008-09-28 16:35
    This is a very cool project Phil! Thanks so much for sharing it (in excellent detail as always). I like the tripod mount for the BOE too!

    A side note - I did not know that Chip and Ken's Dad was in the business too - Great to hear about Chuck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-09-28 18:09
    Hi Phil,

    What is the dwell time on each pixel? The MLX90614 data sheet shows a lot of options for programming its digital filters, and I'm curious if that is fixed at a particular setting in the Parallax module. The table on page 13 of the data sheet shows selections from 0.04 secondd to 4.5 seconds.

    The graph on page 30 of the data sheet shows the response as a function of angle, and at 45 degrees it is down to about 25% of the value at 0 degrees. An IR lens in front of the sensor and motion of the lens or the whole assembly might produce a much stronger signal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-28 18:21
    Looking at Pauls prop driver and the MLX90614 datasheet, the commands sent to the parallax module are the commands to be sent over the SMBus so the interesting question is whether the module filters commands or you can send any of the commands to the MLX90614.
    Or can drive the MLX90614 directly from a prop though its a pain, it has some max timings that must be obeyed and if you go wrong it goes silent. I ended up powering it from a prop pin so if it goes silent I can power it down and up again.
  • CHIPKENCHIPKEN Posts: 45
    edited 2008-09-29 02:58
    nono.gif·It is not a good idea to power the MLX90614 module from a Prop or Stamp pin because it draws a lot of current (20 ma max). You can write to most ROM locations ($20 and up as specified by the Melexis datasheet) but to complete the write the power to the MLX90614 module must be completely disconnected thru a power on/off switch. If you follow Paul Baker's propeller code it matches the Stamp serial statements. So follow the Stamp serial write serial statements and be sure to allow a 50 ms delay before doing another serial statement. Timing issues and pec calculations will be taken care by the MLX90614 module SX processor. After you have completed all your writing turn the power off to the module and your writes will be fixed inside the sensor ROM forever until you change them. PLEASE BE CAREFUL AND NOT WRITE TO ROM LOCATIONS THAT CAN CHANGE THE CALIBRATION DATA - see the MLX90614 datasheet.

    Chuck

    Post Edited (CHIPKEN) : 9/30/2008 3:38:24 AM GMT
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-29 04:25
    Where does the datasheet say 20ma? I see 1/2ma no load and the scl/sda can drive up to 25ma but as long as my scl/sda dont need that much I dont see why the chip needs 20ma? My sda/scl need about 1ma each.
    I just looked the parallax mlx90614 module says 20ms, as I said above I used the sensor directly and it only uses a few ma. I got the sensor a while ago and parallax shipping their module made me finally work out how to drive sensor.

    Post Edited (Timmoore) : 9/29/2008 4:33:14 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-29 04:34
    Tracy,

    I'm using a 100ms dwell time between horizontal pixels, which I believe is the default time constant for the chip used in the module. I assume the internal filter is an IIR, so I allow an extra second at the beginning of each line for things to clear out. This may, of course, be overkill. I'm reluctant to reprogram the sensor for a faster filter, since my S/N is bad enough as it is from looking through that tiny hole.

    I haven't investigated IR lenses yet. I'm guessing that, for these long wavelengths, they'd be very expensive. I need to see what Edmund Sci has got.

    All,

    Regarding Chuck's reminder to cut the power to write to ROM: Be sure to leave the power off for a ponderable length of time, too. I made the mistake, initially, of repowering too quickly and couldn't figure out why my settings weren't being saved.

    -Phil
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-29 05:34
    Phil, Many camera lens work for IR. See http://infrareddreams.com/how_to_shoot_ir.htm
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-29 06:22
    Tim,

    The kind of photography covered by the cited article involves near-infrared wavelengths (700 - 1000 nm). The Melexis heat sensor is sensitive to wavelengths between 5500 and 14000 nm, where ordinary glass and "clear" plastics are nearly opaque. Lenses for these wavelengths are made of specialized materials, such as this one, an unmounted plano convex IR lens selling for $142.

    -Phil
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-29 06:38
    I wondered about that. What about the lens for PIRs? Though they dont focus in one place since they try to cover an area. There are some narrower focus PIRs, those lens might work. How about this http://www.glolab.com/pirparts/pirparts.html·they handle the right wavelength and the field of view says 10 degrees

    Post Edited (Timmoore) : 9/29/2008 6:53:22 AM GMT
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-09-29 07:45
    Phil, fresnel technologies offers a range of polyIR materials out in the PIR range near 10 um. And they are not expensive at all and come in many shapes. A lens would make objects in the field of view seem hotter than they really are, but in a scanning device that would I think increase the contrast ratio and the S/N. A standard PIR sensor is not very sensitive either, unless it has one of those multizone or curtain lenses that are used in burglar alarms, or a standard round Fresnel lens.

    I was thinking comparatively, too, that a PIR sensor is more like an edge detector in that it responds to changes in temperature, whereas the Melexis sensor is a thermopile that has a response down to DC for measuring static temperature. The upper frequency limit on PIR is 1/10 or 1/20 second. I wonder about the Melexis. Below the IIR and FIR filters, however configured, there must also be some thermal mass of the thermopile and membrane.

    Thanks for responding, Chuck. It is good to know that the parameter registers can be programmed. I was intrigued by the PWM output mode too. That can be turned into an analog output, right, for super simple measurement/control systems?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • NoBo780NoBo780 Posts: 94
    edited 2008-10-01 19:26
    Does this sensor compare to/work the same way as this sensor here? I have always wanted to work with that thermopile sensor, but could never get around the cost...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Giggly Googley!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-01 20:33
    NoBo,

    The one you've cited has a broader IR response (2 - 22 um vs. 5.5 - 14 um for the Parallax unit), which renders it more sensitive to near-IR interference from sunlight. However, it does include an eight-sensor array, instead of just one sensor, which may explain the high price.

    -Phil
  • NoBo780NoBo780 Posts: 94
    edited 2008-10-01 22:55
    I was wanting to use a thermopile sensor for detecting not just the PRESENCE of people, but where in the themal 'image' they are (more to the right, to the left, top, etc.). But I guess the Parallax sensor only has one sensor, and not an array, and therefore cannot take an immediate thermal 'snapshot' of what is in front of it like the Devantech sensor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Giggly Googley!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-01 23:09
    You'd have to use an array to get the positions in real time.

    -Phil
  • NoBo780NoBo780 Posts: 94
    edited 2008-10-02 01:59
    Darn. Ok thanks for your input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Giggly Googley!
Sign In or Register to comment.