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 temperature over WiFi: LM35 temperature sensor interfaced with Nodemcu Esp8266-12e module

By EG Projects February 15, 2021

This is a simple DIY project on internet of things applications. How to monitor room temperature over WiFi? One can see temperature on his mobile, laptop or desktop computer by this DIY project. Popular LM35 temperature sensor is interfaced with Nodemcu ESP8266-12e WiFi module. Nodemcu gets raw temperature voltage form lm35, converts the voltage in actual temperature by utilizing its analog to digital converters. Final temperature is calculated in Celsius form. Once Celsius temperature is calculated it is converted to Fahrenheit and both values are forwarded to clients connected to nodemcu. One can see the temperature on mobile and desktop devices.
Nodemcu is working as server. Serving a web page. Mobile or desktop device is our client. Fetching temperature from server. Note: Both the server and client must be connected to same WiFi network in order to work properly. I write a nice tutorial on LM35 Pinout and working principle. If you are new and does not know about the pin out and working of LM35 temperature sensor than i advice you to first go through a simple tutorial. LM35 pin out working and configuration. 
If you have taken the above tutorial you can easily understand the values calculated below. Most of the DIY projects to which i have gone through does not explain how to convert the LM35 output voltage in to actual temperature reading. Even most the online tutorials on LM35 are not calculating the precise temperature reading and their temperature measuring technique is even totally wrong. Their for i decided to explain deeply actually whats going on.

 

Driving formula for nodemcu and lm35 temperature conversion ratio

  • Nodemcu analog pins can measure up to 3.3 volts OR the voltage on which it is working 3.3 volts.  
  • ​Nodemcu analog pin resolution is 1023 starting from 0. On 3.3 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 volts.
  • Nodemcu analog pin count for 1.5 volts equals to (1.5 / 3.3)*1023 = 465 . At 3.3 volts its 1023 and at 1.5 volts its 465.
  • New Nodemcu-Lm35 Resolution = 465 / 150 = 3.1 . Now if nodemcu analog pin counts 3.1 its equal to 1 degree change in centigrade/Celsius temperature of LM35.
Since Lm35 works on 5 volt it is powered through an external 5 volt signal. Nodemcu works on 3.3 volt so its not possible to power lm35 with nodemcu output voltage. Lm35 output is connected to analog channel 0 of nodemcu. Note both the lm35 and nodemcu ground should be connected with each other for proper analog signal measurement.   

Picture

Coming to the code portion. Code is written and compiled in arduino ide. ESP8266WiFi.h library is used in the project. Make sure you have installed this library in your arduino library package. Now enter the SSID and Password of WiFi router to which you want your nodemcu to be on. Your client(mobile, desktop or laptop) must be connected to the same WiFi router to which you are going to connect your server(nodemcu). 
Select correct board in your arduino ide and upload the code in nodemcu. After uploading the code in nodemcu open arduino serial monitor. You will see that nodemcu will be assigned an IP by your WiFi router and nodemcu server is initializing. After successful server booting a URL will be displayed on the serial monitor.  

Picture

This URL is the actually the web address of web page served by the server(nodemcu). Enter this URL in your mobile or desktop browser you will see a web page like. A button with text Update Temperature is present on the page. Every time you press the button Celsius and Fahrenheit values of temperature will be updated.    

Nodemcu Lm35 temperature sensor web page

Nodemcu Lm35 temperature sensor web page
What happens when you press the “Update Temperature” button? Loop function is always looking for the client request. When update button is pressed HTTP request arrives to server(nodemcu). In loop function it is compared with the request format embedded in the code. If client request matches the format of the request in server code. Server starts reading other parameters of request and performs the functions as requested in the client request. In our case its up date the lm35 temperature sensors readings and provide instant temperature readings. Nodemcu grabs the updated readings and before closing the client request it replies back with the updated temperature values.
Download the project code. Code is written in arduino ide. Folder contains the project .ino file. You might need to include the header ESP8266WiFi.h library in your arduino libraries folder. Please give us your feed back on the project.
Nodemcu Wifi temperature sensor .ino

You may also like:

  • battery types
    What are the different battery types for specific applications?

  • Understanding battery management systems

  • What battery chemistries are used in electric vehicles?

  • What is the role of embedded software in electric vehicles?
  • battery selection low power design
    What are the battery-selection criteria for low-power design?

  • What are hardware filters and their types?

Filed Under: Electronic Projects, ESP8266, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

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

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Is AI making embedded software developers more productive?
  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

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