All submissions

Interface LM35 temperature sensor

Solving Approach:

How do you plan to solve it?

 

Code

const int lm35_pin = A0;
const int offset_pin = A1;

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

void loop() 
{
  
  float offset_voltage = analogRead(offset_pin) * (5000.0 / 1024.0);
  
  
  float sensor_voltage = analogRead(lm35_pin) * (5000.0 / 1024.0);
  
  
  float temperature = (sensor_voltage - offset_voltage) / 10.0;
  
 
  Serial.print("Temperature = ");
  Serial.print(temperature, 1);
  Serial.println(" °C");
  
  delay(1000);
}



 

Output

Video

Add video of output (know more)

 

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!