LM35D Temperature Sensor (TO-92)

From ElectroDragon Wiki
Revision as of 20:56, 27 November 2016 by Chao (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Information

LM35 is the United States NS (National Semiconductor) produced analog temperature sensor, the output voltage is linearly proportional to the Celsius temperature, output at 0 ℃ 0V, the temperature is increased by 1 ℃, the output voltage increases 10mV. Temperature range -55 ~ 150 ℃, an accuracy of 0.75 ℃, precision room temperature up to 0.25 ℃. Common TO-92 package pinout shown in Figure 6, in a temperature range of 2 ℃ ~ 150 ℃ typical application circuit shown below. LM35-1.jpg

Arduino Wiring

  • Lm35-2.jpg

The main idea of the program design: Arduino Uno controller via analog input port measurements LM35 output voltage value, and then by the scale factor 10mV / ℃ temperature values calculated. Meanwhile, at the time of 100 ℃, LM35 output voltage is 1000mV, in the internal reference voltage range Arduino Uno controller, so using the internal 1.1V reference voltage.

int Digital_Value=0;
float temp_Value=0;
void setup(){
  Serial.begin(9600);      //baud rate 9600
  //sensing range 0~100℃,output voltage 0~1V,use internal 1.1V reference voltage
analogReference(INTERNAL);
}
void loop(){
   Digital_Value=analogRead(A0);   //read analog voltage value
   temp_Value=(float)Digital_Value/1023*110.00;//change to Celsius value
   Serial.print("Temperature for LM35 is: ");
   Serial.println(temp_Value,2);  //send temperature data
   delay(1000);   //flash once per second
}

Documents