Skip to main content

Interfacing LM35 Temperature Sensor with Arduino Uno


In this blog, we will be discussing interfacing LM35 temperature sensor with Arduino Uno.

# Sensor Data Sheet:

Working Voltage:           5V
Working Current:           60 microAmperes
Range:                            -55 to 120 ( in Degree Celcius )
Scale Factor:                  0.01V/Degree Celcius

# Pin-Out:



Vcc = 5V ... Power Supply Pin
Output pin = for taking the sensor reading
Gnd ... Power Supply Pin

# Arduino Connection:




# Working:



LM35 Temperature Sensor basically works on the principle of change in resistance with temperature.


# Arduino Code:

int sensor = A0;  //define your analog input pin here

void setup() {

  pinMode(sensor,INPUT);
  Serial.begin(9600);

}

void loop() {

  float a = analogRead(sensor); 
  float b = (5*a*100)/1024;
  
  //here we are converting the volts(data from sensor) into temperature(degree celcius)
  //the analog pin provides the input in form of 10 bits....i.e. from 0 to 1023
  //so it needs to be converted into float...
  //5 is used bcoz 5V is applied as Vcc to the LM35 sensor
  
  Serial.println("Temperature is: ");
  Serial.print(b);
  Serial.print(" in Celcius.");
  delay(250);
  
}

# Applications:

1. To measure the temperature


To download the code click here

Comments

  1. I have just gone through your blog......your information is so valuable. Thanks for sharing this information. HEATTEC SYSTEMS (PRIVATE) LIMITED made a commitment towards the research and development of new and improved products, abortion thus keeping in mind diversified customers to provide the customers with superior products and services for their individual needs.Thermocouple Sensor

    ReplyDelete

Post a Comment

Popular posts from this blog

Interfacing 4x4 Matrix Keypad with Arduino Uno

In this blog, we will be discussing interfacing 4x4 Matrix Keypad with Arduino Uno. Matrix keypad basically consists of push buttons.  At a particular instant, if we know which push button is pressed, we can say which character was given by the user. # Module Data Sheet: Working Current:   30mA Working Voltage:   5-24V # Pin-Out: X1, X2, X3, X4 are rows. Y1, Y2, Y3, Y4 are columns. # Arduino Connection: # Working: The working is simple.  We know that at a time only one key will be pressed. So we have to check which key is pressed at that given time. There are 4 rows and 4 columns. We will first make Row R1 high. Then check whether C1, C2, C3 or C4 is high or not. If not we will proceed to the next row. For example... Let's say we found C2 to be high when R3 was high. => The key (3,2) was pressed i.e. Key '8' was pressed. This process will keep on repeating very fast. # Arduino Code: #include ...

Theory of Arduino Wire Library

In this blog, we will be discussing the Wire Library. Wire Library is used for communication between two boards in the I2C Communication Protocol. In Arduino Uno, the Analog Pins A4 and A5 are used for this purpose. A4 = SDA ( Data Bus ) A5 = SCL ( Clock Bus ) The basic functions used in the Wire Library are as follows... begin() requestFrom() beginTransmission() endTransmission() write() available() read() SetClock() onRecieve() onRequest() Now lets start discussing about these functions... 1.Wire.begin() or Wire.begin(Slave_Address) Wire.begin() intializes I2C communication as an Master Device. Wire.begin(Address) initializes I2C communication as a Slave Device. The Address is of 7 bit and thus at max, we can connect 127 devices in this protocol. The Address is generally specified in the datasheet. The address up to 8 is reserved by the manufacturer and thus can't be used.  2. Wire.requestFrom(Slave_Address, No. of bytes,'TRUE'/'FALS...