I had recently purchased an LED strip from Radio Shack (part #: 2760339) that is based on the TM1803 chipset, and was looking for a project to use them on.
I was inspired by a Gro-Egg baby's room thermometer I had, which changes color it glows based on the temperature of the room.
Step 1: Parts Used in This Project
- Arduino Uno (although once refined, I will likely move it to a Nano)
- LED strip (Radio Shack 2760339, TM1803 chipset based)
- TMP36 temperature sensor
- 12V power supply (for LED strip)
- (4 pieces) 3M Command adhesive picture hanging strips
While not "parts", I also needed to download the FastLED library to communicate with the Radio Shack LED strip. I downloaded that from the FastLED github.
Step 2: The Layout
The first image shows the basic breadboard layout.
I have the TMP36's left pin (looking at the flat side of the sensor) connected to +5V, the right pin connected to GND and the middle pin connected to the Uno's A0 analog input pin.
The only other wiring is the LED strip and to connect that, I connected the red wire to the VIN pin on the Uno. This is so that it receives the 12 volts that are supplied by the 12V power adapter. The adapter I used was from an old external hard drive that is no longer in use.
The LED strip's black wire goes to GND and the green signal wire is connected to pin 6.
Step 3: The Code
I found some of the code I needed from the examples that are provided with the FastLED library.
I'm also sure that some of this code could be cleaned up a bit, but I'm new to Arduino development so it is what it is for now.
The code in the downloadable sketch is pretty well commented, so it should be easy to follow.
The temperature thresholds can also be changed to suit what you think is cold, warm or hot. Simply adjust the values in the if statements in the checkTemp() function.
For example, if you felt that anything below 65 degrees F was cold, change line 81 from:
if (tempF > 50 && tempF < 60.8)
if (tempF > 50 && tempF < 65)
If you change one set of values don't forget to change all the others after that one, otherwise your temperature scale will be off for the warmer temps.
I've also recently updated the code (included here) to have more of a gradient look to the temperature scale, vs the harsh color changes in the photo.
Step 4: Start It Up!
You should be all set to compile an upload the sketch to your Arduino now.
Don't forget to connect your 12V power adapter or the LEDs will not illuminate.
I secured mine to my office wall using some 3M Command adhesive picture hanging strips, but you could do it just about any way you like.
Now, at a glance, you'll know if the approximate temperature in your space!