Cold-hearted orb that rules the night
Removes the colours from our sight
Red is gray and yellow, white
But we decide which is right
And which is an illusion
-- The Moody Blues
Days Of Future Passed
Color, a remarkable property of light and interpretation by the human eye and brain. Color tickles the senses, affects the human mood, and can even communicate information such as stop, caution, and go. We use color so often on a daily basis that we are likely to ignore the significance of the effect.
Most of us that are reading this article live in an environment that is mechanically controlled, not too hot and not too cold. If we are in the U.S. and in a government building, we are under laws on how hot or how cold that temperature can be! But, we can (for now) be more controlling in our own homes. Here, I prefer a range not colder than 58F in the basement and no hotter than 77F in the living area. That is a very small range, just 18 degrees Fahrenheit. (58F = 14.4C and 77F = 25C).
Considering that the range is so small, could we reduce this to color bands? I wrote the code, so I get to make the selection, but you can edit the source if you like to be anything you prefer! Freedom of Open Source software. In my scheme, I have divided the temperatues into three bands which will be assigned colors ranging from Red (hot) to Green (temperate) to Blue (cool):
Red: 70 - 79F
Green: 60 - 69F
Blue: 50 - 59F
How terrible convenient, three temperature bands and three colors and a tri-color LED has three colors! Sometimes, one just gets lucky and it looks like I really got lucky here. So, here is the game plan, we will use a microcontroller to measure the temperature via a thermistor, convert that temperature into one of our three bands, and then use that color to convey to our senses the "digit" of the temperature band.
For example, if the Green LED illuminates, we know the leading digit is "6" so we could blink the green LED to provide the trailing digit. But blinking one, two, three is a bit boring (although you are free to do this if you wish to modify the code!) Why do we not add a bit of excitement to our project and blink the LED based upon the numeric value in Morse Code? Did any old Hams wake up out there?
If you are good at memorizing, then just memorize the Morse Code "dot 'n dash" combinations; after all, there are only 10.
But, in looking at the table, you may make a conclusion: that is:
- All numeric digits have 5 elements
- If the leading element is a "dot" you only need to count by "1's" until the end (5 dits) or until the first dash. Said another way, trailing dashes do not count.
- If the leading element is a "dash" you only need to count by "2's" until the end (5 dashes) or until the first dit, then count by "1's". Therefore, two dashes and 3 dots represent 2 x 2 + 3 and evaluated from left-to-right, that is 4 + 3 = 7.
Try a few on your own.
Normally, I write in C or C++ but it is fun sometimes to deviate and try something different. My formal training was in Fortran 77, so after that experience, I feel like anything goes!
This project is written in PICAXE BASIC. It is a very simple BASIC and the PICAXE chip is by a UK company; essentially they take regular PIC microcontrollers and program them to be BASIC interpreters. The user's BASIC code gets compiled and loaded into the PIC flash memory. It all works remarkably well. The UK company has great online references:
and the BASIC section describes the materials and processes necessary to compile the BASIC and upload the code to the PICAXE:
and the free software editor and compiler:
Note: The PICAXE chips all have TTL serial interfaces which means that a PC with a dB9 or dB25 interface (use for those old desktops gathering dust) can program the PICAXE with a homemade serial adapter cable and just 2 resistors!
Section 1, Page 8 of the Getting Started document has all of the information necessary. The Section 1 PDF can be downloaded here:
Where to find the PICAXE 08M2 microcontroller;>Well, you can Google for it, results will show many sellers. A short list, not in any particular order:
http://www.robotshop.com/en/picaxe-08m2-microcontroller-chip.html http://phanderson.com/picaxe/ http://www.ebay.com/bhp/picaxe http://www.picaxestore.com/index.php/en_gb/picaxe/picaxe-chips/picaxe-chips.html
Suggestions regarding the Orb:I have found that ping-pong balls work great for the dome. The large one I used in the lead-in picture came from a pool toy. You could also use a translucent top from a spray can. This may be the most creative part of the project; or the most annoying as you find the perfect dome for your build.
The purpose of D1 is to add a small voltage drop to compensate for the Blue LED. D1 can be any small-signal silicon diode. For some RGB LEDS, I found that D1 may be optional. Before final gooping with epoxy or glue, you may wish to test the circuit both ways. Use an ice cube to cool the thermistor and observe the flashing. The Orb will activate about 3 times a minute.
There is only one 150R resistor for current limiting on the LEDs because only one segment is active at a time. Were you to extend the color scheme to include multiple R/G/B segments being illuminated, the the resistor should replicated in all 3 cathode lines and the common anode simply grounded.
The 10K NTC can be any manufacturer, but I used:
Any RGB LED will likely work, I used some that I purchased from mainland China via eBay. For low-profile use, this would work;
http://www.goldmine-elec-products.com/prodinfo.asp?number=G16721 as would this:
Most everything else is "junk box" parts. If you want the thermometer to be very accurate, then a 10K 1% resistor is a nice addition in lieu of the more common 5% or 10% parts. But even a 20% can be used since the room ambient temperature range is not great and you can edit the correction factor within the BASIC code to bring the observed reading in line with the actual temperature.
Power is supplied by 4 AAA or 4 AA batteries with a series silicon power diode in series to drop the voltage close to 5.4 Volts. If you are using alkaline batteries, measure the no-load voltage of the 4 cells and if it is under 5.5V, the diode can be omitted. Because different manufacturers use different formulations, the open-circuit battery voltage varies between brands, so check first. If the voltage is above 5.5V with one diode, add a second! Just the common, generic 1A silicon rectifier (not Shockley) like a 1N4001, etc.