Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Measuring Room temperature using LM35 Temperature Sensor with Arduino

By EG Projects June 25, 2019

Measuring Temperature of a place through Arduino is very easy by using any of the commercial temperature sensor available in the market. I am going to measure the temperature using low cost and efficient lm35 analog output temperature sensor with arduino. For this tutorial we need an arduino board(Uno, Maga, Lenardo etc) and Lm35 temperature sensor. Lm35 is the oldest analog output temperature sensor still serving and available in the market. Some other old analog temperature sensors like TMP36 is also available in market but they are not popular among students, hobbyist and diy electronics project makers. I prepared a nice tutorial on Lm35 pin out its internal structure and working. I also derived temperature measuring formula for lm35 temperature sensor. I suggest you to take that tutorial if you are new and don’t know much about the lm35 temperature sensor. It will help you in understanding the code below.

  • Lm35 Pin out, working, temperature measuring formula and internal structure.
16x2 lcd displaying lm35 temperature value with arduino uno

16×2 lcd displaying lm35 temperature value with arduino uno

Lm35 Temperature sensor working

LM-35  Measuring room TemperatureLM-35 Measuring room Temperature

​Lm35 output voltage is proportional to centigrade/Celsius temperature. Lm35 Celsius/centigrade resolution is 10 mills volt. 10 mills volt represent one degree centigrade/Celsius. So if Lm35 outputs 100 mills volts the equivalent temperature in centigrade/Celsius will be 100/10 = 10 centigrade/Celsius. Lm35 can measure from -50 degree centigrade/Celsius up to 150 degree centigrade/Celsius. 

​Arduino analog pin is used to read the analog output signals from the sensor. The circuit diagram of the project is given below. To Pin#1 of Lm35 apply 5v, make Pin#2 ground, and the third one the middle pin is output pin. It gives a voltage signal that is actually the temperature of the particular place. 
​
Note:  LM35 is an absolute temperature sensor. It can only measure the temperature of the surroundings with in the circle of between 100 to 500 feet . So if you are using internet and you are matching your temperature reading from the one that is given for your city on a weather forecast site than your reading will not be same like theirs. It will be near but not the same.


Lm35 temperature sensor voltage to temperature conversion

Now one of the most difficult thing is how to convert the voltage generated/output by the lm35 sensor at output in Celsius or Fahrenheit scales. Well this needs you to first go through the data sheet of temperature sensor and know about the characteristics of the sensor. 

Main crux from data sheet: LM35 Output temperature in Celsius form. It Increments the output by 1 on every 10 mV change in temperature. 

  • when the sensor outputs 500 mv voltage, the temperature in Celsius is 50 degree Centigrade.
  • For 400 mv output temperature in Celsius is 40 degree centigrade.
  • For 600 mv temperature is 60 degree Celsius.

Now we now the resolution of Lm35 and its characteristics lets derive the formula to convert the output raw voltage by Lm35 in to centigrade/Celsius temperature. ​

Lm35 voltage conversion to temperature formula/equation derivation for Arduino 

  • Arduino analog pins can measure up-to +5 volts OR the voltage on which it is working normally +5 volts.  
  • ​Arduino analog pin resolution is 1023 starting from 0. On +5 volts input it counts to 1023.
  • Lm35 max voltage output is 1500mV( At 150 degree centigrade). 1500mV is equal to 1500/1000 = 1.5 volts. So Lm35 at max outputs 1.5 voltage.
  • Arduino analog pin count for 1.5 volts equals to (1.5 / 5)*1023 = 307.5 . At +5 volts its 1023 and at 1.5 volts its 307.5.
  • New Arduino-Lm35 Resolution = 307.5 / 150 = 2.048 . Now if arduino analog pin counts 2.048 its equal to 1 degree change in centigrade/Celsius temperature of LM35.

The same above formula/equation is in the code and its working perfectly.

LM35 with Arduino - Measuring Room Temperature

LM35 with Arduino – Measuring Room Temperature

Arduino uno measuring temperature using Lm35 temperature sensor – Circuit diagram

The circuit diagram of the project is simple. Analog pin A0 of the arduino uno is used as input pin. Connect LM35 analog output pin to it. Apply +5 volts to Vcc pin of LM35 and ground the Gnd pin. In the loop function i am continuously measuring the temperature, and then i am printing the temperature on a 16×2 character lcd. I also converted the Celsius temperature in Fahrenheit with the formula that i think all of you are familiar with (temperature C ) * 9.0 / 5.0) + 32.0, then again i print the Temperature in Fahrenheit on 16×2 lcd. 16×2 lcd is interfaced in 4-bit mode with arduino. You can see the circuit diagram of the project below.

Note: For temperatures measurement i used the float data types to accurately measure the temperature in decimal form.                                                       

Lm35 temperature sensor 16x2 lcd with arduino uno - Measuring Temperature

Lm35 temperature sensor 16×2 lcd with arduino uno – Measuring Temperature

On first row of 16×2 lcd temperature in centigrade or Celsius scale is displayed and on second row of 16×2 lcd temperature in Fahrenheit scale is displayed. Temperature reading is updated after every 0.8 seconds. 
 
More projects on interfaicning Lm35 temperature sensor with various other mirocontrollers. Each project code is open source. One can use and modify it according to his needs.

Lm35 With 89c51 Microcontroller Measuring Temperature

Lm35 WiFi temperature monitoring using Nodemcu

​Measuring Room Temperature with Arduino Code
Watch the Project Video Here!!!!
Sorry for the bad quality of the video


Filed Under: Arduino Projects, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • is there vay for credit card size phone charger?
  • Innovus Scan Reorder deletes Scan In Pad
  • How to get 3D model of ACPL-847-300E
  • How to find the resonance frequency and impedance of a planar spiral coil in HFSS?
  • Why so few Phase shift full bridge controllers?

RSS Electro-Tech-Online.com Discussions

  • Can I make two inputs from one??
  • The Analog Gods Hate Me
  • How to make string LEDs?
  • Fixing board, Easy question HEX SCHMITT
  • It's Amazing What A Buck And A Quarter....

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How to monitor temperature and humidity on a TFT display with graphics
  • Tria modules integrate edge AI processing with multi-core processors
  • pSemi introduces RF switch with 52 dBm PMAX,PEAK and 90-dBm IIP3 linearity
  • XP Power launches 1.3 kW power supply with 58.9 W/cmÂł density
  • How to enable Wi-Fi provisioning in ESP32-based IoT products

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe