LM35 Interfacing with Particle Photon

Introduction

LM35

LM35 is a temperature sensor which can measure temperature in the range of -55°C to 150°C.

It is a 3-terminal device that provides analog voltage proportional to the temperature. Higher the temperature, higher is the 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.

 

Interfacing Diagram 

Interfacing LM35 withParticle Photon

Example

Measuring temperature of surroundings using LM35 and displaying it on serial monitor.

Here, LM35 output is given to analog pin A1 of Particle Photon. This analog voltage is converted to its digital form and processed to get the temperature reading.

constint lm35_pin = A1;	/* LM35 O/P pin */

void setup() {
Serial.begin(9600);
}

void loop() {
int adc_value;
float temp_val;
adc_value = analogRead(lm35_pin);	/* Read Temperature */
temp_val = (adc_value * 0.80);	/* Convert adc value to equivalent voltage */
  /* 3.3V/4095= 0.80 */
temp_val = (temp_val/10);	/* LM35 gives output of 10mv/°C */
Serial.print("Temperature = ");
Serial.print(temp_val);
Serial.print(" Degree Celsius\n");
delay(1000);
}

 

Output of LM35

 


Components Used

Particle Photon
PHNTRAYH
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 Download
Ad