Arduino Thermometer (LM35 + LCD)

27,725

28

15

Introduction: Arduino Thermometer (LM35 + LCD)

About: Student, currently studying programming. Interested in Arduino, Raspberry Pi and Electronics in general.

In this tutorial, I will show you how you can build a simple Arduino Thermometer using a common 16x2 LCD and an LM35 temperature sensor. The values will be converted to both Celsius and Fahrenheit. The parts for this build are provided by Kuman, you can find them in their Arduino UNO Kit.

Step 1: Parts Needed

1 x Arduino UNO (can be any Arduino board)

1 x Breadboard

1 x USB Cable

1 x 16x2 LCD

1 x LM35 Temperature Sensor

1 x 10k Potentiometer

1 x 220 ohm resistor

1 x 9V Battery and clip (optional, for more portability)

18 x Jumper wires

Allchips is an electronics components online service platform, you can buy all the components from them.

Step 2: Plugging the Parts Into the Breadboard

Insert the LCD, the potentiometer and the LM35 into the breadboard. Their locations doesn't matter, place them the way you like.

Step 3: Connecting the LCD

This is the hardest part - you need to make most of the connections now. They are as follows:

LCD Pin -> Arduino Pin

4 -> 12

6 -> 11

11 -> 5

12 -> 4

13 -> 3

14 -> 2

LCD Pin -> Rail of the breadboard

1,5,16 -> GND

2 -> 5V

15 -> 5V (using the 220 ohm resistor!)

Step 4: Connecting the Potentiometer and the LM35

Here, the connections are as follows:

Potentiometer

One of the sides goes to GND, the opposite one - to 5V. The middle pin connects to pin 3 of the LCD


LM35

See the picture above.

Please, make sure that you insert the sensor the right way! If you swap the connections, it will burn out!


Step 5: Uploading the Code

After connecting everything, plug in your Arduino to your PC and upload the code that I've pasted here. I've added a few comments to explain some of the code.

Step 6: Done!

Enjoy your handmade thermometer. Feel free to modify the code at your liking and improve the project by adding more sensors and stuff :)

2 People Made This Project!

Recommendations

  • The 1000th Contest

    The 1000th Contest
  • Battery Powered Contest

    Battery Powered Contest
  • Hand Tools Only Challenge

    Hand Tools Only Challenge

15 Discussions

0
riyazh1718
riyazh1718

Question 10 months ago on Step 6

how do we make it with lcd screen which has 12c board

2
سعدم1
سعدم1

Question 2 years ago on Step 5

what is meant by
value = analogRead(inPin);
when i run the code on arduino mega , the error " 'intPin' was not declared in this scope"

error.PNG
0
AbhijithabhiA
AbhijithabhiA

Answer 10 months ago

Change the both names to pin or something like that ,it will work

0
Aleksandar Tsvetkov
Aleksandar Tsvetkov

Answer 2 years ago

Sorry, I have a mistake. The name of the variable on line 6 should be inPin

0
Gekko - A
Gekko - A

Reply 2 years ago

Still not working

0
thuyvyhy
thuyvyhy

Reply 11 months ago

lmpin

1
hessabinthani
hessabinthani

11 months ago

Hi,
Can you mention the constraints of this project?

3
bilalzaaj
bilalzaaj

1 year ago

What is the code?

1
Kyle J
Kyle J

Question 1 year ago on Step 6

What is the potentiometer used for on this project? Does using the LM35 temp sensor require a potentiometer or is the potentiometer there to set/vary the temperature?

0
Jayfusion
Jayfusion

Answer 1 year ago

The potentiometer is used to control the contrast on the LCD screen. Without it, you may not be able to read the text on the LCD due to the character boxes being too light or too dark.

0
mt690ju11
mt690ju11

Question 2 years ago

When I apply voltage to the board, it reads"0.00C 32.00F" on the LCD screen. Could this be a bad LM35?

0
Jayfusion
Jayfusion

Answer 1 year ago

Your LM35 works perfectly, the code is just inaccurate. Change the Celsius reading to: Celsius = value / 9.31

Also add this under void setup:
analogReference(INTERNAL)

Now, the program should run smoothly.

Cheers!

1
KerimY1
KerimY1

1 year ago

For arduino UNO
please change
const int lmPin = 0; -----------> int lmPin = A0;
and
value = analogRead(lmPin);

0
paulbrandt2
paulbrandt2

2 years ago

there is an error in the program it should read: const int inPin = 0; // The analog pin of the LM35

0
Hangoverr
Hangoverr

2 years ago

What should i do here?

FQ70GDJJGNWTSU7.LARGE.jpg