Calculation Of Temperature Using Lm35






LM35 Temperature Calculation: Precision Sensor Readings Explained


LM35 Temperature Calculation

Accurately determine temperature from your LM35 sensor readings.

LM35 Temperature Calculator


The raw digital value read from your Analog-to-Digital Converter (e.g., 0-1023 for 10-bit ADC).
Please enter a valid non-negative ADC reading within the resolution range.


The reference voltage supplied to your ADC (e.g., 5V or 3.3V).
Please enter a valid positive ADC reference voltage (e.g., 3.3 to 5.0).


The resolution of your ADC in bits (e.g., 8, 10, 12, 16 bits).
Please enter a valid ADC resolution between 8 and 16 bits.


Calculated Temperature

— °C / — °F

Voltage per ADC Step (LSB): — V/step

LM35 Output Voltage: — V

Temperature in Celsius: — °C

Temperature in Fahrenheit: — °F

The LM35 temperature calculation is based on its linear output of 10mV per degree Celsius. The ADC converts this analog voltage into a digital value, which is then scaled back to voltage and finally to temperature.

ADC Reading vs. Temperature Relationship

This chart illustrates the linear relationship between the ADC digital reading and the corresponding temperature in Celsius and Fahrenheit, based on the provided ADC parameters.

LM35 Sensor Characteristics Table

Key Specifications of the LM35 Temperature Sensor
Characteristic Value Unit Notes
Output Scale Factor 10 mV/°C Linear output proportional to Celsius temperature
Operating Temperature Range -55 to +150 °C Full range for LM35, LM35C, LM35CA, LM35D variants
Accuracy (at 25°C) ±0.5 °C Typical for LM35, LM35A, LM35CA
Supply Voltage Range 4 to 30 V Wide operating voltage range
Quiescent Current 60 µA Very low self-heating
Output Impedance 0.1 (at 2mA load) Ω Low output impedance for easy interfacing

What is LM35 Temperature Calculation?

The LM35 temperature calculation refers to the process of converting the analog voltage output from an LM35 series precision integrated-circuit temperature sensor into a meaningful temperature reading, typically in Celsius or Fahrenheit. The LM35 is a popular and reliable sensor known for its linear output, which directly corresponds to Celsius temperature. Unlike thermistors, which require complex linearization, the LM35 simplifies temperature measurement significantly, making it ideal for hobbyists and professional engineers alike.

This calculation is crucial for any application where environmental temperature needs to be monitored or controlled using a microcontroller or data acquisition system. Since microcontrollers typically read digital values, the analog output of the LM35 must first be converted by an Analog-to-Digital Converter (ADC). The LM35 temperature calculation then involves scaling this digital reading back to voltage and subsequently to temperature, using the sensor’s known output characteristic of 10mV per degree Celsius.

Who Should Use It?

  • Electronics Enthusiasts: For DIY projects involving temperature monitoring, weather stations, or home automation.
  • Students and Educators: As a fundamental component in learning about sensors, ADCs, and microcontroller interfacing.
  • Engineers and Developers: For rapid prototyping, environmental monitoring systems, industrial control, and embedded systems design.
  • Researchers: In experiments requiring accurate and stable temperature data collection.

Common Misconceptions about LM35 Temperature Calculation

  • “It’s plug-and-play, no calculation needed”: While the LM35 provides a linear output, it’s an analog voltage. An ADC is required to convert it to a digital value, and then a calculation is needed to interpret that digital value as temperature.
  • “LM35 directly outputs Celsius”: The LM35 outputs a voltage that is *proportional* to Celsius, not a digital Celsius value itself. The 10mV/°C factor is key to the LM35 temperature calculation.
  • “All ADCs are the same”: The ADC’s reference voltage and resolution are critical parameters that directly impact the accuracy of the LM35 temperature calculation. A 10-bit ADC with a 5V reference will yield different results than a 12-bit ADC with a 3.3V reference for the same LM35 output voltage.
  • “No calibration needed”: While LM35 sensors are factory-calibrated, external factors like power supply noise, ADC inaccuracies, and wiring resistance can introduce errors. For high-precision applications, a simple one-point calibration might be beneficial.

LM35 Temperature Calculation Formula and Mathematical Explanation

