A Celsius Scale Digital Thermometer is an electronic device that can measure the temperature of its surroundings and convert its Analog data into digital form through a digital display. Today we will be going to make such type of Celsius scale digital thermometer using an AT89C51 microcontroller and LM35 temperature sensor. LM35 has the advantage of providing direct output according to the Celsius scale without any need for calibration.
This project also contains an 8-bit Analog digital converter i.e. ADC0804 which can process an approximate conversion technology. The output of the temperature sensor is shown in the LCD display by converting through ADC0804 and AT89C51 microcontrollers.
Must Read Password Based Door Lock System Using 8051 Microcontroller
Principle Behind Celsius Scale Digital Thermometer
The main principle behind the circuit is to convert Analog data to accurate digital data. When the temperature of the surroundings is sensed by an Analog sensor (LM35), it then goes to ADC0804 ADC ( Analog to Digital Converter ). After that, the whole signal is processed through the AT89C51 microcontroller and displayed in an LCD display.
Project
Circuit Diagram
Components Required
- 8051 Microcontroller (AT89C51)
- 8051 Development Board
- Programmer (8051)
- 16×2 LCD Display
- ADC0804 Analog to Digital Converter
- LM35 Temparature Sensor
- 10KΩ Resistor
- 10KΩ Potentiometer
- 150pF Ceramic Capacitor (Code 151)
- Connecting Wires
- Power Supply
Software Required
- Keil µVision IDE Software
- Willar Software
Additional Components
If you don’t have an 8051 Development Board then you need these additional components.
- 11.0592 MHz Quartz Crystal
- 33pF Ceramic Capacitor (x2)
- 10KΩ Resistor (x2)
- 10uF/25V Polarized Capacitor
- Push Button
Celsius Scale Digital Thermometer Connection Section
Oscillator Section
The oscillator circuit consists of a crystal oscillator (11.0592 MHz) and two ceramic capacitors (33pF) for stability.
Reset Section
The reset section consists of a push-button, a 10KΩ resistor and a 10uF/25V capacitor for 100ms pulse width and a reset voltage of 1.2V.
EA Pin
We are not using any external memory for this project. So we use a 10KΩ resistor for high enabling.
Interfacing ADC0804 Analog Digital Converter with LM35
Let’s discuss how we can interface the LM35 temperature sensor with the ADC0804 converter for Analog to digital input.
Here LM35 temperature sensor consists of three pins that are VOUT, VS and GND. Analog pin 6 (+VIN) of the ADC0804 ic is connected to the VOUT pin of the LM35 sensor.
Pin 20 (VCC) of ADC0804 is connected to a +5V power supply. And pins 1 (CS),7 (-VIN), 8 (AGND) and 10 (GND) of the ADC converter are directly connected to the ground. A 10KΩ resistor is connected between the clock pins 4 (CLKIN) and pin 19 (CLKR) of the ADC converter. Also, a 150pF ceramic capacitor is attached between pin 4 (CLKIN) and the ground. Pin 3 and pin 5 both are connected.
Data pins 11 to 18 (DB0 – DB7) of the ADC converter are connected to the PORT2 pin of the 8051 microcontrollers.
Interfacing LCD Display with 8051 Microcontroller
The RS, RW and EN pins of the LCD display are directly connected to the port pins P3.6, GND and P3.7 respectively. The data pins are connected to PORT1 of the 8051 microcontrollers.
Working Principle of Celsius Scale Digital Thermometer
The LM35 temperature sensor can sense the ambient temperature of surroundings which produces a minimal output voltage that is proportional to the temperature at a rate of 10mV/°C. This Analog input voltage is given to the ADC converter (ADC0804), which can work on the principle of successive approximation conversion.
The ADC converter is configured to read the Analog signals continuously and produces digital output through its digital pins. To read the Analog input values continuously, we need to join both ADC0804’s pin 5 (INTR) and pin 3 (WR) together. Also, to transfer the digital data to the digital output pins of the ADC0804, pin 1 (CS) and pin 2 (RD) must pull ground for the low value.
Thus the Analog to digital converter continuously takes the Analog signals from the LM35 temperature sensor and converts them into digital signals. The digital output signal of the ADC0804 is the 8-bit binary data.
8051 microcontroller takes this digital signal and does a simple arithmetical calculation. This calculation will convert the received digital data from the ADC0804 converter and converts it to temperature in °C.
Now, the microcontroller will send this digital signal to the LCD and display the value. Since the ADC converter is continuously reading the Analog signal from the LM35 temperature sensor and sending it to the microcontroller through the digital pins, the temperature will be updated at all times on the display.
Applications of Celsius Scale Digital Thermometer
- It can be used in cars to keep track of temperature at all times.
- Thermoelectric devices can use this sensor for switching on/off the temperature like Air conditioners, geysers, etc.
- It can also be used at homes, and offices to get the temperature reading of the surrounding.
8051 Code for Celsius Scale Digital Thermometer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | #include<reg51.h> #define port P3 #define adc_input P1 #define dataport P0 #define sec 100 sbit rs = port^0; sbit rw = port^1; sbit e = port^2; sbit wr= port^3; sbit rd= port^4; sbit intr= port^5; int test_intermediate3=0, test_final=0,test_intermediate1[10],test_intermediate2[3]={0,0,0}; void delay(unsigned int msec ) { int i ,j ; for(i=0;i<msec;i++) for(j=0; j<1275; j++); } void lcd_cmd(unsigned char item) //Function to send command to LCD { dataport = item; rs= 0; rw=0; e=1; delay(1); e=0; return; } void lcd_data(unsigned char item) //Function to send data to LCD { dataport = item; rs= 1; rw=0; e=1; delay(1); e=0; //delay(100); return; } void lcd_data_string(unsigned char *str) // Function to send string to LCD { int i=0; while(str[i]!='') { lcd_data(str[i]); i++; delay(10); } return; } void shape() // Function to create the shape of degree { lcd_cmd(64); lcd_data(2); lcd_data(5); lcd_data(2); lcd_data(0); lcd_data(0); lcd_data(0); lcd_data(0); lcd_data(0); } void convert() // Function to convert the values of ADC into numeric value to be sent to LCD { int s; test_final=test_intermediate3; lcd_cmd(0xc1); delay(2); lcd_data_string("TEMP:"); s=test_final/100; test_final=test_final%100; lcd_cmd(0xc8); if(s!=0) lcd_data(s+48); else lcd_cmd(0x06); s=test_final/10; test_final=test_final%10; lcd_data(s+48); lcd_data(test_final+48); lcd_data(0); lcd_data('c'); lcd_data(' '); delay(2); } void main() { int i,j; adc_input=0xff; lcd_cmd(0x38); lcd_cmd(0x0c); //Display On, Cursor Blinking delay(2); lcd_cmd(0x01); // Clear Screen delay(2); while(1) { for(j=0;j<3;j++) { for(i=0;i<10;i++) { delay(1); rd=1; wr=0; delay(1); wr=1; while(intr==1); rd=0; lcd_cmd(0x88); test_intermediate1[i]=adc_input/10; delay(1); intr=1; } for(i=0;i<10;i++) test_intermediate2[j]=test_intermediate1[i]+test_intermediate2[j]; } test_intermediate2[0]=test_intermediate2[0]/3; test_intermediate2[1]=test_intermediate2[1]/3; test_intermediate2[2]=test_intermediate2[2]/3; test_intermediate3=test_intermediate2[0]+test_intermediate2[1]+test_intermediate2[2]; shape(); convert(); } } |
Hi I need the project write up
Yes contact me via contact page
can you share the clear circuit diagram?