Introduction: Outdoor LED Thermometer

If you don't want to read any pointless chatter you can feel free to skip to page two.
You have been warned.

Over the summer I once again was looking for a fun project, that I could learn something from (AKA mess up twenty times, and correct my mistakes then try again). As I walked outside it was burning hot, my best guess was 451 degrees Fahrenheit (yes that was a reference) or for everyone outside the United States 232.778 degrees Centigrade (The joke doesn't quite transfer as well). Anyway, on that day I knew I wanted had to know the temperature all the time when I was outside. So, I went online and looked for outdoor thermometers. As with my desk none of them were what I wanted and I thought I could make one myself. So, I started on the project off and on. In all it took me about 3 months (Most of which it just sat there) to build my thermometer. In the end I am pretty happy with the results. There are a few thing I would like to change if I was going to do it again, all of which will be listed in the different steps as there are relevant. But, in the end I had what I set out to make, and it even looked good. :)

Disclaimer: I have no formal education in either woodworking, electronics, or programming I am completely self taught in all three areas. Thus, I cannot promise that my work will follow any conventions of the three. And for anyone reading my programming, I know it is very inefficient  and if someone would like to rewrite it for other I would be happy to upload it will give credit to you.

Safety Disclaimer: The use of tools can be dangerous, please use common sense. I cannot be held responsible for any injury due to misuse of tools. That includes injury to animals that may be in the vicinity of your work space.

Answers for the Make to Learn Youth Contest

What did you make?
I made a digital outdoor LED thermometer. The thermometer comprises an AtMega328P which analyzes the one wire digital temperature sensor, which is then displayed using a custom 2.1 seven segment display (two full digits and a one) made by 10mm LEDs. Each controlled by a MOSFET mounted on a custom PCB. In addition to the electronics, I also produced a suitable wood enclosure made from multiple boards of poplar and plywood. Finally, I used the Arduino IDE to write code for the AtMega328, I then uploaded the .Hex file created by Arduino to the chip with an ISP. If you would like to read more of the reason for the project the first paragraph provides a dramatized account of my choice to make the thermometer. 

How did you make it?

After searching the web trying to find a outdoor thermometer I liked I came up empty. So I decided to build one on my own. (In hind sight it would have helped to get someone who knew what they were doing to help). As I started out I had a set plan to take a precut circular table lazy susan top and route out the back. Well that didn't work which describes much of the project. I would plan for a certain path but many times I had to rewire/recut/reflash to finally get a working thermometer. More of detail is available on the third and fifth step.

Where did you make it?
I did all the major work on the project at my house. All the woodworking was with my limited tools in the garage, the soldering was on the kitchen table until my mom kicked me off. While all the actual work went on at home, much of the deign went on during school when I had free time in classes or was just bored I would sketch the redesigned circuit or think about a better way of constructing the enclosure.

What did you learn?
The biggest challenge for me was designing and building a circuit that could drive multiple segments of LEDs which required a higher current and power than the AtMega could provide per channel. The biggest surprise to me was how well it actually came together in the end. I had some what expected to finish it half way and then give up after getting one part to work, but I finally got all the parts working together. After was all said and done the proudest part of the build was the PCB I designed, after soldering up the whole circuit on proto-board I decided to design and have manufactured a PCB which I think turned out beautifully. If I had to do it again I would probably spend a little more time on the enclosure because I have some ideas on how to improve its function and performance.     

More information is spread through out the instructable which answers the questions. These answers are just a summary of the information. 

Step 1: Materials

These lists are as comprehensive as I could get. I made the project a little while ago and tried my best to remember all the parts I had used.

Enclosure:
- 1/4" Plywood or 1/4 in boards or plywood; enough to cut the from and back circular faces from
- 1 in thick board; a few feet to make the sides
- Various Paints (Mix to your hearts content)
- Silicon caulking to seal any gaps in the enclosure
- Some screws to join the two faces


Electronics:
- 42x 10mm LEDs (I would suggest at least getting 50 in case of any have defects)
- AtMega328 or Arduino (Arduino circuit may differ a little)
            - Using a AtMega328 will require a 16 Mhz crystal and capacitors 
- Power Supply (Voltage should be close to the voltage drop of 3 LEDs, which varies based on the LED)
- Barrel power connector (Most likely 2.1mm or 2.5mm look at the power supply to see which one you need) 
- 16x 200mA MOSFETs (Once again buying 50 is about the same price and allows for mistakes)
- Resistors (Depending on your LEDs different values will be required)
- 10k resistors to reference the MOSFET gate to ground insuring proper output state
- 7805 5V regulator (To provide power for the arduino)
- Various capacitors to decouple the on board power regulation and main power supply
- DS18B20, one wire digital temperature sensor
- Wire, 22 gauge should work fine


Tools:
- Drill and drill bits
- Some type of saw, a scroll saw or hand saw works fine
- Soldering iron
- Caulking gun
- Wire cutter/stripper
- Paint Brush 

Optional Tools:
- Third hands (Helps with soldering)
- Band Saw (Would make cutting the circles easier)


Step 2: Enclosure

I will start with the enclosure, explaining my recommend way of building it. Then I will include one of my attempts that I tried but found to be less effective (AKA I poorly executed the design so I decided to change my approach).

Recommended:
My personal recommendation would be to use two pieces of  1/4" plywood and separate them by some 1" thick wood.(In reality the 1" thick wood is only 3/4") Which is the way I ended up doing it, except I glued up some 1/4" wood into a larger piece versus just using plywood. (I believe plywood would be better, but I did not have any on hand at the time). 

If you are using plywood skip this step. To glue up the wood, apply a liberal amount of wood glue along the edges. Then take some clamps (the larger the better) and allow the piece to sit over night. You should also use some cauls (pretty much just a piece of straight wood) and clamp it across the top of the piece. Once done use a hand plane to remove any glue left over. 

Next, cut out the circles for the front and back of the enclosure. Start by drawing a circle as a reference for the cut. I used the pre-cut  circle that I had got from one of my failed methods. You could use a string and pencil, with the pencil tied on one end and the string held in the center.

After, you have marked the circle on the wood, all you have to do is cut a perfect circle (Easy right :) ).My suggestions would be to use a coping saw and some patience to cut the circle. I used a scroll saw but that is more expensive and not much easier to use.(Unless you have used it a lot). Another bright side is the circles don't have to be perfect, mine are far from it but there is quite a bit of wiggle room where the final product will still look nice.