The LM35 temperature calculation involves a series of steps to convert the raw digital reading from an ADC back into a temperature value. The core principle relies on the LM35’s output characteristic: for every 1°C increase in temperature, its output voltage increases by 10mV.

Step-by-Step Derivation:

  1. Determine the Voltage per ADC Step (LSB Voltage):

    The ADC converts an analog voltage into a digital number. The smallest voltage change that the ADC can detect is called the Least Significant Bit (LSB) voltage. This depends on the ADC’s reference voltage (Vref) and its resolution (number of bits).

    LSB_Voltage = Vref / (2^Resolution)

    Where:

    • Vref is the ADC’s reference voltage (e.g., 5V, 3.3V).
    • Resolution is the number of bits of the ADC (e.g., 10 for a 10-bit ADC).
    • 2^Resolution represents the total number of possible digital steps (e.g., 1024 for 10-bit).
  2. Calculate the LM35 Output Voltage:

    Once you have the LSB voltage, you can convert the raw digital ADC reading back into the actual analog voltage that the LM35 sensor was outputting.

    V_LM35 = ADC_Reading * LSB_Voltage

    Where:

    • ADC_Reading is the digital value obtained from the ADC (e.g., 0-1023).
    • LSB_Voltage is the voltage per ADC step calculated in the previous step.
  3. Convert LM35 Voltage to Celsius Temperature:

    The LM35 sensor has a linear output of 10mV per degree Celsius. To get the temperature in Celsius, you simply divide the LM35 output voltage by this scale factor.

    Temperature_Celsius = V_LM35 / 0.01 (since 10mV = 0.01V)

  4. Convert Celsius to Fahrenheit (Optional):

    If you need the temperature in Fahrenheit, use the standard conversion formula:

    Temperature_Fahrenheit = (Temperature_Celsius * 9/5) + 32

Variables Table for LM35 Temperature Calculation

Key Variables in LM35 Temperature Calculation
Variable Meaning Unit Typical Range
ADC_Reading Digital value from ADC (unitless) 0 to (2^Resolution – 1)
Vref ADC Reference Voltage Volts (V) 3.3V – 5V
Resolution ADC Resolution bits 8, 10, 12, 16
LSB_Voltage Voltage per ADC Step Volts/step Varies based on Vref/Resolution
V_LM35 LM35 Output Voltage Volts (V) 0V to ~1.5V (for -55°C to 150°C)
Temperature_Celsius Temperature in Celsius °C -55°C to 150°C
Temperature_Fahrenheit Temperature in Fahrenheit °F -67°F to 302°F

Practical Examples (Real-World Use Cases)

Understanding the LM35 temperature calculation is best done through practical examples. These scenarios demonstrate how different ADC parameters affect the final temperature reading.

Example 1: Standard 10-bit ADC with 5V Reference

Imagine you’re using an Arduino Uno, which typically has a 10-bit ADC and a 5V analog reference. Your LM35 sensor is connected to an analog input pin.

  • ADC Reading: 307
  • ADC Reference Voltage (Vref): 5.0 V
  • ADC Resolution: 10 bits

Calculation Steps:

  1. LSB Voltage: 5.0 V / (2^10) = 5.0 V / 1024 = 0.0048828125 V/step
  2. LM35 Output Voltage: 307 * 0.0048828125 V/step = 1.4990234375 V
  3. Temperature in Celsius: 1.4990234375 V / 0.01 V/°C = 149.90 °C
  4. Temperature in Fahrenheit: (149.90 * 9/5) + 32 = 299.82 + 32 = 331.82 °F

Interpretation: An ADC reading of 307 with these parameters indicates a very high temperature of approximately 149.9°C, which is near the upper limit of the LM35’s operating range. This demonstrates the precision of the LM35 temperature calculation.

Example 2: High-Resolution 12-bit ADC with 3.3V Reference

Consider a more advanced system, like an ESP32 or a custom embedded board, using a 12-bit ADC with a 3.3V reference voltage for better power efficiency and finer resolution.

  • ADC Reading: 1241
  • ADC Reference Voltage (Vref): 3.3 V
  • ADC Resolution: 12 bits

Calculation Steps:

  1. LSB Voltage: 3.3 V / (2^12) = 3.3 V / 4096 = 0.0008056640625 V/step
  2. LM35 Output Voltage: 1241 * 0.0008056640625 V/step = 0.9999999999 V (approximately 1.0 V)
  3. Temperature in Celsius: 0.9999999999 V / 0.01 V/°C = 99.99 °C
  4. Temperature in Fahrenheit: (99.99 * 9/5) + 32 = 179.982 + 32 = 211.98 °F

Interpretation: An ADC reading of 1241 with a 12-bit ADC and 3.3V reference corresponds to approximately 100°C. This example highlights how a higher resolution ADC provides more granular readings, leading to more precise LM35 temperature calculation, even with a lower reference voltage.

How to Use This LM35 Temperature Calculator

This LM35 Temperature Calculator is designed for ease of use, providing instant results for your LM35 temperature calculation needs. Follow these simple steps to get accurate temperature readings:

  1. Input ADC Reading (Digital Value): Enter the raw digital value that your Analog-to-Digital Converter (ADC) provides. This is the number your microcontroller reads from the analog pin connected to the LM35. Ensure this value is within the valid range for your ADC’s resolution (e.g., 0-1023 for a 10-bit ADC).
  2. Input ADC Reference Voltage (Vref): Enter the reference voltage that your ADC uses. This is typically the voltage supplied to the ADC’s Vref pin, often 5V or 3.3V, but can vary depending on your specific microcontroller or ADC module.
  3. Input ADC Resolution (bits): Specify the resolution of your ADC in bits. Common resolutions include 8, 10, 12, or 16 bits. This determines the number of discrete steps the ADC can distinguish.
  4. View Results: As you type, the calculator will automatically perform the LM35 temperature calculation in real-time. The primary result will show the temperature in both Celsius and Fahrenheit.
  5. Review Intermediate Values: Below the primary result, you’ll find key intermediate values: the Voltage per ADC Step (LSB), the calculated LM35 Output Voltage, and the temperature in Celsius and Fahrenheit separately. These values help you understand each stage of the calculation.
  6. Reset Button: If you wish to start over or clear all inputs, click the “Reset” button. It will restore the default values.
  7. Copy Results Button: To easily save or share your results, click the “Copy Results” button. This will copy the main temperature, intermediate values, and key assumptions to your clipboard.

How to Read Results and Decision-Making Guidance:

The results provide a clear temperature reading. If your calculated temperature is outside the LM35’s typical operating range (-55°C to 150°C), it might indicate an issue with your sensor connection, ADC setup, or an incorrect input value. Always cross-reference with a known good thermometer if possible, especially during initial setup. The intermediate values are useful for debugging; for instance, if the LM35 Output Voltage is unexpectedly high or low, it could point to a wiring problem or a faulty sensor. Understanding the LM35 temperature calculation helps in making informed decisions about sensor placement, power supply, and data interpretation in your projects.

Key Factors That Affect LM35 Temperature Calculation Results

Accurate LM35 temperature calculation depends on several factors beyond just the sensor itself. Understanding these can help in troubleshooting and optimizing your temperature sensing system.

  1. ADC Reference Voltage (Vref) Accuracy: The Vref is the benchmark against which the ADC measures the LM35’s output. Any inaccuracy or instability in Vref will directly translate into errors in the calculated temperature. Using a stable, precise voltage reference is crucial for reliable ADC temperature conversion.
  2. ADC Resolution: A higher ADC resolution (more bits) means more discrete steps for the same voltage range, leading to a finer granularity in temperature measurement. For example, a 12-bit ADC can distinguish smaller voltage changes than a 10-bit ADC, resulting in more precise LM35 temperature calculation. Conversely, a low-resolution ADC might round off readings, reducing accuracy. For more details, see our ADC Resolution Explained Guide.
  3. LM35 Power Supply Stability: While the LM35 is designed to be relatively immune to power supply variations, a noisy or unstable supply can introduce ripple into its output voltage, affecting the ADC reading and thus the LM35 temperature calculation. Decoupling capacitors near the LM35 are often recommended.
  4. Wiring and Noise: Long wires can act as antennas, picking up electromagnetic interference (EMI) which adds noise to the analog signal. This noise can corrupt the LM35’s output voltage before it reaches the ADC, leading to erroneous temperature readings. Shielded cables or keeping wires short can mitigate this.
  5. Self-Heating of LM35: The LM35 itself consumes a small amount of power (typically 60µA quiescent current), which can cause a slight increase in its own temperature, especially in still air. While minimal, in very sensitive applications or enclosed spaces, this self-heating can introduce a small offset.
  6. Grounding Issues: Proper grounding is paramount in analog circuits. Ground loops or poor grounding can create voltage differences between the LM35’s ground and the ADC’s ground, leading to offset errors in the voltage measurement and impacting the LM35 temperature calculation.
  7. Temperature Range of LM35: The LM35 has a specified operating range (-55°C to 150°C). Attempting to measure temperatures outside this range will result in inaccurate or clipped readings. Ensure the sensor is used within its specified limits.
  8. Microcontroller Processing Speed: While not directly affecting the calculation formula, the speed at which the microcontroller samples the ADC and performs the LM35 temperature calculation can be a factor in dynamic environments. Slow sampling rates might miss rapid temperature changes. For tips on interfacing, check out our Microcontroller Temperature Sensing Tutorial.

