LM35 Interfacing with ARM MBED
LM35 is a sensor which is used to measure temperature. It provides electrical output proportional to the temperature (in Celsius).
Overview of LM35

LM35 is a temperature sensor that can measure temperature in the range of -55°C to 150°C.
It is a 3-terminal device that provides an analog voltage proportional to the temperature. The higher temperature, is higher output voltage.
The output analog voltage can be converted to digital form using ADC so that a microcontroller can process it.
For more information about LM35 and how to use it, refer the topic LM35 Temperature Sensor in the sensors and modules section.
Connection Diagram of LM35 with ARM MBED (LPC1768)

Measuring temperature using LM35 and LPC1768 ARM MBED
Measuring temperature of surroundings using LM35 and displaying it on serial monitor.
Here, LM35 output is given to analog pin p15 of ARM MBED board. This analog voltage is converted to its digital form and processed to get the temperature reading.
LM35 Code for LPC1768 ARM MBED
#include "mbed.h"
AnalogIn LM35(p15);
int main() {
float value;
while(1) {
value = ((LM35.read()*3276)/10);
printf("Temp: %2.2f degree C\r\n", value);
wait(1);
}
}
Output of LM35

Components Used
Powered by


LM35 is a sensor which is used to measure temperature. It provides electrical output proportional to the temperature (in Celsius).
926-LM35DZ/NOPB
Downloads
Comments1
Join the discussion — share a question or tip.
- SW
In offline mode, keil should have suitable compiler. I am not able to run ur project in keil, because it is showing following message while building. *** Target 'LM35_mbed' uses ARM-Compiler 'Default Compiler Version 5' which is not available. *** Please review the installed ARM Compiler Versions: 'Manage Project Items - Folders/Extensions' to manage ARM Compiler Versions. 'Options for Target - Target' to select an ARM Compiler Version for the target. *** Build aborted. Build Time Elapsed: 00:00:00