Once you have the circles cut out, the next step is to glue blocks of wood around the edge. Glue these blocks out side your perimeter, they will be cut off later. Glue the blocks onto both of the plates. These blocks will form the bulk of the depth once finished. Just ensure you have enough space for the electronics and LEDs once the enclosure is finished.


Step 3: Enclosure (The Learning Experience)

Unlike the successful enclosure on the page before my first attempt did not work as well. The attempt started with a Lazy Susan top which I had planned to route out. This process could work but a special jig would have to be built. (And I didn't have the extra wood to make it). As you can see in the pictures to route out the top many passes are needed. Because of the large amount of space needed to be routed, a jig that provides support for the router would be needed. With out it there is no rail to put the router on.

After spending a half hour routing the Lazy Susan I decided to change the method. Which is how I came up with the method on the previous page.   


Step 4: The Electronics

As stated on the first page I do not claim to have any formal training in electronics, so I cannot say this is the best way to do the electronics. The electronics are pretty much just a bunch of MOSFETs and a Atmega328.

In the circuit, the Atmega reads the temperature from the sensor. After it decides how to toggle the segments to create the digits seen. In essence the rest of the on board circuit provides 5V for the Atmega, a bank of MOSFETs to allow the Atmega to drive the high current LEDs. 

There are also resistors to ensure the MOSFETs are in the correct state based on the Atmega output. Finally, the larger resistors are there to ensure the correct amount of current and voltage are given to the LEDs.  

Note: After receiving the PCBs I noticed my holes drilled for the MOSFETs were a little small. The MOSFETs fit, but with some difficulty. I have not yet corrected the problem but plan to sometime soon. If people want I would be happy to upload  the files but I will wait for now because of this problem. Also another change I want to make my ground plate cover the whole layer to help dissipate heat. 

Step 5: Electronics (The Learning Experience)

The previous page describes some problems I found with my PCB. Seeing that it was my first PCB to design and have manufactured I figured those were just two minor complaints. Before then I had only used proto board to create permanent electronics for my projects. As seen in the picture the circuit got quite messy. I believe I wired it up properly but I used BJT transistors versus MOSFETs. Because of this I believe the micro controller could not provide enough current to fully open the gate. (Not entirely sure if that is correct but, the MOSFETs worked so...) 

Another, major problem that I had with the circuit was the fact I had two voltage rail. Which works fine except after a long night of soldering I forgot. Long story short I had to replace the sensor and microcontoller because I wired them to the 16V rail. (I believe the max voltage for both is about 6V, so just a little over :)) Needless to say it wasn't hard to diagnose the problem when I touched the micro contoller and it was burning hot.

