Hello everybody! I will be showing you how to make a digital 7-segment thermometer using the LM335 temperature sensor.

This a guide for an Arduino version, but I am working on a mini ATtiny84 version. Once I get that working, I will post another Instructable on how to make it.

I'm sure you could make this same thermometer with an LM35 also, if that's what you have, and you probably won't have to modify the code.

This is an entry in both the LED contest with Elemental LED and the Hurricane Lasers contest, so if you like it, vote for it! Thanks!

Also, I am considering starting an electronics kit business to sell kits for the Instructables that I make, so if you like the idea, drop a comment or PM me!

Step 1: Parts List

Here are the things you will need for this project. You can get all these parts from a wholesale supplier like Mouser or Digi-Key for around $10-$15 or less, except for the Arduino board. You can get this from Mouser for around $30.

1x Arduino Uno/Duemilanove/maybe Diecimila or equivalent
1x LM335 temperature sensor (I'm sure you could make it work with a LM35 too)
2x Single digit 7-segment display, common cathode (or a single 2 digit one)
1x 2.2k ohm resistor (not sure if you need this if you are using an LM35)
Jumper wires

USB A-B cable
<p>Hey There !! Nice Tutorial, Please Send Code to edunhenry@yahoo.com, Thanks :)</p>
<p>Ok I modify some things on the code and got it work on a LM35, If anyone want the code just reply this comment and I let you know.</p><p>Great job in this project, thank you. Helped a lot!</p>
<p>Hello, can you please send me the code?</p>
<p>hello. I used your lm35 modified code in a larger project sוrrouding the lm35, I wanted to ask for an explanation of every line in the code to help me understand it better.(i'm a student it is for my final project) leshetzlee@gmail.com</p>
<p>I need code rpd1210@gmail.com</p>
<p>i need code </p><p>saxenanoop@gmail.com</p>
<p>will you please to help he.i have LM35 . can you sent the code to me</p>
<p>Read the comment i send to @SaironN, theres the code.</p>
<p>I want to know please!! <br>vih_neta@hotmail.com</p>
<p>I don't send by email, but I let you know here :D</p><p>#include &quot;SevSeg.h&quot;<br><br>SevSeg sevseg;<br><br>int refreshTime = 2000; //how many seconds should it wait before it checks and displays the temp again? 1000 = 1 second<br><br>unsigned long timer;<br>float celsius = 0, kelvin = 0, fahrenheit = 0;<br><br>void setup()<br>{<br>sevseg.Begin(1,2,3,4,5,6,7,8,9,10,11,12,13);<br>}<br><br>void loop()<br>{<br>sevseg.PrintOutput();<br><br>//LM35 code to display celsius<br>celsius = (5.0 * analogRead(0) * 100.0) / 1024;<br><br>unsigned long mils=millis();<br>if (mils-timer&gt;=refreshTime) {<br>timer=mils;<br>//Print teperature to the displays<br>sevseg.NewNum(celsius,(byte) 2);<br>}<br>} </p><p>Thanks to :</p><p><a href="https://www.instructables.com/member/xBacon/" rel="nofollow">salexandridis</a></p><p><a href="https://www.instructables.com/member/xBacon/" rel="nofollow">xBacon</a></p><p></p>
<p>Took me a while to know how this is done but it was mostly adding the library the author included on the libraries folder and wiring it as the diagram says.</p><p>Using this as my 5th semester final project on the 2nd submodule.. Wish me luck!</p>
<p>i want to use a 3 digit 7 seg display instead of 2 digits . what is the code for it?</p>
Hi.i 'd like if someone help me to modify the code so it can mesure temperatures from -20 to any other.<br>Thank you in advance.
<p>hello i try many time but still hv problem for uploading this code</p>
<p>hello may i know why serial.begin(1,2,3,4,5,6,7,8,9,10,11,12,13);totally hv 13pin? because what i know is 2digit + A to dot just only need 10pin, can u please explain for more detail thank you.</p>
<p>The code won't let me upload to my arduino because its saying Fahrenheit isn't defined in this scope. How should I fix this? </p>
<p>no works sorry bad code</p>
<p>Same Here..</p>
I want this, send to me please dianneschuur@gmail.com
<p>does this work? i'm having a common cathode display</p>
<p>@salexandridis has made the proper code. Check my instructable(PING with 2 LED seven segment displays) for the proper diagram if you have any difficulties in assembling the project.</p>
It seems that Mr/Mrs xBacon is unwilling to answer any question related to this instructable. He/She obviously doesn't even read the comments....or his/her inbox! So, that's why I undertook to search and evntually find the solution to the 'Zeros Problem&quot; ! Here's the CORRECT, 100% WORKING code: <br> <br>#include &quot;SevSeg.h&quot; <br> <br>SevSeg sevseg; <br> <br>int refreshTime = 2000; //how many seconds should it wait before it checks and displays the temp again? 1000 = 1 second <br> <br>unsigned long timer; <br>float celsius = 0, kelvin = 0, fahrenheit = 0; <br> <br>void setup() <br>{ <br>sevseg.Begin(0,2,3,4,5,6,7,8,9,10,11,12,13); <br>} <br> <br>void loop() <br>{ <br>sevseg.PrintOutput(); <br> <br>//Reads the input and converts it to Kelvin degrees <br>kelvin = analogRead(0) * 0.004882812 * 100; <br> <br>//Converts Kelvin to Celsius minus 2.5 degrees error <br>celsius = kelvin - 2.5 - 273.15; <br> <br>//Converts Kelvin to Fahrenheit minus 2.5 degrees error <br>fahrenheit = ((kelvin - 2.5) * 9 / 5) - 459.67; <br> <br>unsigned long mils=millis(); <br>if (mils-timer&gt;=refreshTime) { <br>timer=mils; <br>//Print teperature to the displays <br>sevseg.NewNum(celsius,(byte) 2); <br>} <br>} <br> <br>If you want to change the unit of temperature, all you have to do is to change the last command: sevseg.NewNum(celsius,(byte) 2); <br>Instead of &quot;celsius&quot;, you can type &quot;fahrenheit&quot; or &quot;kelvin&quot;. It seems that all this &quot;tempUnits&quot; thing doesn't work, so I totally excluded it from the code. <br>You may also change the delay by following the steps of this instructabe. <br>Have fun!
<p>is it possible to display the readings on serail as well as on the LED Dsiplay?</p><p>I've tried but I can only get one or the other but not both.</p>
<p>is it possible to display the readings on serail as well as on the LED Dsiplay?</p><p>I've tried but I can only get one or the other but not both.</p>
<p>Shouldn't there be resistors connect for each LED in the 7-Segment Display ? </p>
<p>thank you</p>
how exactly do i wire all this up? the image is blurry and i really dont get the schematic. Can anyone please help??
Love the simplicity of your project. I'm trying to make this work but it only gives zeros. The wiring is correct. Is the sketch missing something? <br>Thx.
I get the 0s too. There are no problems in wiring and I'm using the LM335.
professorred <br> <br>did you use this wiring diagram? <br>http://mysite.du.edu/~etuttle/electron/circ186.gif
if i want to add a 3rd digit 7 segment, the common cathode is connected to D3? <br> <br>more importantly, will you be selling/making ready-made pcbs? it would be alot easier than buying a prototyping board and using crude solder traces.
Hi! I've tried doing this. It seems I wired everything correctly. However, it displays &quot;00.&quot; I'm using a LM335 temp sensor with common cathode 7-segment as you've done in your demonstration. Is this a problem with the sensor? do I need to calibrate it? thanks!
Can it work with individual 7-seg displays?
Is there supposed to be seven series resistors in line with each segment on the display?
can it work with 3 digit 7-segment?? thanks in advance.
Yes, it can work with that. Since the 3 digit is already multiplexed, you just connect the segment pins to the arduino, and the first 2 digit pins to the arduino. It should work then.
Hi. No matter how I set up the LM35, I am getting a result of 00. I am not sure what is going on. Thank you.
you must use the LM335, not the LM35.
Ah. I was wondering because of the line in the parts list that mentioned that it should work with the LM35 but thank you. :)
well, it should work if you connect the lm35 in the correct way. the connections are different for the lm35 and he lm335. try going on google and searching &quot;lm35 arduino&quot; and you should come up with a circuit diagram. just follow the diagram and connect it to the analog input used in the sketch.
Hi. I copied and pasted the code to my arduino program and when I hit verify, it came up with an error saying Fahrenheit was not declared in this scope. Please help. Thank you.
Try moving the line:<br><br>int tempUnits = fahrenheit;<br><br>to under the line that says:<br><br>float celsius = 0, kelvin = 0, fahrenheit = 0;<br><br>Tell me if this works.
Thank you much. That worked like a charm. Now to build it. Thanks again. <br>
No problem :)
Do you have any further plans for this project? Are you going to use the thermometer for anything?
I am working on developing a version of this that runs on an ATtiny84 or ATtiny44 chip. I am designing the PCB in Eagle as we speak, and last night I ordered the parts to prototype it on a breadboard. <br> <br>I was thinking about making a waterproof and or heatproof version that is wireless (maybe xBee).
Also, I was planning on using&nbsp;<a href="http://oshpark.com" rel="nofollow">http://oshpark.com</a>&nbsp;to fabricate the PCBs.

About This Instructable




Bio: I'm a big Arduino fan. I'm always looking for new and exciting things to do with electronics and Arduino. I also like video ... More »
More by xBacon:DIY Infrared Proximity Sensor (Arduino Compatible) Color Changing LED Tree Plug-in LED Color Fading Night Light 
Add instructable to: