View All

Please refer to the English Version as our Official Version.Return

Europe
France(Français) Germany(Deutsch) Italy(Italia) Russian(русский) Poland(polski) Czech(Čeština) Luxembourg(Lëtzebuergesch) Netherlands(Nederland) Iceland(íslenska) Hungarian(Magyarország) Spain(español) Portugal(Português) Turkey(Türk dili) Bulgaria(Български език) Ukraine(Україна) Greece(Ελλάδα) Israel(עִבְרִית) Sweden(Svenska) Finland(Svenska) Finland(Suomi) Romania(românesc) Moldova(românesc) Slovakia(Slovenská) Denmark(Dansk) Slovenia(Slovenija) Slovenia(Hrvatska) Croatia(Hrvatska) Serbia(Hrvatska) Montenegro(Hrvatska) Bosnia and Herzegovina(Hrvatska) Lithuania(lietuvių) Spain(Português) Switzerland(Deutsch) United Kingdom(English)
Asia/Pacific
Japan(日本語) Korea(한국의) Thailand(ภาษาไทย) Malaysia(Melayu) Singapore(Melayu) Vietnam(Tiếng Việt) Philippines(Pilipino)
Africa, India and Middle East
United Arab Emirates(العربية) Iran(فارسی) Tajikistan(فارسی) India(हिंदी) Madagascar(malaɡasʲ)
South America / Oceania
New Zealand(Maori) Brazil(Português) Angola(Português) Mozambique(Português)
North America
United States(English) Canada(English) Haiti(Ayiti) Mexico(español)
HomeBlogEasy Temperature Monitoring with LM35 in Electronics Projects
on December 27th 14,296

Easy Temperature Monitoring with LM35 in Electronics Projects

The LM35 temperature sensor is a reliable and easy-to-use device that measures temperature and converts it into a voltage output. This article covers everything you need to know about the LM35, including its working, pin configuration, and practical uses. Whether you're using it in a project or learning about its applications, this guide simplifies the process for you.

Catalog

1. Overview of LM35 Temperature Sensor
2. Pin Details and Configuration of LM35
3. Features and Technical Specifications of LM35
4. Equivalents and Alternatives for LM35 Temperature Sensor
5. Working Principle of LM35 Sensor
6. Temperature Monitoring Circuit Using LM35
7. Circuit Connections for LM35 Temperature Sensor
8. How LM35 Operates in a Circuit
9. Interfacing LM35 with Arduino for Temperature Monitoring
10. Arduino Code for LM35 Sensor Integration
11. Interfacing LM35 with PIC Microcontroller for Temperature Measurement
12. Applications and Use Cases for LM35 Temperature Sensor
LM35 Temperature Sensor

Overview of LM35 Temperature Sensor

The LM35 is a simple yet accurate chip designed to measure temperature in a straightforward way. It provides an analog voltage output that directly corresponds to the temperature it detects. As the temperature changes, the output voltage adjusts linearly, making it easy to interpret the readings.

This sensor does not require extra adjustments or calibration to give readings in degrees Celsius, which makes it easy to use. The LM35 can measure a wide range of temperatures, from -55°C to 150°C, making it suitable for many uses. It is often used to monitor the temperature of the air, electronics, battery packs, or even boiling water.

Its compact size allows it to fit into various setups. You can easily connect it to a microcontroller, such as an Arduino or any device with an analog-to-digital converter (ADC), making it versatile for different projects and applications.

Pin Details and Configuration of LM35

The LM35 temperature sensor has a simple and clear pin layout, making it easy to connect to your circuit. Below are the three pins and their functions:

LM35 Temperature Sensor Pin Configuration

• Pin1 (Vcc): This is the power supply pin. You connect it to a +5V voltage source to provide power to the sensor.

• Pin2 (Analog Out): This pin outputs an analog voltage that corresponds to the temperature in degrees Celsius. As the temperature changes, this voltage changes linearly, allowing for straightforward readings.

• Pin3 (GND): This is the ground pin, and it connects to the ground of your circuit to complete the electrical connection.

Features and Technical Specifications of LM35

LM35 is a linear, precise, and low-cost temperature measuring chip that provides an analog output voltage proportional to the temperature it measures. Below is a detailed table of its specifications.

Parameter Value
Type
High-Precision, Low-Power Temperature Sensor
Calibration In Celsius
Package Types
TO-92, SOIC, TO-220
Sensitivity 10 mV/°C
Accuracy
±0.5°C (Ensured), ±1°C (Typical)
Operating Voltage Range 4V – 30V
Current Drain Below 60 μA
Self-Heating 0.08°C in Air
Output Impedance
0.1 Ohms (at 1mA Load)
Output Voltage 10 mV/°C
Linearity Error (0°C to +100°C) ±1°C
Operating Temperature Range -55°C to +150°C
Power Consumption 60 μA (Typical)
Output Type Analog
Applications
Suitable for remote applications
Precision Compared to Thermistor Higher Precision

Equivalents and Alternatives for LM35 Temperature Sensor

DS18B20

• LM34

• LM94022

• DS1620

• DHT11

• RTD PT100

TMP36

Working Principle of LM35 Sensor

The LM35 sensor works by providing an output voltage that directly reflects the surrounding temperature in degrees Celsius. Its output is designed to change linearly, making it simple to interpret. The scale factor of the sensor is 10 mV for every degree Celsius.

For instance, if the temperature is 0°C, the sensor's output voltage will be 0V. As the temperature rises, the output increases proportionally—by 0.01V (or 10mV) for each degree Celsius. This predictable relationship between voltage and temperature allows you to easily calculate the temperature using the formula:

Vout = 10mV/°C × T

Here, Vout is the voltage from the sensor, and T is the temperature in Celsius. This straightforward mechanism makes the LM35 ideal for projects where you need reliable and accurate temperature readings.

Temperature Monitoring Circuit Using LM35

The LM35 temperature monitoring circuit is a simple and effective way to detect and indicate temperature changes using LEDs. This type of circuit is particularly useful in industrial settings or other applications where monitoring and controlling temperature is needed. The design of this circuit uses basic components and does not require a microcontroller, making it straightforward to build and understand.

In this setup, LEDs are used to indicate whether the temperature is below or above a set threshold. A green LED typically lights up when the temperature is below the threshold, while a red LED illuminates if the temperature exceeds the set limit.

To assemble this circuit, you will need an LM35 temperature sensor, an MC1458 operational amplifier (op-amp) IC, two BC547 NPN transistors, a green LED, a red LED, a 10KΩ variable resistor to adjust the threshold temperature, an 8.2KΩ resistor, a 10KΩ resistor, and three 680Ω resistors.

The simplicity and efficiency of this circuit make it a great choice for projects where you need to visually monitor temperature changes without relying on complex microcontroller programming.

Temperature Indicator Circuit with LM35 IC

Circuit Connections for LM35 Temperature Sensor

To set up the circuit, begin by connecting the MC1458 operational amplifier (op-amp) and the LM35 temperature sensor according to the circuit diagram. The output pin of the LM35 is connected to the non-inverting input of the MC1458 op-amp. The inverting input of the op-amp is linked to a variable resistor (VR1), which is used to adjust the temperature threshold.

The output of the MC1458 op-amp is then connected to the base of the first transistor (Q1) through a resistor (R3). The collector of Q1 is connected to the base of the second transistor (Q2) using another resistor (R5). The red LED is connected to the collector of Q1, while the green LED is attached to the collector of Q2, both through 680Ω resistors.

This arrangement allows the LEDs to indicate the temperature status—when the temperature is below the set threshold, the green LED lights up. When it exceeds the threshold, the red LED turns on, providing a simple and clear visual representation of temperature changes.

How LM35 Operates in a Circuit

The LM35-based temperature indicator circuit operates with a 5V DC power supply. It uses a red LED and a green LED to indicate whether the temperature is below or above the set threshold. The threshold temperature can be adjusted using the variable resistor VR1.

When the temperature is below the threshold, the MC1458 op-amp does not produce an output signal. As a result, the first transistor (Q1) remains off, and the second transistor (Q2) receives a voltage supply through resistor R2. This causes the green LED to light up, indicating that the temperature is within the desired range.

If the temperature exceeds the threshold, the MC1458 op-amp generates an output signal. This turns on the first transistor (Q1), activating the red LED to indicate that the temperature is above the threshold. At the same time, Q2 turns off because it no longer receives a bias, causing the green LED to switch off.

This simple circuit provides a clear visual indication of temperature status, making it easy to monitor and react to changes.

Interfacing LM35 with Arduino for Temperature Monitoring

Interfacing the LM35 temperature sensor with an Arduino is a straightforward process that allows you to measure temperature and display it easily. Follow these steps to set up the connections:

• Connect the Vcc pin of the LM35 to the 5V power supply on the Arduino.

• Connect the GND pin of the LM35 to the ground (GND) pin of the Arduino.

• Connect the Vout pin of the LM35 to the A0 analog input pin on the Arduino.

Once connected, the LM35 will send an analog voltage corresponding to the temperature to the Arduino, which can then process and display the readings on a serial monitor or other output device. This setup is simple and provides accurate temperature readings for various projects.

LM35 Interface with Arduino Microcontroller

Arduino Code for LM35 Sensor Integration

The Arduino can be easily programmed to read and display temperature data from the LM35 sensor. Below is a simple code example that continuously reads the analog voltage output of the LM35 sensor and converts it into a temperature reading in Celsius. This reading is then displayed on the serial monitor and an LCD screen.

#include // Include the Arduino core library

#include // Include the LiquidCrystal library for LCD display

const int lm35Pin = A0; // Analog pin connected to LM35 output

float temperature = 0.0; // Variable to store the temperature value

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Initialize LCD object with pin numbers

void setup() {

Serial.begin(9600); // Start serial communication

lcd.begin(16, 2); // Initialize the LCD with 16 columns and 2 rows

}

void loop() {

int rawValue = analogRead(lm35Pin); // Read analog value from LM35

temperature = (rawValue * 5.0 / 1023 - 0.5) * 100; // Convert the analog reading to Celsius

// Display temperature on the serial monitor

Serial.print("Temperature: ");

Serial.print(temperature);

Serial.println(" °C");

// Display temperature on the LCD

lcd.clear(); // Clear the LCD display

lcd.print("Temp: ");

lcd.print(temperature);

lcd.print(" C");

delay(1000); // Wait for 1 second before taking the next reading

}

The lm35Pin constant is assigned to the analog pin where the LM35 sensor's output is connected, which in this case is A0. This pin is used to read the sensor’s output, which is an analog voltage that changes according to the temperature.

Using the analogRead function, the Arduino reads the raw analog value from the LM35 sensor. The sensor typically provides an output voltage ranging from 0V to 1.5V within its specified temperature range. This voltage is then processed by the Arduino’s Analog-to-Digital Converter (ADC), which converts the analog voltage into a digital value.

For a 10-bit ADC, like the one used in Arduino, the range of digital values is from 0 to 1023. This means the sensor’s voltage output is mapped into this range, making it possible to calculate the temperature.

To convert the digital value back into a temperature in degrees Celsius, the relationship defined by the LM35 is used. The sensor has a sensitivity of 10 mV per degree Celsius, so for every 1°C change in temperature, the output voltage changes by 10 mV.

The formula for converting the analog value to temperature is:

Temperature (°C) = (AnalogValue × (Vref / 1023) – Voffset) / 0.01

Here' what each term represents:

• AnalogValue: The digital value from the ADC (between 0 and 1023).

• Vref: The reference voltage of the ADC, which is 5V in this case.

• Voffset: The sensor's voltage at 0°C, which is typically 0.5V.

• 0.01: The temperature coefficient, equivalent to 10 mV per degree Celsius.

In the provided code, this formula is simplified to:

Temperature (°C) = (rawValue × 5.0 / 1023 – 0.5) × 100

Here, 0.5 is subtracted to account for the offset voltage, and the output is scaled to get the temperature reading in Celsius. This straightforward calculation ensures you can easily interpret the sensor’s output in real-time.

Interfacing LM35 with PIC Microcontroller for Temperature Measurement

Connecting the LM35 to a PIC microcontroller is similar to interfacing it with an Arduino. The LM35's output pin (Vout) should be connected to an analog input pin of the PIC microcontroller. While the calculation for converting the analog value to temperature remains the same as in the Arduino example, the PIC code structure and libraries differ slightly.

Below is the PIC code for reading the LM35’s output and displaying the temperature on an LCD:

#include

#include

#include "lcd.h" // Include your LCD library header

#define _XTAL_FREQ 8000000 // Set the oscillator frequency

// Function to initialize ADC module

void ADC_Init() {

ADCON0 = 0b01000001; // Select AN0 channel and enable ADC

ADCON1 = 0b11000000; // Set result format to right-justified, Vref+ = VDD, Vref- = VSS

}

// Function to read ADC value from LM35

uint16_t ADC_Read(uint8_t channel) {

ADCON0bits.CHS = channel; // Select ADC channel

__delay_us(10); // Short delay

GO_nDONE = 1; // Start ADC conversion

while (GO_nDONE); // Wait for conversion to complete

return ((ADRESH << 8) + ADRESL); // Return ADC result

}