Step 6: Programming

The actual code is on the last page because I had problems uploading the arduino file. (Sorry) Should be copy and paste though.

Below is the attached code I used for the project. WARNING: I have no real experience programming so the code is very inefficient but should work okay for the project. Also if anyone would like to rewrite the code more efficiently I would appreciate it would like to give you credit and upload it for this project. In addition I can't take credit for all the code I used some of the code from bildr.org (Which is an amazing resource for information on electronics) to interface with the one wire temperature sensor. 

Also note the code pinouts refer to the arduino pin numbers, but for wiring of the atmega the pin numbers are different. Luckily, after a quick internet search this link on arduino.cc shows the arduino pin numbers and the atmega's pins.
- www.arduino.cc/en/Hacking/PinMapping168  


Exact link for one wire: www.bildr.org/2011/07/ds18b20-arduino/


Step 7: Back to the Enclosure

Now that I have discussed most of the electronics/programming I will continue with finishing the enclosure.

The next step for the project is to take the plates and trim off the overhanging wood blocks. This can once again be done with a coping saw. Once they are trimmed flush to the top plates, mark out the grid of LEDs on one of the two. The patterns dimensions will vary based on the size of the face, but the general pattern should be the same. I chose to only do horizontal segments of 2 because it used less LEDs, if you want 3 would work fine (On my first try I had planned to do 3, the pictures for which are on page 3). The pattern should be marked on the face so that the blocks are behind it.

Next, drill the holes for the LEDs, I used 10mm LEDs so a metric drill set would have been nice. But, I only had fractional so I used the closest bit size that was slightly under. A brad point bit would be preferred because it won't walk (move)  when you start drilling but a twist bit works fine. 

Tip -  If you don't have a drill press, take a scrap piece of wood and put it and your drill on a flat corner. Then drill the piece of wood keeping both at a right angle (at least as much as possible). Once finished you should have a nice straight hole through the piece. Now you can hold it on top of the piece you are drilling. It should help some for keeping your drill perpendicular to the work piece.    

Step 8: Finishing the Enclosure

Originally, I was going to add triangles around the circle and make it look like a cartoon sun. But, after I applied the paint I thought it would be criminal a bad idea to add the little triangles (If anybody does please post a picture of it in the comments, I would love to see how it would have turned out).

I personally used hot glue to attach the LEDs into the front plate, which is not overly recommended. Over time the hot glue will probably fail and I will have to reattach the LEDs. For me this was fine because I had planned to make adjustments and had quite a bit of hot glue. But if you can go for a better glue, such as Quick Hold for jewlerly. As far as I can tell it does not use acetic acid to cure which I have read can cause LEDs to cloud. (Probably not a big deal seeing the LEDs are diffused anyway). But, I used it on another recent project and it seemed to work nicely holding the LEDs in and dried clear with just a little rubberiness (That should be a word).

