Thursday, 5 April 2018

Arduino with LM35

LM35- Temperature sensor:

LM35 is a precision IC temperature sensor with its output proportional to the temperature (in degree Celsius).
LM35_02
LM35 terminals


Hardware Required:
  • LM35 sensor
  • Arduino

Software Required:
  • Arduino UNO

Steps to Connect:

Step 1 : Connect 5v supply to the Vcc of arduino

Step 2 : Connect GND of LM35 to GND of arduino

Step 3: Connect Analog pin of LM35 to the Analog pin A0 of arduino



environmentalmonitorfritzing_bb3
Arduino with LM35
The Analog to Digital Converter (ADC) converts analog values into a digital approximation based on the formula ADC Value = sample * 1024 / reference voltage (+5v). So with a +5 volt reference, the digital approximation will = input voltage * 205

Code:

float temp;
int tempPin = 0;

void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125;   // to obtain temperature in celsius
Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
delay(1000);
}

Go to serial monitor and see the temperature readings

No comments:

Post a Comment

Arduino with Buzzer

Buzzer: A buzzer or beeper is an audio signalling device,which may be mechanical, electromechanical, or piezoelectric (piezo for short ra...