Frequently Asked Questions (FAQ)

Q1: What is the typical accuracy of an LM35 sensor?

A1: The LM35 series offers good accuracy. At 25°C, the LM35 typically has an accuracy of ±0.5°C. Variants like the LM35A and LM35CA offer even better precision, while the LM35D is a lower-cost option with slightly less accuracy.

Q2: Can the LM35 measure negative temperatures?

A2: Yes, the LM35 can measure negative temperatures down to -55°C. However, this requires a dual power supply (e.g., +5V and -5V) for the LM35 to output negative voltages. If powered only by a single positive supply, it can only measure positive temperatures.

Q3: Why is my LM35 reading inaccurate?

A3: Inaccuracies in LM35 temperature calculation can stem from several factors: an unstable ADC reference voltage, electrical noise in the circuit, incorrect ADC resolution settings, poor grounding, or even self-heating of the sensor in confined spaces. Always double-check your wiring and power supply stability.

Q4: How does ADC resolution affect the LM35 temperature calculation?

A4: ADC resolution directly impacts the precision of your temperature reading. A higher resolution (e.g., 12-bit vs. 10-bit) means the ADC can distinguish smaller voltage changes, leading to a more granular and accurate temperature measurement. For example, a 10-bit ADC with 5V Vref has a step size of ~4.88mV, while a 12-bit ADC has ~1.22mV, allowing for finer temperature distinctions.

Q5: Is the LM35 suitable for high-temperature environments?

A5: The LM35 has an operating range up to 150°C, which is suitable for many industrial and automotive applications. However, for extremely high temperatures (e.g., above 200°C), other sensor types like thermocouples or RTDs would be more appropriate. For more on different sensor types, explore our Thermistor Calculator.

Q6: Do I need to calibrate the LM35?

A6: The LM35 sensors are factory-calibrated and inherently linear, so extensive calibration is usually not required for most applications. However, for critical applications demanding very high precision, a simple one-point calibration against a known accurate thermometer can compensate for minor system-level offsets (e.g., ADC inaccuracies, voltage drops).

Q7: What is the difference between LM35 and a thermistor?

A7: The LM35 is a linear integrated circuit temperature sensor with a voltage output directly proportional to Celsius temperature (10mV/°C). Thermistors, on the other hand, are resistors whose resistance changes non-linearly with temperature. Thermistors require more complex linearization circuits or lookup tables for accurate temperature conversion, whereas the LM35 temperature calculation is straightforward due to its linear output.

Q8: Can I use the LM35 with any microcontroller?

A8: Yes, the LM35 can be interfaced with virtually any microcontroller that has an Analog-to-Digital Converter (ADC). Popular choices include Arduino, ESP32, Raspberry Pi (with an external ADC), and various PIC or AVR microcontrollers. The key is to correctly configure the ADC’s reference voltage and resolution in your code for accurate LM35 temperature calculation.

Related Tools and Internal Resources

Enhance your understanding and projects related to temperature sensing and electronics with these valuable resources:

© 2023 LM35 Temperature Calculation. All rights reserved.



Leave a Comment