LCD Thermometer - Arduino

About: Hi! I'm Hugo, 15 yo student from the French Alps. I spend most of my spare time programming, tinkering, building electronic stuff, observing planets through my telescope, learning to pilot airplanes, readin...

Let's learn how to create a thermometer that displays the temperature on an LCD !

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Hardware Needed

-An Arduino Uno

-A breadboard

-Jumper wires

-A 10K potentiometer

-A temperature sensor

-And of course, an LCD (Liquid Crystal Display)

You won't need any tool.

Step 2: Build the Circuit

The steps here correspond to the image above...

First, pin your LCD on your breadboard and power the breadboard by connecting a wire from "5V" on your Arduino to the positive row on the breadboard and another one from "GND" (ground or 0V) to the negative row.

Then connect the LCD to the Arduino:

LCD pin 4 - Arduino pin 2

Pin 6 - pin 3

Pin 11 - pin 4

Pin 12 - pin 5

Pin 13 - pin 6

Pin 14 - pin 7

After that, power the LCD:

LCD pin 1 = GND (on the breadboard)

Pin 2 = 5V

Pin 5 = GND

Pin 15 = 5V

Pin 16 = GND

Then connect pin 3 of your LCD to the central pin of the 10K potentiometer.

Finally, power the potentiometer with one pin on GND and the other one on 5V (on the breadboard).

Finally, power your temperature sensor like the potentiometer and connect its central pin to pin A0 (analog input) on your Arduino.

Step 3: Code

Now let's write the code:

#include <LiquidCrystal.h> //Include the library that enables you to use the LCD.
const int sensorPin = A0;//Declare that your sensor is connected to pin A0 on your arduino.
LiquidCrystal lcd(2,3,4,5,6,7);//Declare that your LCD is connected to pins 2,3,4,5,6 & 7 on your arduino.

void setup() {
  for(int pinNumber = 2; pinNumber<8; pinNumber++){
  pinMode(pinNumber,OUTPUT);//These two lines mean that the LCD pins are outputs for the Arduino 

    void loop() {
    int sensorVal = analogRead(sensorPin);//Declare that you read the data coming from the sensor
    float voltage = (sensorVal/1024.0) * 5.0;//Change the value of the data (0-1024) to a voltage (0-5)
    float temperature = (voltage - .5) * 100;//Translate this voltage to a temperature.
    lcd.begin(16, 2);//16 by 2 are the dimensions of the LCD (in number of characters)
    lcd.print(temperature);//print the temperature on the LCD
    lcd.print(" *C");//print "degrees Celsius" on the LCD.
    delay(1500);//print the text on the LCD every 1.5 second. This will enable the Arduino to print the exact temperature at approximately in real time, without making the screen blink.

1 Person Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

12 Discussions


3 years ago

Hello, I just got the starter pack and was interested in this type of project. I thik they chamged the potentionmeter from a 3 legs on one side to a 2-1 but I can put it on the other side.

My LCD only displays a white screen when the potentionmeter is bugged out. Also, tying to fix it, im pretty sure I switched the TMP around, but it didnt burst to flames, it just heated up

2 replies
Hugo TrombertAlfredZ

Reply 3 years ago

Actually, yes the pots in the starter kit are 2-1 pins.

On the side with 2 pins, one must be connected to ground, the other to 5V. The pin on the other side must be connected to pin 3 on the LCD.

One day I also heated up the TMP because I switched the connections, but it wasn't broken.

For the LCD, make sure the connections are the right ones(checkout this video: )

Have fun tinkering!

Hugo TrombertHugo Trombert

Reply 3 years ago

BTW in this video, he switched the connections from 2,3,4,5,6,7 on the arduino to 7,6,5,4,3,2. If you do like him, you'll have to reverse the numbers at the beginning of your code (2nd line)

Hugo TrombertKaravan

Reply 3 years ago

You're welcome. Mine comes from Arduino starter kit


3 years ago

very nice, thanks for this.

I think there is a mistake

float temperature = (voltage- .5) * 100


float temperature = (voltage- .05) * 100

1 reply
Hugo Trombertrontje

Reply 3 years ago

Actually, these 2 lines of code come from the book in the Arduino starter kit, i just copied them...


4 years ago on Introduction

Great stuff , cannot wait to try .

thanks for your instructable