Back to the method used, I started out with a base color using acrylic paints. (Probably not the best choice for the outdoors but all I had on hand at the time). Personally, I wanted more of a yellow base than red, but you may want a different color. Pick whatever color you want to be most prominent. Start with that color and cover the outside of the enclosure with it. Then with some other colors  mix a few shades and apply patched coverage over the base color. I found a mixture of long and short strokes provides the best effect.

Finally, drill some holes near the bottom and top of the  board hopefully allowing the hot air to escape and for cool air to flow over the resistors.Then drill out a hole for the barrel jack and temperature sensor on the bottom. It may be easier to drill the barrel connector's hole by clamping the top and bottom plate together.   

Few tips:
- If you want a worn effect you can chip out some wood under the LEDs like I have done on the far right segment. (Not that I did that on purpose, but it does provide a neat effect). 

- Paint the inside with a dark colored paint, when the LEDs are lit some light escapes behind them. The dark paint will help absorb any light the goes through or comes from the LEDs. Thus, making it easier to read during the day in the sun or at night.

Step 9: Final Electronics/ Thoughts

The final thing to do with the electronics is to attach a barrel jack connector. I found out the hard way my power supply had a 2.1 mm connector when none of my barrel connectors fit. So do yourself a favor and check the datasheet before you order or order the correct connectors. After installing the barrel jack find a good place for the temperature sensor where it will be able to correctly sense the outside air. After everything is wired and LEDs glued in screw the two parts together and added some silicon caulking to improve the water resistance.

I will leave by asking for my awesome followers, and anyone who has a opinion on which of my projects I should post/finish next. Currently I am working on a display for model houses, a old fashioned style movie poster frame with LED chasers, and a work bench (which like my desk was made to be lower cost). I would appreciate your input on which one to share.

Thanks,
Sobaka-Gemini 


Step 10: Video of Results

Step 11: The Code

#include <OneWire.h>


// Data wire is plugged into pin 3 on the Arduino
int DS18S20_Pin = 3; //DS18S20 Signal pin on digital 2  

// Setup a oneWire instance to communicate with any OneWire devices
OneWire ds(DS18S20_Pin);


int digit1;
int digit2;
int digit3;
int x;
int num;
int start;
int oneA = 0;   //ARDUINO PINS NOT Atmega
int oneB = 1;
int oneC = 2;
int oneD = 4;
int oneE = 5;
int oneF = 6;
int oneG = 7;
int twoA = 8;
int twoB = 9;
int twoC = 10;
int twoD = 11;
int twoE = 12;
int twoF = 13;
int twoG = A0;
int threeA = A1;
int threeB = A2;


void setup(void)
{

  pinMode(oneA,OUTPUT);//digit1
  pinMode(oneB,OUTPUT);
  pinMode(oneC,OUTPUT);
  pinMode(oneD,OUTPUT);
  pinMode(oneE,OUTPUT);
  pinMode(oneF,OUTPUT);
  pinMode(oneG,OUTPUT);


  pinMode(twoA,OUTPUT);//digit2
  pinMode(twoB,OUTPUT);
  pinMode(twoC,OUTPUT);
  pinMode(twoD,OUTPUT);
  pinMode(twoE,OUTPUT);
  pinMode(twoF,OUTPUT);
  pinMode(twoG,OUTPUT);


  pinMode(threeA,OUTPUT);//digit3
  pinMode(threeB,OUTPUT);

}

