Arduino Nano - LM35 Temperature Sensor LCD
This tutorial instructs you how to use Arduino Nano to read the temperature from an LM35 sensor and then display it on an LCD 16x2 I2C.

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (30 sensors/displays) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Buy Note: Alternatively, you can assemble the LCD I2C display using LCD 1602 Display and PCF8574 I2C Adapter Module.
Overview of LM35 Temperature Sensor and LCD I2C
If you are unfamiliar with the LM35 Temperature Sensor and LCD I2C (including pinout, how it works, and how to program), the following tutorials can help you learn:
- Arduino Nano - LCD I2C tutorial
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Nano and other components.
Arduino Nano Code - LM35 Temperature Sensor - LCD I2C
Detailed Instructions
- Click to the Libraries icon on the left bar of the Arduino IDE.
- Search for “LiquidCrystal I2C” and locate the LiquidCrystal_I2C library by Frank de Brabander.
- Then, click the Install button to install the library.

- Copy the code and open it in the Arduino IDE.
- Click the Upload button on the Arduino IDE to compile and upload the code to the Arduino Nano.
- Position the sensor in hot and cold water, or hold it in your hand.
- Check out the result on the LCD and Serial Monitor.
※ NOTE THAT:
The address of the LCD may differ depending on the manufacturer. In our code, we used 0x27 as specified by DIYables.