The LM35 series are precision integrated-circuit temperature sensor, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensorscalibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35's low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°C temperature range.
LM35 Pin Outs:
Mainly the LM35 has 3 pins, which are:
More information can be seen on the Datasheet of the LM35
How to Interface LM35 With the 8051?
The Only method to interface the LM35 with the 8051 microcontroller is by using the internal ADC of 8051. With this method we can read the analogue voltage outputting the LM35 and so we can convert this value to temperature (since the LM35 has a Linear + 10.0 mV/°C scale factor).
The Design for the system was controller by a microcontroller, which is the T89C51AC2. The microcontroller is the core of the system, which has a function of a monitor element and gives display the reading to the user. The T89C51AC2 has an integrated ADC, which has a resolution of 10-bit (Precision conversion) or 8-bit (Standard Conversion). Eight ADC channels are available for sampling of the external sources AN0 to AN7. An analog multiplexer allows the single ADC converter to select one from the 8 ADC channels as ADC input voltage (ADCIN). ADCIN is converted by the 10-bit cascaded potentiometer ADC. The conversion time of the ADC is of 16 microseconds and the Positive External Reference Voltage Range (VAREF) is between 2.4 to 3.0 Volt (typical). The input voltage (ADCIN) must be between 0 to 3V maximum.
The LM35 has a scale factor of 10mV per 1oC, so the range of temperature set was between 0 oC and 100 oC. The LM35 would give a total output voltage 1v since every degree has a value of 10mv and so a range of 0 to 1V. This means that when the temperature is 0 oC then the output voltage is 0V. At 100 oC * 10mV = 1V (o/p voltage).
As explained the microcontroller will get the analogue voltage, which is generated, from the LM35 plus the gain block. After this part the microcontroller will need certain routines so that it can convert this 8-bit data (ADDH register for the ADC of the micro) to a specific Temperature varying from 0oC to 100oC. This value of temperature is then display on the LCD 20 by 4. The block diagram of the system is shown below.
So the maximum voltage that the LM35 will give is 1V and the maximum voltage that the microcontroller will input is of 2.5V (since the VAREF is set to 2.5V). We can conclude that we need to have a gain so that the LM35 voltage must be increased to 2.5V (VAREF) because when making 2.5V (VREF) / 1V (Max. Voltage) the answer will be of a 2.5 gain.
8051 ADC 'C' Program - Polling method
8051 ADC 'C' Program - Interrupt method