PDA

View Full Version : Propeller Thermal Imager



DogP
05-18-2010, 04:24 PM
Hey,

Related to the simple demos I just posted for interfacing the Harbor Freight IR thermometers to the Prop (http://forums.parallax.com/showthread.php?p=907553), I decided to modify the ZyTemp demo to create a thermal image by manually scanning an image to a VGA display.

Basically, you press and hold the Scan button and begin moving the thermometer horizontally at a steady pace. A white square corresponding to the current pixel is drawn to show you where in the image you're at. After scanning a line of the image, you let go of the button, then press and hold again to begin scanning the next line. Do this until the entire image is scanned (maximum of 64 horizontal pixels by 48 vertical pixels). To finish, you single-click the Scan button. Then the image is drawn to the screen, auto-scaling the image size and colors corresponding to the temperatures in the image. A scale is drawn on the side to show the colors for relative temperatures. The serial port is also used to output debug messages, such as each temperature read, and at the end of the image, min/max temp and image size/scale.

The image quality depends mostly on how steady the image is scanned, as well as distance to spot ratio of the thermometer and the distance to the object being scanned. Mounting the thermometer on an XY track controlled by the Propeller would probably create the best image. If you want software control of the Scan button, you can pull the Action pin down on the Propeller.

I was really looking for a cheap way to do real thermal imaging, but it seems the several thousand dollar cameras are the only way to do real imaging... but I thought this was kinda cool anyway. I was somewhat inspired by Phil Pilgrim's imager using the Nipkow disk: http://forums.parallax.com/showthread.php?p=753166, though of course using a different imaging method.

Anyway, I ran a test with it... I had 4 cups of water on a desk, one hot, one cold, one slightly cold, and one room temperature (with the desk being room temperature of course). I scanned across the area by hand (about 6" above the cups), trying to be steady, though not really succeeding ;) . But you can see from the images attached that it does work. The upper left is hot, upper right is cold, lower left is slightly colder than room temp, and the lower right is basically invisible, since it's room temperature. That image is a picture taken of the output on a VGA monitor. I used the TN203 thermometer since it had a D:S of 6:1, and a laser pointer to help guide me.

This used code from the ZyTemp demo with Ariba's VGA 128x96 bitmap demo. They're attached to this post, and I'll post this and the other demos to the obex tomorrow.

Pat

Post Edited (DogP) : 5/19/2010 4:56:59 AM GMT

DogP
05-18-2010, 04:25 PM
Here's the code for this project.

Pat

DogP
05-19-2010, 01:07 PM
Project has been posted to the obex: obex.parallax.com/objects/608/ (http://obex.parallax.com/objects/608/).

Pat

Tubular
05-20-2010, 03:31 AM
Not sure why this didn't attract any feedback. I for one am impressed.

I was thinking about ways of achieving the position feedback. One way might be to use a couple of linescan cameras to follow the laser spot. Another way, if an optical mouse could be persuaded to work on acrylic, might be to set up the acrylic in a plane parallel to the image, and attach the probe to the mouse so it scans the IR through the clear acrylic, while the mouse tracks the X Y location.

tubular

DogP
05-20-2010, 06:10 AM
Thanks for the comments... yeah, I guess there's too much text and only 3 pictures, so nobody's interested :D .

But yeah... my first thought for position feedback was to use an accelerometer, and basically just "paint" the picture by waving the thermometer around... the problem I had with that was that if you rotate the accelerometer at all, it'll change value, even though you haven't moved. So, you could add a gyro to compensate, but that just adds to the complexity, and I don't have code already written for that ;) .

My other thought was to use a webcam with laser pointer tracking (I've done laser pointer tracking with a webcam before), but this requires a PC and writing PC software... which isn't as cool as just having a prop with an IR temp sensor draw a picture to a monitor.

An easy-ish way would be to use a couple servos to "look" around, but that would create an image with a strange perspective, since the object should be scanned perpendicularly. That's why I was thinking of using something like an XY plotter on its side. I guess you could also add an LED on the bottom of the thermometer, and have something track the thermometer's movement, rather than trying to "see" the dot on the object. That would give you more accurate horizontal tracking (and if you scan horizontally like it does now, vertical is probably pretty easy, since you can just "step" each line down by the desired amount).

I like your ideas, though I don't have any experience with any of them. If you (or anyone else) have any good ideas that you'd like to share... I'd certainly like to hear details.

Pat

vanmunch
05-20-2010, 11:00 AM
Very cool, er... I mean... hot? (sorry bad pun) :) Seriously though, great job and nice write-up!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My wife is very, very understanding

DogP
05-20-2010, 01:49 PM
Thanks... it was a fun and pretty easy project... and it gave me an excuse to try the VGA bitmap driver, so now I'll feel comfortable using it next time I need a simple raster display.

Pat