Incompatible browser

The Public Laboratory website will not render correctly in Internet Explorer 6 or earlier. To view it properly, please use an up-to-date browser, such as Firefox, Chrome, or another standards-compliant browser. It's a good idea to upgrade anyways -- olderversions of IE pose a security risk for your computer.

Circuit diagram for simple thermal flashlight

A redrawn diagram of the thermal flashlight posted by ad: http://publiclaboratory.org/notes/ad/11-28-2011/thermal-camera-arduino-u...

Parts list:

  • 1 Melexis MLX90614 non-contact IR thermometer (3v)
  • 1 RGB common-cathode LED
  • 2 4.7k Ohm resistors
  • 2 100 Ohm resistors
  • 1 180 Ohm resistor
  • 1 0.1 μF capacitor
  • wire
  • breadboard or circuit board & soldering eqmt.
  • Arduino
  • 9v battery and holder

Cost: ~$60

See examples of use: http://publiclaboratory.org/notes/warren/12-12-2011/thermal-flashlight-t...

Code:

AttachmentSize
thermal-flashlight.fz143.71 KB
melexis.svg2.67 KB
melexis-pcb.svg2.75 KB
melexis-schematic.svg2.18 KB
melexis.png10.93 KB
I2Cmaster.zip15.04 KB
melexis-90614.fzpz16.53 KB
Login or register to tag items

Comments

warren's picture

Illustration made in Fritzing (fritzing.org).

I've tweaked the code on the thermal flashlight a bit. In our testing, we were getting red for hot, but blue-green for cold (and figured 'blue' should be for the cold).

Here is a reference on how the color HSV (hue, saturation and value) converts to RGB:

http://en.wikipedia.org/wiki/HSV_color_space

Figure 24 shows the essence of what we are trying to do; 0 degrees = red; 240 degrees = blue.

The code in the sketch is almost correct; originally, the value was 360*0.6 = 216 degrees for the coldest value, which is blue-green. 240 degrees gives you blue, so you have:

// Regular ol' RGB LED:
// original
//int hue = map(state,0,255,(360.00*0.60),0); // not the whole color wheel
//
// 0 degrees is red, 240 degrees is blue
// See http://en.wikipedia.org/wiki/HSV_color_space
// Figure 24.
// 0=cold is 240 degrees (blue)
// 255=hot is 0 degrees (red)
int hue = map(state,0,255,240,0);

setLedColorHSV(hue,1,1); //We are using Saturation and Value constant at 1

The other part of the code that will have to change is that if you use a common anode RGB LED (the LED from RadioShack is 276-0028 (common anode (+), which is at 5V), when the PWM output is at 255 for a particular color (5V is on all the time), that color in the LED will be off. So we have to invert the output (zero becomes 255, 255 becomes zero):

// Since we are using common anode, when value is 255 (on always)
// the LED for that element is OFF, so, make a swap
setLedColor(255-red,255-green,255-blue);

Thank you very much for this circuit.

Has anyone built this circuit with the BlinkM MaxM? If so, could you please explain how you connect it to the Arduino? On the diagram above I see the PWM pins are used for the led, but since the BlinkM MaxM got built in PWM I guess this won't work? Is it possible to just disconnect the Master board and use the Blaster led cluster alone, connected to the PWM pins on the Arduino like in the diagram? :O

warren's picture

I've been trying to figure out the MaxM here: http://publiclaboratory.org/notes/warren/12-8-2011/rgb-color-knob-small-...

not a lot of progress just yet. Kyle from NYC managed it, but I haven't been able to unravel his code yet.

dr_dbw's picture

I have just built a test unit of this, seems to be working well.

For the moment I have the colouring scaled from pink, through blue, cyan, green, yellow, orange, red and finally purple. Currently have all of that set using intervals of the temperature (10-30oC), but might see if I can get that into an equation format (may be a sinusoidal one?) to make it a bit more flexible and configurable. Saw something that someone has already written somewhere to do this, so going to check that out.

I plan to add two switches on it, one that will change the lowest temperature and a second that changes the total temperature range. That should make it a bit more flexible for use.

Got rid of all that silly oF from the program too ;-), now just in oC, makes much more sense :-)

dr_dbw's picture

Jeff, not sure how to reply to your message, where is the message / contact panel here?

Anyway, I will definitely putting it up here to share with others.

At the moment it is mostly just the coding. I have worked out the formula to do the colour mapping for the range purple to pink (did that in Excel), just have to get that into the programming language so that it works. Basically it is the colour wheel, from 300o for the coldest, then as the temperature increases it goes around the wheel of decreasing angle, through zero and to 330o for the hottest temperature. Working off the following image http://basecase.org/2011/12/hsv

dr_dbw's picture

Hmm, may be yours above does something similar already?

Don't really understand the code, not my strong point, will have to have a play and see ....

dr_dbw's picture

Now have my program fully working, seems to do what I want it to do.

Issue now is the fact that the 3 colour LED doesn't mix fully, if you have all three on then you have distinct spots of red, blue and green. Looking around now for a lens that will mix them correctly, so that get the actual colour over the entire area, rather than just where the three colours happen to mix.

just awesome...
but i'm little confused, how many LED you used?

-Shuvojit Das

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].

More information about formatting options

To prevent automated spam submissions leave this field empty.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.