For just a couple of bucks and a few components you have laying around your work area you can build a min thermometer than fits in your pocket. The whole circuit sits nicely right on top of a 9v battery, and is connected to it with double sided tape. Changing batteries was never so easy!
I hope you enjoy the project and vote it for the contests!

Step 1: Mini Thermometer Demonstration

In case you were wondering why the LEDs are flashing multiple times on each flash it's because I'm using PWM to power the pins. 

Nice Instructable! Completed mine today...used the button to put the pin to LOW instead of HIGH though...skipped using a pull up resistor this way.
Dude that's awesome! Thanks for posting the pic! What did you do with the resistor? You connected the pin from 5v directly to the ATtiny pin?
Yeah...now when the button is pressed the pin goes low.
Nice, that makes sense, since you ground the pin. Thanks!
Could I make it so that it blinks at me in binary? And in Celsius?
Why not?
To have it print out C˚ just take out the F˚ conversion.
Was kind of confused about the schematic.The rj45 threw me for a loop. Being not too smart in these things, I made my own diagram. Not sure if it is riight though/
The RJ45 is just a name. I forgot to change it. Instead it should be ATtiny85. The pins are still the same. I think yours is correct.
I made my own such device recently, but it uses an IR LED to blink a warning single at me via an IR camera in my son's bedroom if it gets too hot or too cold. It also has a red LED that blinks out the temperature just as yours does. But I think my code simplifies the process a bit. You should try this out. Also, you should be able to run all of this off of a 3v button cell, saving you even more space and weight. Just make sure you look up the sleep functions for the ATtiny, and use it as much as possible. In my code, the &quot;SleepyTime&quot; function puts the MCU to sleep for a period of time (32=32ms, 5=.5seconds). For your device, you could easily make it sleep constantly, checking for a button press periodically. For example, sleep in .5 second intervals, checking for a button press in between.&nbsp;<br> <br> TensDigit = (int)Temperature / 10;&nbsp; // Split the number up into 2 digits<br> OnesDigit = (int)Temperature % 10;<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (TensDigit != 0) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=1; i&lt;=TensDigit; i++) {&nbsp; // Blink LED # times for tens digit<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(STATUSLEDPIN, HIGH);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SleepyTime(32);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(STATUSLEDPIN, LOW);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SleepyTime(5);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SleepyTime(1);&nbsp; // Pause between the 2 digits<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (OnesDigit != 0) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=1; i&lt;=OnesDigit; i++) {&nbsp; // Blink LED # times for ones digit<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(STATUSLEDPIN, HIGH);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SleepyTime(32);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(STATUSLEDPIN, LOW);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SleepyTime(5);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
JrBurk thank you soo much I couldn't figure out how to make the 10s digit blink and the 1s. I asked a question in the forum but it wasn't answered so I turned to my own poor devices :D. <br> <br>So I don't really understand what you are doing with the 10's and 1's digit would you please explain? <br> <br>Ok so the sleeping time saves some power? <br> <br>Yes I was gonna run it off 3v battery but I didn't have any around :(. No job, no money, lack of electronics. <br> <br>Thanks I will be eagerly awaiting a reply.
I was thinking the same thing as jrburke99. In the code<br> <br> TensDigit = (int)Temperature / 10; // Split the number up into 2 digits<br> OnesDigit = (int)Temperature % 10;<br> <br> you need to know that % means mod or remainder, and (int)Temperature means that whatever the Temperature / 10 gives, make an integer with no decimal point.<br> <br> In your video your thermometer reads 69&deg;. In the first line a rolling solve would look like this: <div> &bull;TensDigit = (int)Temperature / 10; //Start</div> <div> &bull;TensDigit = (int)69 / 10; //Fill Temperature with 69</div> <div> &bull;TensDigit = (int)6.9; //Divide 69 by 10, giving you 6.9, which is a double (has a tenths digit (9)</div> <div> &bull;TensDigit = 6; //Convert double to int, which does not have anything to the right of the decimal point<br> <br> The second line is a bit more fun. Let's roll that:<br> <br> &bull;OnesDigit = (int)Temperature % 10; //Start<br> &bull;OnesDigit = (int)69 % 10; //Fill Temperature with 69 OnesDigit = (int)9; //when you do that long form math from elementary school and your answer here would be 69&divide;10= 60 with a remainder of 9<br> &bull;OnesDigit = 9; //Convert to an integer.<br> <br> I have taught coding before and Modulo (mod in some languages, % in others <a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="nofollow">http://en.wikipedia.org/wiki/Modulo_operation</a>))<br> <br> If you are not conferrable with Modulo, it works the same way as this:<br> &bull;OnesDigit = Temperature-TensDigit*10; //Start<br> Which goes:<br> &bull;OnesDigit = 69-6*10; //Fill in the numbers<br> &bull;OnesDigit = 9; //Solve, using order of operations<br> <br> Either way you now have TensDigit = 6 and OnesDigit = 9.</div>
Basically I don't know how to easily know how to say in code, &quot;Flash LED (10s digit) times&quot; without adding delays. Then when I add delays then that means I have to specifically make a block for each number.
Instead of saying &quot;Flash LED (10s digit) times&quot;, you want to say &quot;Flash LED once 10s digit times&quot;. Thats where this block comes in:<br> <br> for (int i=1; i&lt;=TensDigit; i++) {&nbsp; // Blink LED # times for tens digit<br> &nbsp;&nbsp; digitalWrite(STATUSLEDPIN, HIGH);<br> &nbsp;&nbsp; SleepyTime(32);<br> &nbsp;&nbsp; digitalWrite(STATUSLEDPIN, LOW);<br> &nbsp;&nbsp; SleepyTime(5);<br> }<br> <br> This section of code is one blink:<br> <br> digitalWrite(STATUSLEDPIN, HIGH);<br> SleepyTime(32);<br> digitalWrite(STATUSLEDPIN, LOW);<br> SleepyTime(5);<br> <br> Now to do that 6 times for 69&deg;, we just do a loop.&nbsp; This line is the loop:<br> for (int i=1; i&lt;=TensDigit; i++)&nbsp;&nbsp; // Blink LED # times for tens digit.&nbsp; There is also an open and close { } for the code that repeats.<br> <br> In english this says &quot;Let's repeat some code a few times.&nbsp; Let's make a counter we will label i, and set it to 1; We will repeat as long as i is less than or equal to the number in the TensDigit variable; and last every time we get to the bottom of the loop let's add 1 to i.<br> <br> Saying<br> for (int i=1; i&lt;=6; i++){<br> &nbsp;&nbsp; print i;&nbsp; //pretend code to demonstrate<br> }<br> <br> gives us the result of<br> 1<br> 2<br> 3<br> 4<br> 5<br> 6<br> <br> print i prints the i variable once.&nbsp; We just call it 6 times, and each time it runs i is different.<br> <br> Our good friend <a href="http://en.wikipedia.org/wiki/For_loop#Traditional_for_loops" rel="nofollow">http://en.wikipedia.org/wiki/For_loop#Traditional_for_loops</a> has some info on loops.<br> <br> If your new to programming I would suggest going to <a href="http://www.codecademy.com/tracks/javascript?jump_to=501c71dfe944b1000201f5e2" rel="nofollow">http://www.codecademy.com/tracks/javascript?jump_to=501c71dfe944b1000201f5e2</a>.&nbsp; This is to learn Javascript which is similar in Syntax to what Arduino uses.&nbsp; While you are learning a different language it will teach you to think like a programmer and immediately recognize, hey i want to do a For Loop here or a Do Loop there.
Can I replace the sleepy time with a delay? <br> <br>Thanks a lot I will see if I can't figure it out.
Delay() would work. SleepyTime is not a built in function but instead one that jrburke99 made (code at http://forum.arduino.cc/index.php?topic=177588.0) which not only does a delay but also powers down much of the chip to save power.
Right. Well thank you for explaining that code I will work on a new code for this soon. Thanks!
Thank you I looked up modulo and I had my dad explain it to me. I understand now how that works. I'm still having trouble coding. I can get the temp split into 10ths and 1nes but I can figure out how to get the the LED to flash several times without still going through a bunch of if statements 1-9.
Nice! These pulses could power an analogue counter, of sorts... Small disks with Digits on them, like those on old Pinball machines, but lots smaller. <br>Voted, and Blogged about it: <br>http://faz-voce-mesmo.blogspot.pt/2013/11/muahahaha-bolas-de-fogo-e.html
Nice! :) <br>Voted, and also Blogged about it, too useful to pass un-noticed: <br>http://faz-voce-mesmo.blogspot.pt/2013/11/muahahaha-bolas-de-fogo-e.html
What if the temperature was to 100 degrees Fahrenheit?
You could make both LEDs flash very fast if you wanted to! I just didn't do that because it doesn't get 100 where I live. If it goes below 0 degrees you could have the LEDs flash slowly. Just a few simple if statements.
Or just make the first LED blink 10 times. As long as there's a clear pause between 1st and 2nd LED it should be easy to tell. Ten in a row, it's 100. Ten in a row, pause, 1 and it's 101.
- yintercept -- The most difficult, fundamental digital computer loop is binary division. I figure that a memory string is needed to store the BASIC commands. With a loop of course. ENTER becomes a BASIC entity. FORTRAN computers of the 1970's were actually more sophisticated with numbers. Note that Microsoft computers had 4 original partners.
Scale factor = X , atd / x = int , if int &lt; &gt; then flash . It may be that Bill gates / paul allen is drawing attention away from microprocessors. I just got a large computer monitor. I have 20 mhz z80 chips that can load a single screen in 480x240/20,000,000 = .006 seconds from memory. The Commodore 64 computer could always instantly fill the screen from memory.
I have been ignoring arduino because it seems to fall into a category of microsoft nonsense. What is the 8 pin chip? Is it secret so asian factiory workers can go home?
Hi. If you did this project with Dallas DS18b20 temperature sensor - it could power just a CR2032 tablet battery (3 Volt) and will be small. Attiny 45/85 exellent work with 3 Volt. Flash of tiny 85 will be enough for program on IDE Arduino with all needed lib
True. I had a LM35 and wanted to use it. A 9v battery is also more convenient.
Much the same approach, but with simpler code, can be done using a high level PICAXE-08M. On the compact Celsius scale I used longer flashes for tens, &amp; shorter for units. Hence 24 Celsius = 2 longs then 4 shorts. Sub zero could also be organised, but it rarely gets that cold here (Wellington, New Zealand)!&nbsp; For the sensor a DS18B20 is preferred, but even a cheap thermistor may do. Refer details =&gt;<a href="http://www.picaxe.orcon.net.nz/NTC_thermo-Swan-code.pdf" rel="nofollow">http://www.picaxe.orcon.net.nz/NTC_thermo-Swan-code.pdf</a>
Hey thanks for the suggestion but I am trying to stick with Arduino and it's language. <br>That's a really good idea! Long, then short.
Could you use a for/next block to scan through temperature ranges instead of using case statements? No experience with AT Tiny, but it's supported in Arduino IDE. This should help to reduce your code size and give more accurate readings.
I'm not sure what you mean by more accurate because it doesn't matter how I go through the temperatures it's gonna be the same whether I use if statements, cases or whatever. I don't know how to use a for/next block. If you'd like to to make a new sketch I that would be awesome! Yeah, that would reduce the code size and be easier. Like I said in the beginning, I didn't really know how to do this. The code I made was made from a beginner.
Nice/ You could use 3 AAA batteries (does not take much more space than a 9V) and skip the voltage regulator.
Yup I just don't have that :D
Here is a post I made on the Arduino forums with all of the details and my code, etc. Hope this helps you out!<br> <br> <a href="http://forum.arduino.cc//index.php?topic=177588.msg1317117#msg1317117" rel="nofollow">http://forum.arduino.cc//index.php?topic=177588.msg1317117#msg1317117</a>
Thanks I have checked it and am trying to figure some things out.
To print to a terminal window, look into the Serial commands on the Arduino site. <br> <br>So &quot;TensDigit&quot; and &quot;OnesDigit&quot; are integers, so no decimals. If you take your temperature (let's say 87.3) and divide by 10, storing the result into an integer, you will get 8. So that parses out the 10's digit of your temperature. Using the &quot;Temp % 10&quot; operation will divide by 10, and then return the remainder. So 87 % 10 will result in a 7.
Hey Burk thank you so much! I had to look up modulo and get my Dad to tell me what it did and now I understand. That's a crazy smart idea. Thanks a lot I'll be working on a newer code :D. <br>
Also, try using an ATtiny 85v, which works exactly the same, but uses less power. With a button cell, you won't need the voltage regulator bits. Also, analog temp devices can give readings all over the place. Try making a loop where it reads in a temp and prints it out to the terminal window. You will see how it can have spikes and odd readings. I originally tried using analog, but went with digital instead, as it had much steadier readings. But if you want to stick with the analog for ease of use, try having it loop and take, say 100 readings in a row and stick them into an array. Then toss out the highest 10 and lowest 10 readings (or whatever you think is best), and then average the rest. I tried that and got much steadier/accurate readings. It's a good way to learn some new programming skills, too! Have fun!
That sounds really cool but my programming skills aren't that good :(. <br> <br>Print it out to a terminal window? <br>

About This Instructable




Bio: ¿Qué tal? I'm 16 and enjoy learning about electronics. I am self-taught. I love programming my Arduino and soldering circuits. My newest hobby is ... More »
More by HavocRC:DIY FPV Antenna Protector Case Control Your RC Plane With Your Phone's Acclerometer DIY Receiver Controlled Switch (Cheap and Easy) 
Add instructable to: