ESP8266 Temperature sensor module LM35 LM75
To use an ESP8266 with temperature sensors like the LM35 or LM75, you can follow these steps to read the temperature data and use it in your projects. Below are the instructions and sample code for both sensors.
The LM35 temperature sensor provides an analog output that is directly proportional to the temperature in Celsius. It outputs 10 mV per degree Celsius.
Components Needed
- ESP8266 (e.g., NodeMCU)
- LM35 temperature sensor
- Breadboard and jumper wires
Circuit Diagram
Connect the LM75:
Connect the VCC pin of the LM75 to the 3.3V pin of the ESP8266.
Connect the GND pin of the LM75 to the GND pin of the ESP8266.
Connect the SCL pin of the LM75 to the D1 (GPIO 5) pin of the ESP8266.
Connect the SDA pin of the LM75 to the D2 (GPIO 4) pin of the ESP8266.
Steps to Run the Code
Open Arduino IDE:
Ensure you have the ESP8266 board support installed.
Select the Correct Board and Port:
Go to
Go to
Upload the Code:
Connect your ESP8266 to your computer via USB.
Click the upload button in the Arduino IDE.
Open Serial Monitor:
Go to
Set the baud rate to 115200.