Making LCD Thermometer With Arduino and LM35/36

101,976

261

55

About: I am a dreamer, maker and an engineer making and sharing interesting projects here at Instructables. Follow me @ instagram: @the_gadget.boy

Hello, everyone !!! I'm going to show you how to make an LCD thermometer with an Arduino UNO and a LM35/36 analog temperature sensor with jumpers and a breadboard.

This project is very good for people beginning with Arduino, it doesn't require any special engineering nor programming skills and it will take you less than 10 minutes to build it, once you have all the parts of course. :)

Step 1: Gathering the Parts

These are the part you need to build the thermometer:

  1. 1x Arduino UNO board
  2. 1x Breadboard
  3. 1x 16x2 LCD display
  4. 1x LM35 or LM36 analog temperature sensor
  5. 1x 10k potentiometer - for adjusting the brightness of the display*
  6. 19x Jumpers - to connect everything

They are also met in the official Arduino Starter Kit which you can order from Arduino's official web page here. Also you can buy them separately from the following stores: Adafruit, SparkFun, Aliexpress, Banggood, etc.

*If you dont have a 10k pot you can use 50k like me !

Step 2: Building the Thermometer

By following the Fritzing schematic above, plug the LCD in the breadboard and then connect it to the Arduino board with jumpers. After that plug the potentiometer and the sensor in the breadboard, connect the left and the right pins of the pot to ground and +5V and the middle one to the LCD display.

Then connect the sensor to ground and to +5V and to the Arduino but be very carefully, because if you connect it wrong the sensor will heat up to 280+ C(540 F) and might get damaged.

Once you have connected everything move on the next step.

Step 3: Programming the Arduino

To get it work you have to use one of the two codes below. Upload it to your Arduino using theintegrated development environment, for short IDE, which you can download from Arduino's official page and you are done !!!

If you don't see anything on the LCD or you see rectangles, turn the pot clockwise/anti-clockwise until you see the letter clear.

Now you have a thermometer and you can measure the temperature of the air around you, inside your house or outside.

The first code is from Gaige Kerns, and it can be used to read from LM36 or LM35. Thanks Gaige !!!

Also check out my new thermometer project here !!!

<p>// include the library code #include 

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// initialize our variables
int sensorPin = 0;
int tempC, tempF;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
void loop() {
tempC = get_temperature(sensorPin);
tempF = celsius_to_fahrenheit(tempC);
lcd.setCursor(0,0);
lcd.print(tempF); lcd.print(" "); lcd.print((char)223); lcd.print("F");
delay(200);
}
int get_temperature(int pin) {
// We need to tell the function which pin the sensor is hooked up to. We're using
// the variable pin for that above
// Read the value on that pin
int temperature = analogRead(pin);
// Calculate the temperature based on the reading and send that value back
float voltage = temperature * 5.0;
voltage = voltage / 1024.0;
return ((voltage - 0.5) * 100);
}
int celsius_to_fahrenheit(int temp) {
return (temp * 9 / 5) + 32;
}</p>
#include <LiquidCrystal.h>         

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //Digital pins to which you connect the LCD
const int inPin = 0;                   // A0 is where you connect the sensor
void setup()
{
  lcd.begin(16,2);
}
void loop()
{
  int value = analogRead(inPin); // read the value from the sensor
  lcd.setCursor(0,1);
  float millivolts = (value / 1024.0) * 5000; 
  float celsius = millivolts / 10;
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(celsius);
  lcd.print("C");
  lcd.setCursor(0,1);
  lcd.print((celsius * 9)/5 + 32); //turning the celsius into fahrehait
  lcd.print("F");
  delay(1000);
}

3 People Made This Project!

Recommendations

  • Toys Contest

    Toys Contest
  • PCB Contest

    PCB Contest
  • First Time Author

    First Time Author

55 Discussions

0
None
webbo90

1 year ago

HI, I am making a thermometer as my project for my apprenticeship. I want to make it one that will measure body temperature and that you can program different temps into it. For example, if a persons body temperature calls between 36.5⁰C-37.2⁰C a green led will come on to say that it is normal. Any advice would be appreciated. Thank you

1 reply
0
None
NithyaP5webbo90

Reply 3 months ago

Can I get the code for it... Myself doing the same can u plz help it

0
None
babygeek

2 years ago

follow instructions to the letter and pin. problem!!! lcd backlight won't turn on!!!

PLEASE HELP!!!!!

1 reply
0
None
NorbertZ1babygeek

Reply 7 months ago

Did you try turning the potentiometer? I was wondering why mine wasn't lighting up either until i turned it and then voila, it lit up lol

0
None
mnur ali

2 years ago

Hi , is it possible to add esp8266 between lcd and lm35 ?

i wanna monitor the temperature via web browser too

0
None
Pikkemoos

2 years ago

First of all, great project. But it doesn't work for me. By the way, i'am a newbie. Everything works, but as you can see on the pic, i'am in my living room an not in a sauna. So please, help.... Thank you.

IMG_1339.JPG
0
None
GhadiA1

2 years ago

Hey there,

I tried all the codes provided, yet I'm still getting a very non-reasonable pattern of readings like this 7.73, 0.00, 41.57, 3.97 ,0.00 ,41.78 ,3.97 ,0.00 ,40.82 ,6.34 ,0.00 ,25.78... in Celsius.

Any help?

Thanks in advance

2 replies
0
None
GhadiA1Konstantin Dimitrov

Reply 2 years ago

I don't have an LCD so I'm viewing the results on the serial monitor, and so I made these connections. The arduino is powered by the laptop itself.

DSC_6244.jpg
0
None
WhaleInLove

2 years ago

Can you possibly also make this without the screen, but instead have the arduino measure the temperature of something periodically and have it gather data for you?

2 replies
0
None
JardaVWhaleInLove

Reply 2 years ago

Search for project with data logger, one example here:

https://www.instructables.com/id/Arduino-Datalogger-with-Temperature-Sensor-and-Pho/

0
None
Rohit Kota 3

3 years ago

Hi, the temperatures on my LCD keep varying over a vast range with a correct temperature being showed once in a while.I did the initial model on a breadboard.So is it happening because of the lose connections on the breadboard?Should I go for a vero board and solder the components.

Hope to get a reply soon.

Thanks in advance.

4 replies
0
None
StevenV24Rohit Kota 3

Reply 2 years ago

I have the same problem.

I do not know how it happens, but measurements that vary completely randomly of an entire degree are useless.

How do I avoid this noise.

0
None
JardaVStevenV24

Reply 2 years ago

You can try the sketch I just posted. If it doesn't help then try to use capacitor.

Hello !

I am sorry for my late answer, I am using F and M audio jacks to connect my temperature sensor. The F is soldered to arduino shield and the M is soldered for the other side of the cable which is soldered to the sensor.

0
None
mmondek

2 years ago

Hello, I dont know what I am doing wrong but display is showing nothing... I connected everything precisely as you did, I can change brightness with potentimeter, but I cant see any numbers...

1 reply
0
None
Konstantin Dimitrovmmondek

Reply 2 years ago

Hello, mmondek, The problem is in the code, I will fix it later today and upload it.

P.S. Sorry for my late answer.

0
None
tmorsch

3 years ago

Hi, thank you for posting this project.

I am new to arduino and started to play and test with a free account at 123d.circuits.io.

I built this circuit and discovered that the LCD panel would blow up unless I inserted a 1K Ohm resistor. I wonder if this is a quirk with the online simulator. I also noticed that it doesn't seem to be able to display negative numbers for the temperature.

Again, is this just the simulator?

Please see my attached image.

Thank you.

123d.circuits.io.png