void loop(void)
{

  float temperature = getTemp();
  float tempf = (((temperature*(9))/5)+32);
  num = (int) tempf;

  if(x >= 0)

  {

    num = (int) tempf;
    x= 0;
    num = tempf;
    digit1 = num%10;
    num=num/10;
    digit2=num%10;
    num=num/10;
    digit3=num%10;
    num=num/10;
  }


  switch(digit1){
    case 0:
    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,HIGH);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,LOW);
    break;

    case 1:

   digitalWrite(oneA,LOW);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,LOW);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,LOW);
    digitalWrite(oneG,LOW);
    break;

    case 2:

    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,LOW);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,HIGH);
    digitalWrite(oneF,LOW);
    digitalWrite(oneG,HIGH);
    break;

    case 3:

    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,LOW);
    digitalWrite(oneG,HIGH);
    break;



    case 4:

    digitalWrite(oneA,LOW);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,LOW);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,HIGH);
    break;



    case 5:

    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,LOW);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,HIGH);
    break;

    case 6:


    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,LOW);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,HIGH);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,HIGH);
    break;


    case 7:

    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,LOW);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,LOW);
    digitalWrite(oneG,LOW);
    break;


    case 8:


    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,HIGH);
    digitalWrite(oneE,HIGH);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,HIGH);
    break;



    case 9:

    digitalWrite(oneA,HIGH);
    digitalWrite(oneB,HIGH);
    digitalWrite(oneC,HIGH);
    digitalWrite(oneD,LOW);
    digitalWrite(oneE,LOW);
    digitalWrite(oneF,HIGH);
    digitalWrite(oneG,HIGH);
    break;

  }


   switch(digit2){
    case 0:
    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,HIGH);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,LOW);
    break;

    case 1:

   digitalWrite(twoA,LOW);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,LOW);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,LOW);
    digitalWrite(twoG,LOW);
    break;

    case 2:

    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,LOW);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,HIGH);
    digitalWrite(twoF,LOW);
    digitalWrite(twoG,HIGH);
    break;

    case 3:

    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,LOW);
    digitalWrite(twoG,HIGH);
    break;



    case 4:

    digitalWrite(twoA,LOW);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,LOW);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,HIGH);
    break;



    case 5:

    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,LOW);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,HIGH);
    break;

    case 6:


    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,LOW);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,HIGH);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,HIGH);
    break;


    case 7:

    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,LOW);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,LOW);
    digitalWrite(twoG,LOW);
    break;


    case 8:


    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,HIGH);
    digitalWrite(twoE,HIGH);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,HIGH);
    break;



    case 9:

    digitalWrite(twoA,HIGH);
    digitalWrite(twoB,HIGH);
    digitalWrite(twoC,HIGH);
    digitalWrite(twoD,LOW);
    digitalWrite(twoE,LOW);
    digitalWrite(twoF,HIGH);
    digitalWrite(twoG,HIGH);
    break;

  }


  if(digit3 == 1){
    digitalWrite(threeA,HIGH);
    digitalWrite(threeB,HIGH);
  }
  else{
    digitalWrite(threeA,LOW);
    digitalWrite(threeB,LOW);
  }

}

float getTemp(){    //Code onwards is from Bildr.org
  //returns the temperature from one DS18S20 in DEG Celsius

  byte data[12];
  byte addr[8];

  if ( !ds.search(addr)) {
      //no more sensors on chain, reset search
      ds.reset_search();
      return -1000;
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");
      return -1000;
  }

  if ( addr[0] != 0x10 && addr[0] != 0x28) {
      Serial.print("Device is not recognized");
      return -1000;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1); // start conversion, with parasite power on at the end

  byte present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE); // Read Scratchpad


  for (int i = 0; i < 9; i++) { // we need 9 bytes
    data[i] = ds.read();
  }

  ds.reset_search();

  byte MSB = data[1];
  byte LSB = data[0];

  float tempRead = ((MSB << 8) | LSB); //using two's compliment
  float TemperatureSum = tempRead / 16;

  return TemperatureSum;

}

Make-to-Learn Youth Contest

Participated in the
Make-to-Learn Youth Contest