- 1 Circuit Diagram of Celsius Scale Thermometer using AT89C51 and LM35:
- 1.1 Celsius Scale Themometer Circuit Design:
- 1.2 Working of Celsius Scale Thermometer Circuit using AT89C51:
- 1.3 Algorithm Steps to Write Circuit code for Celsius Scale Thermometer:
- 1.4 Applications of Celsius Scale Thermometer Circuit:
- 2 Related Articles
This article demonstrates the design, development and operation of the Celsius scale thermometer using LM35 and microcontroller AT89C51. The circuit contains the analog temperature sensor LM35 which has the advantage of providing an output directly proportional to the Celsius temperature, without having the need to be calibrated. It consists of the 8 bit analog to digital converter ADC0808, which uses the successive approximation conversion technique. The ADC0808 is controlled by the microcontroller which processes its output to display the resultant temperature reading. This article gives details about the microcontroller program, circuit design and the circuit operation. Before going to know about this circuit, get an idea about Digital Temperature Sensor.
Principle behind the Circuit:
The circuit works on the principle of analog to digital conversion. The temperature is sensed by a analog temperature sensor and this analog value is converted to a digital value using an ADC. A microcontroller then processes the digital signal to display the temperature reading in Celsius on the display screen.
Also Read the Post: Thermistor Temperature Sensing Alarm Circuit
Circuit Diagram of Celsius Scale Thermometer using AT89C51 and LM35:
Celsius Scale Themometer Circuit Design:
The input part of the circuit consists of the LM35 and ADC0808. The LM35 circuit simply consists of selecting a load resistor between the output pin and ground. The value of this resistor is determined by the supply voltage which is about 5V. Here we select a 470K ohms resistor. The ADC0808 input circuit involves designing a potential divider circuit to get the required Vref value. Since LM35 produces output voltage at the rate of 10mV/ degree Celsius, the required step size for ADC is around 10mV. This results in the value of Vref being 2.56V. This voltage is provided by using a potential divider arrangement of 2.2K resistor and a 2K pot.
Microcontroller Circuit Design:
Designing the circuit mostly involves designing the microcontroller interfacing. Here the ADC and LCD need to be interfaced to the microcontroller AT89C51
The clock signal of the ADC0808 is given from the microcontroller. This pin is connected to port pin P1.0 of the microcontroller. The Start, EOC and OE pins are connected to pins P1.1, P1.2 and P1.3 respectively. The ALE pin and address pins are connected to rest of the port P1 pins. The data output pins are connected to port P3.
The RS, RW and EN pins are connected to port pins P0.0, P0.1 and P0.2 respectively. The data pins are connected to port P2 of the microcontroller.
The oscillator circuit consists of a crystal oscillator with oscillation frequency of 12MHz and two ceramic capacitors, each of 15pF, to ensure stability.
The reset circuit is designed using a resistor of 10K and an electrolyte capacitor of 10uF to ensure a reset pulse width of 100ms and a reset voltage of 1.2V.
Working of Celsius Scale Thermometer Circuit using AT89C51:
The ambient temperature is sensed by LM35 temperature sensor which produces an output voltage proportional to the temperature at a rate of 10mV per degree celsius. This analog voltage is fed to the analog to digital converter which is an 8 bit converter working on the principle of succesive approximation conversion. The analog to digital converter is controlled by a microcontroller. As per the program, the input line is first selected by sending output signals from the microcontroller to the address pins of the ADC. A high logic signal is then given to the ALE pin of the ADC to latch the address. A high logic signal is also given to the Start pin of ADC to start the succesive approximation register. After sometimes a low logic signal is given to both ALE and Start pins to start the conversion. After some time when the EOC pin of ADC goes low, microcontroller receives an interrupt. This indicates end of conversion. The OE pin is then given a high logic signal to receive the digital output from ADC. After sometime OE is given low logic signal to store the converted value to the register.The microcontroller then processes the digital output in hexadecimal form to get the value in decimal form. This value is then displayed on the LCD screen.
Are you interested to get some more project circuits? Then visit electronics mini projects
Algorithm Steps to Write Circuit code for Celsius Scale Thermometer:
The following algorithm needs to be followed to write the code in C language.
- Give clock signal to the ADC using timer polling method. This is done by first selecting the timer mode by assigning a hexadecimal value to the TMOD register. Since here required clock signal is 500 kHz, a time delay of 2 microseconds need to be generated. This is done by assigning appropriate values to the TH and TL register.
- Set ALE and Start pins.
- Set certain time delay.
- Clear ALE and start pins.
- Wait for the conversion till EOC is high.
- Once EOC goes low, set OE.
- Repeat step 3.
- Clear OE.
- Store output from ADC in a hexadecimal variable.
- Convert the hexadecimal value into decimal value.
- Initialize the LCD by sending proper commands.
- Send data to the LCD containing the temperature reading.
Applications of Celsius Scale Thermometer Circuit:
- It can be used at mobile places like cars to keep a track of the temperature.
- It can be used to control the switching of loads like motors, heaters based upon the temperature.
- It can also be used at homes to get the temperature reading.
Limitations of the Circuit:
- It requires additional analog to digital conversion.
- This circuit can only measure values in Celsius.