Using LM35 Temperature Sensor with Arduino and Node MCU

Vinoth Kumar
3 min readJan 24, 2021

In this Arduino Module Series, we are going to learn about LM35 in this article. As a rule, a temperature sensor is a gadget that is planned explicitly to quantify the hotness or frigidity of an object.LM35 is an accuracy IC temperature sensor with its yield relative to the temperature (in °C). With LM35, the temperature can be estimated more precisely than with a thermistor. It likewise has low self-warming and doesn’t cause more than 0.1 °C temperature to ascend in still air. The working temperature range is from — 55°C to 150°C. The LM35’s low yield impedance, direct yield, and exact inborn adjustment make interfacing to readout or control hardware particularly simple. It has discovered its applications on force supplies, battery the executives, apparatuses, and so forth click here for the datasheet.

Connection:

LM35 Temperature Sensor with Arduino (UNO):

Connect VCC or Supply pin of LM35 to 5v of Arduino UNO (3.3v is also allowed), the Ground pin of LM35 to Ground Pin of Arduino UNO, Input Pin of LM35 to A2 of Arduino UNO

Vcc5vGNDGNDInputA2Pin Config for Arduino UNO

LM35 Temperature Sensor with ESP 8266/Node MCU:

Connect VCC or Supply pin of LM35 to 3.3V of Node MCU the Ground pin of LM35 to Ground Pin of Node MCU, Input Pin of LM35 to A0 of Node MCU.

Vcc5vGNDGNDInputA0Pin Config for Node MCU

LM 35 Temperature Sensor Code:

Coding Part Requires LM35.h library you can install externally from GitHub or download it from Arduino Library Manager.

//Libraries
#include <LM35.h>
// setting the sensor in the pin A0
// Command - LM35 name_of_variable(analog_pin);
//Change into LM35 temp(A2); for arduino
LM35 temp(A0);

// Function that will be executed once when connecting or resetting the Arduino
void setup()
{
// start the Serial communication
Serial.begin(9600);
}

// Function that will be executed continuously
void loop()
{
Serial.print("Temp - "); //Send a text to serial
Serial.print(temp.cel()); //It gets the temperature in celcius and send to serial
Serial.print(" C - ");
Serial.print(temp.fah()); //It gets the temperature in fahrenheit and send to serial
Serial.print(" F - ");
Serial.print(temp.kel()); //It gets the temperature in kelvin and send to serial
Serial.println(" K"); // Send a text to serial and give a new line
Serial.println(" "); // Blank line
// to store the value in a variable you will use.
//float temperature = temp.cel();
//delay
delay(1000);
}
//end

As per Datasheet:

The LM35-arrangement gadgets are accuracy coordinated circuit temperature sensors, with a yield voltage directly relative to the Centigrade temperature. The LM35 gadget has a bit of leeway over direct temperature sensors aligned in Kelvin, as the client isn’t needed to deduct an enormous steady voltage from the yield to get helpful Centigrade scaling. The LM35 gadget doesn’t need any outer adjustment or managing to give ordinary correctnesses of ± ¼ °C at room temperature and ± ¾ °C over a full −55°C to 150°C temperature range. Lower cost is guaranteed by managing and alignment at the wafer level.

The low yield impedance, straight yield, furthermore, exact inborn adjustment of the LM35 gadget makes interfacing to readout or control hardware particularly simple. The gadget is utilized with single force supplies or within addition to and short supplies. As the LM35 gadget draws just 60 μA from the stock, it has exceptionally low self-warming of under 0.1°C in still air. The LM35 gadget is appraised to work over a −55°C to 150°C temperature range, while the LM35C gadget is evaluated for a −40°C to 110°C territories (−10° with improved precision). The temperature-detecting component is contained a delta-V BE design.

--

--

Vinoth Kumar

Embedded Engineer who doing lot DIY's and Physical Computing for Fun.