Arduino Digital 7-Segment Thermometer

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.
Segment Thermometer
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.

USB A-B cable

Step 2: Program the Arduino

Schematic Segment Thermometer

The code I wrote requires you to have the Arduino Seven Segment library installed. To do this, go here and download all the files by going to “File>Download” at the top of the page.

Then locate you Arduino sketchbook folder (should be located in “Documents>Arduino” on Windows) and create a folder called “hardware” if there isn’t already one. Go in that folder, and paste the folder you downloaded before into the “hardware” folder.

It should not be in a .zip or .rar format, which it will most likely come as when you download it, you must extract the entire folder and place it in the hardware folder.

After you installed the library, upload the code below to the Arduino board, and proceed to the next step.

#include “SevSeg.h”

SevSeg sevseg;

int tempUnits = fahrenheit; //which unit of temperature do you prefer?

int refreshTime = 5000; //how many seconds should it wait before it checks and displays the temp again? 1000 = 1 second

unsigned long timer;
float celsius = 0, kelvin = 0, fahrenheit = 0;

void setup()

void loop()

//Reads the input and converts it to Kelvin degrees
kelvin = analogRead(0) * 0.004882812 * 100;

//Converts Kelvin to Celsius minus 2.5 degrees error
celsius = kelvin – 2.5 – 273.15;

//Converts Celsius to Fahrenheit minus 2.5 degrees error
fahrenheit = ((kelvin – 2.5) * 9 / 5) – 459.67;

unsigned long mils=millis();
if (mils-timer>=refreshTime) {
//Print teperature to the displays
sevseg.NewNum(tempUnits,(byte) 2);

Step 3: Modify the code to use a common anode display (optional)

Changing the code to work with a common anode display is simple. Change this line of code:




Step 4: Change the units and refresh time (optional)

To change the units of the temperature displayed to Celsius or back to Fahrenheit, change the line of code at the top that says:

int tempUnits = fahrenheit;


int tempUnits = celsius;

if you prefer Celsius.

To change the rate at which the display updates the temperature, change the line of code at the top that says:

int refreshTime = 5000;


int refreshTime = <however many seconds you want it to wait before updating * 1000>;

The code is set to refresh every 5 seconds by default. If you put a number that is too low, it will update so fast that you won’t be able to read it.

[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]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[/box]

For more detail: Arduino Digital 7-Segment Thermometer

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
Scroll to Top