 Hello, Myself Ravindra Chauhan, Assistant Professor, Department of Electronics Engineering, Walsh and Newstop Technology, Solapur. So in this session, we will discuss how to interface the temperature sensor LM35 with the 8051. So outcome from this session, so students will be able to apply the concept of LM35 interfacing to develop the electronic product with the temperature controller. So outline of the sessions, first we will see the LM35 sensor, then the signals for the ADC 0804 and how to interface LM35 with the 8051 controller through ADC 0804. So this LM35 is the temperature sensor and this is coming in the form of integrated circuit. So LM35 is an integrated circuit temperature sensor and the output of LM35 is in the form of voltage and this output voltage varies based on the temperature around it. So with the change in the temperature, the output of the LM35 is changing and this is in the form of voltage and LM35 it is widely used because it is small in size, it is cheaper and the output is directly we are getting in the form of voltage. So that is the major advantages of the use of LM35 and this LM35 measures the temperature between minus 55 degree centigrade to 150 degree centigrade. So the wide range is there minus 55 to 150 degree centigrade. This LM35 as it is having the output in the voltage form, it is easily interfaced with the any microcontroller through analog to digital converter and no any calibration or any special circuit is required for this because the output is directly in the form of voltage and that we can easily convert into the digital value by using the ADC and the output of the LM35 is 10 milliholt for each degree of Celsius temperature. Means when the temperature is increased by 1 degree Celsius then the output of the LM35 is changed with the 10 milliholt. Now this is the look of the LM35 only the 3 terminals are there 1, 2, 3 and the output is plus 10 milliholt per degree centigrade and temperature increases by 1 degree Celsius then the output of LM is increased with the plus 10 milliholt. So for example, say sensor output is 100 milliholt so temperature is 10 degree Celsius. At 0 degree Celsius suppose the output is 0 milliholt at 1 degree Celsius the output is 10 milliholt similarly at 10 degree Celsius the output is 100 milliholt the same goes for the negative temperature reading also if the sensor is outputting minus 100 milliholt that means the temperature is minus 10 degree centigrade. Now this is the circuit configurations used for LM35 so this is the first output is 0 milliholt plus 10 milliholt per degree centigrade when we are operating this LM in the range 4 whole to 20 whole okay and then full range centigrade temperature sensor here the output is 1500 milliholt at 150 degree centigrade and minus 550 milliholt at minus 55 degree centigrade means when it is required to use this LM35 to measure the negative temperature then we have to select the full range configuration okay where it is required to use one resistor with the value equal to the applied voltage divided by 50 micro. Now this is the general block diagram how we can use the LM35 along with the 8051 so LM35 its output is in the voltage directly we can apply it to the ADC any ADC we can use then the micro controller for the processing and then the next output part okay so you can use the display or you can control the relays like that depends upon the application so the ADC 0804 now this is works with plus 5 whole and it has a resolution of 8 bits means the digital output is of 8 bit and major signals are clock in so clock in as input pin connected to an external clock source so to use the internal clock generator the two signals clock in and clock R pins are provided and these are connected to a capacitor and a resistor circuit okay so and the clock frequency is determined by 1 divided by 1.1 the value of R and C okay so the typical values are R is equal to 10 k ohm and C is equal to 150 picofarad where the frequency getting is 606 kHz now this V reference 2 is used for the reference voltage okay now suppose if this V reference by 2 this pin is open not connected then analog input voltage is in the range of 0 to 5 volt which is same as your VCC means the ADC can convert the 0 to 5 volt means the digital output will be 0 for 0 volt and FF for maximum 5 if the analog input range needs to be 0 to 4 volt then V reference by 2 is connected to 2 volt if now you want to change your input range from 0 to 5 to 0 to 4 then it is required to apply the 2 volts to V reference by 2 pin now this is the table which shows the relations of V reference by 2 to V input range okay so if not connected input voltage range for ADC is 0 to 5 for if it is connected to 2 the input range is 0 to 4 now if we are using this with the LM 35 so it is better to apply 1.28 volt to the V reference by 2 okay because now our input range is 0 to 2.56 volt so for 0 volt we will get digital output equal to 0 and for 2.56 volt we will get maximum digital output FF okay and now the step size you see here 2.56 divided by 256 by 256 because ADC is of 8 bit digital output is of 8 bit which comes equal to 10 milli volt okay and the LM 35 is also providing the 10 milli volt output when the temperature is changing by 1 degree Celsius so for that you apply 1.28 volt to the V reference by now the some other signals are there WR okay it is to start the conversion so send low to high transition on this INTR which indicates the end of conversion then the read signal is there to enable the digital output and it is required high to low pulse on the RDP in the CS it is used to active the input and it is also enabling the ADC 0804 so this is the interfacing schematic of LM 35 with the 8051 so this is the 8051 this is the LM 35 whose output is connected to this ADC input okay and this RD and write operation is controlled by the processor so CS must be grounded so that this ADC 0804 can be active the algorithm for this so first make CS 0 okay then to start the conversion send low to high pulse to pin right okay then once the conversion is started then it is required to monitor the INTR pin to find out whether the conversion is finished or not okay so when INTR is low the conversion is finished if INTR is high means it is the conversion is going on so keep polling until INTR goes low CS equal to 0 and send high to pulse to the read pin to get the digital data from the ADC references thank you