LM35 Interfacing with ARM MBED

Overview of LM35

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)

Interfacing LM35 With ARM MBED

 

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

ARM mbed 1768 LPC1768 Board
ARM mbed 1768 Board
1
LM35 Temperature Sensor
LM35 is a sensor which is used to measure temperature. It provides electrical output proportional to the temperature (in Celsius).
1

Downloads

LM35_mbed_uvision5_lpc1768 Download
Ad