Temperature Indicator using 8051 and LM35

temperature indicator feature
temperature indicator feature

Introduction to Temperature Indicator using 8051 and LM35:

Temperature Indicator using 8051, temperature measurement, monitoring and control is very important in various applications. Temperature Measurement plays a very optimum role in industries processing food, medicines, beverages and other such products. If a optimum temperature isn’t maintained the quality of products can degrade.

Important components in digital temperature measurement system are:

  1. A sensor, sensor is nothing but a component or device whose physical parameters will change according to changes in atmospheric parameters or factors. For eg: Temperature Sensor, it might change its resistance, output voltage or dimension as there is some change in surrounding temperature. In this project we are using LM35, its output voltage increases by +10mV as there is 1° C rise in temperature.
  2. A digital converter, as we all know the output of the sensor will be in form of analog voltage. This analog voltage can’t be distinguished by the micro-controller or any other digital device. In order to understand changes in the output of sensor we need to convert it into digital form ie. Binary Data
  3. A Interface which takes digital data as input processes it and produces signals or measured output which can be displayed or shown to operator on a screen like 16×2 LCD.

 

Components used for Temperature Indicator using 8051 and LM35:

  1. 8051 Micro-Controller, preferably SST89E51RD or SST89E51RD2 any other 8051 micro-controller will work fine.
  2. 16×2 LCD.
  3. ADC 0804.
  4. LM35 Temperature Sensor.

Understanding working of LM35 in Temperature Indicator using 8051:

LM35 is a 3 pin temperature sensor, which is pretty accurate in detecting minor changes in temperature. It can sense minimum 1°C change in temperature, changes below 1°C go undetected by the sensor.
It has three pins:
1. Vcc
2. Ground (GND)
3. Vout
Vcc is usually connected to +5V power supply, it can be also connected with Vcc of micro-controller no need for a separate power supply. GND pin is connected to ground of the power supply. Vout pin is the output voltage of the sensor proportional to temperature and it should be connected to analog input of ADC.

Understanding working of ADC in Temperature Indicator using 8051:

ADC 0804 is a single channel Analog to Digital Converter, it has a built in clock oscillator. So unlike ADC 0808, no external clock source needs to be interfaced with ADC 0804. ADC 0804 is a 8 bit ADC, that is it converts analog data into 8 bit binary signal. We can use an ADC with high resolution ie. by increasing its conversion bits resolution increases. But 8051 is supports only 8 bit data processing, so a ADC with bit rate more than 8 bits can not be interfaced with 8051.

Following are major pins of ADC:

  • Chip Select (CS)
  • Read Pin (RD)
  • Write Pin (WR)
  • CLK IN
  • INTR
  • Analog Ground (AGND)
  • Digital Ground (DGND)
  • Vref/2
  • CLK R
  • Vin (+)
  • Vin (-)
  • Digital Output Pins (D0-D7)

ADC 0804 is a 20 pin IC, pin functions are very simple to understand and very easy to implement, we will be discussing each and every pin function in detail.

Chip Select(CS): This is very important pin of ADC, it used to activate the ADC IC. In order to keep ADC activated all the time, CS pin of ADC should always be connected to ground.

Read Pin(RD):
Read pin has very simple function, as the name suggests it is used to trigger ADC to read analog data. In order to read analog signal and convert it into digital signal, first we need to give a high-low pulse on RD pin of ADC 0804

Write Pin(WR)
As soon as a high-low pulse is given to RD pin it reads the analog voltage and converts it into digital form. The converted digital form is stored inside the registers (temporary memory) of ADC 0804. To get this signals at output pins a high-low pulse must be given to WR pin, after giving a high-low pulse to RD pin.

Interrupt(INT):
It is an indicator pin, once a high-low pulse is given to RD pin conversion starts. It takes a while, short duration of time (less than a sec) to complete the process. Once process is completed INT goes high to indicate conversion is completed successfully.

Analog Ground & Digital Ground:
Analog ground is input ground and digital ground is output ground. In this application we will be connecting both of them to common ground.

Half voltage reference (Vref/2):
1/2 of voltage reference should be applied to this pin. This pin is used for maintaining accurate thresholds. If Reference Voltage is equal to Vcc that is 5V then 2.5V needs to be applied at this pin. It can be easily done by connecting two 10k resistors in series, having one pin connected to Vcc and another to ground. The junction of two resistors will give 2.5V output. Similarly a voltage divider can also be used.

Input Analog Voltage Vin(+/-):
The analog input voltage that needs to be converted is applied to this pin.

Digital Output pins(D0-D7)
These pins provide digital data which is converted from analog input data into digital form. In order to get accurate conversion in real time one must make sure a high to low pulse is given to WR at regular intervals.

Clock generation for ADC:

Clock pulses are basic requirement for any Analog to Digital Converter. Unlike ADC 0808  ADC 0804 has a built in clock oscillator. In order to use built in clock oscillator a 10k resistor needs to be connected between CLKIN and CLKR pins of ADC. And a capacitor of 68pF needs to be connected from CLKIN to ground. Use circuit diagram below for reference.

Interfacing LCD in Temperature Indicator using 8051 and LM35:

A 16×2 LCD is used in this project to display the information received from ADC, which has data provided by the sensor. Depending upon complete analysis we develop a algorithm to scan the input and produce corresponding output on LCD. In this project we have used LCD in 4bit mode. Advantage of this mode is less connections are required which saves port pins of micro-controller. And less connections makes the design simpler to implement. Connections of LCD can be observed in circuit diagram below. In case of doubts refer our LCD interfacing article.

Circuit Diagram of Temperature Indicator using 8051 and LM35:

temperature indicator circuit
temperature indicator circuit

Above figure shows circuit diagram of implementation of temperature indicator circuit using 8051 and LM35.

You can download a executed and tested C program burnable (HEX) file from link below. Left click and save link in order to download

Hex File

In case you need C source file mail us at teamthinkelectronics@gmail.com

Also see:

Voting Machine using 8051

Password Lock using 8051

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here