void main() {

// Initialize LCD

LCD_Init();

LCD_Clear();

// Initialize ADC

ADC_Init();

uint16_t adcValue; // Variable to store ADC value

float temperature; // Variable to store temperature value

while (1) {

adcValue = ADC_Read(0); // Read LM35 value from AN0 channel

temperature = (adcValue * 5.0 / 1023 - 0.5) * 100; // Convert to Celsius

// Display temperature on LCD

LCD_Clear();

LCD_String("Temperature:"); // Display label

LCD_GoTo(1, 0); // Move cursor to the next line

LCD_Float(temperature, 2); // Display temperature with 2 decimal places

__delay_ms(1000); // Delay for 1 second

}

}

Applications and Use Cases for LM35 Temperature Sensor

The LM35 temperature sensor is a versatile device that finds applications in various fields due to its accuracy and ease of use. Here's how you can use it in different scenarios:

Thermal Shutdown for Components and Circuits

The LM35 can protect circuits or components by monitoring their temperature and initiating a thermal shutdown if they exceed safe levels. This ensures that your project or device remains safe from overheating and potential damage.

Battery Temperature Monitoring

You can use the LM35 to measure the temperature of batteries. This helps in keeping the batteries within safe operating limits, preventing overheating and ensuring better performance and durability.

HVAC Applications

In HVAC systems, the LM35 helps in monitoring and maintaining optimal temperature conditions. By providing accurate readings, it supports efficient heating, ventilation, and air conditioning.

Body and Ambient Temperature Measurement

The LM35 is suitable for measuring both an object’s body temperature and the ambient temperature of its surroundings. This makes it useful in medical devices and environmental monitoring setups.

Soil Temperature Measurement

In agricultural and gardening projects, the LM35 can measure soil temperature. This information is helpful for planting and maintaining crops or plants under suitable conditions.

Weather Detection and Home Automation

In weather monitoring systems, the LM35 can track temperature changes, making it a key component for weather stations or home automation systems to control heating and cooling appliances.

Home Appliance Integration

• Thermostats

Thermostats use the LM35 to measure room temperature and adjust heating or cooling systems to maintain comfortable conditions.

• Refrigerators and Freezers

The LM35 can monitor internal temperatures, ensuring that food and other items are stored under proper conditions.

• Ovens and Microwaves

Some ovens and microwaves rely on the LM35 for accurate temperature control, which helps in cooking and safety measures.

• Air Conditioners

Air conditioners use the LM35 to measure the room temperature and regulate cooling operations for better efficiency.

• Water Heaters

The LM35 helps monitor water temperature in heaters, ensuring the water is heated safely and efficiently.

• Coffee Makers and Kettles

In coffee makers or kettles, the LM35 tracks water temperature to optimize the brewing or heating process.

• Irons

The LM35 can help regulate the ironing plate's temperature for smooth and safe operation.

• Slow Cookers and Crock-Pots

It maintains a consistent cooking temperature, ensuring food is cooked evenly over time.

• Heating Pads

The LM35 can regulate temperature in medical or comfort-related heating pads, enhancing user experience and safety.

• Aquarium Heaters

The LM35 ensures aquarium heaters maintain a suitable water temperature, creating a healthy environment for aquatic life.

• Space Heaters

It provides temperature feedback in space heaters, ensuring effective and safe operation.

• Dehumidifiers and Humidifiers

The LM35 helps monitor temperature in these devices, allowing them to adjust humidity levels effectively.

• Bread Makers

The LM35 tracks the baking chamber's temperature, ensuring bread is baked perfectly.

• Electric Blankets

You can use the LM35 in electric blankets to regulate temperature for comfort and safety.

• Wine Coolers

The LM35 monitors temperature in wine coolers to maintain optimal storage conditions for preserving wine.

About us

ALLELCO LIMITED

Allelco is an internationally famous one-stop procurement service distributor of hybrid electronic components, committed to providing comprehensive component procurement and supply chain services for the global electronic manufacturing and distribution industries, including global top 500 OEM factories and independent brokers.
Read more

Quick inquiry

Please send an inquiry, we will respond immediately.

Quantity

Popular Posts

HOT Part Number

0 RFQ
Shopping cart (0 Items)
It is empty.
Compare List (0 Items)
It is empty.
Feedback

Your feedback matters! At Allelco, we value the user experience and strive to improve it constantly.
Please share your comments with us via our feedback form, and we'll respond promptly.
Thank you for choosing Allelco.

Subject
E-mail
Comments
Captcha
Drag or click to upload file
Upload File
types: .xls, .xlsx, .doc, .docx, .jpg, .png and .pdf.
Max file size: 10MB