LCD Temp Sensor

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Higher Technological Institute of 10th

Ramadan

Mechanical Engineering: Mechatronics

Micro controller project

(LM35 sensor with LCD )

Submitted By:

Mohamed Mahmoud Osman. ID:20180786


Mohamed Ahmed Mohamed ID:20190856

Yousef Shreif ID:20180985

Group NO: 62 , 61

Submitted To:
Dr. Ahmed Abu-Elfadl
Eng. Ahmed El-Sayed
Components
name quantity notes
Pic 16f877A 1

Resistor 1 10k

LCD 1
L7805 1 Regulator with 5v output

Battery 1 9v

Jumpers -

Lm35 1
ADC
PIC16F877A has an inbuilt 10 bit Successive Approximation ADC which is multiplexed among 8
input pins.
Resolution
The A/D module has high and low-voltage reference input that is software selectable to some
combination of VDD, VSS, RA2 or RA3. With 5v as the Vref the resolution of Pic16f877a ADC can
be determined as
= Vref/(2^{10}-1) = 5/1023 =0.004887 = 4.887mv
Time of conversion :
It is measured I Tad as the normal conversion time requires 12 tad where one tad mustn’t be less than
1.6us
For 8MHZ clock then
1 tad = 1/8MHZ = 125ns which is less than 1.6us
So choosing fosc/64 we get 1 tad =8 us
So conversion time = 12 *8us=96us
The below table shows the ADC input pins multiplexed with other GPIO pins. The ADC pin can be
enabled by configuring the corresponding ACON1 register. When the ADC function is selected for a
pin ,then other Digital signals are disconnected from the ADC input pins.
ADC Channel Pin
Channel 0 RA0/AN0 (Port A)
Channel 1 RA1/AN1 (Port A)
Channel 2 RA2/AN2/VRef- (Port A)
Channel 3 RA3/AN3/VRef+ (Port A)
Channel 4 RA5/AN4 (Port A)
Channel 5 RE0/AN5 (Port E)
Channel 6 RE1/AN6 (Port E)
Channel 7 RE2/AN7 (Port E)

Sensor:
Lm35:
LM35 is a temperature sensor that outputs an analog signal which is
proportional to the instantaneous temperature. The output voltage can easily be
interpreted to obtain a temperature reading in Celsius. The advantage of lm35
over thermistor is it does not require any external calibration. The coating also
protects it from self-heating. Low cost (approximately $0.95) and greater
accuracy make it popular among hobbyists, DIY circuit makers, and students.
Many low-end products take advantage of low cost, greater accuracy and used
LM35 in their products. Its approximately 15+ years to its first release but the
sensor is still surviving and is used in any products.
• LM35 is a temperature sensor that outputs an analog signal
• calibrated Directly in Celsius (Centigrade)
• Linear + 10-mV/°C Scale Factor
• 0.5°C Ensured Accuracy (at 25°C)
• Rated for Full −55°C to 150°C
• Range Suitable for Remote Applications Operates from 4 V to 30 V Less
than 60-µA Current Drain Low Self-Heating,
• 0.08°C in Still Air Non-Linearity Only ±¼°C Typical Low-Impedance
Output, 0.1 Ω for 1-mA Load which is proportional to the instantaneous
temperature.

Fig1

LM35 can be used in two circuit configurations. Both yield different results. In
the first configuration, we can only measure the positive temperature from 2
degrees Celsius to 150 degrees Celsius. In this first configuration, we simply
power lm35 and connect the output directly to analog to digital converters. In
the second configuration, we can utilize all the sensor resources and can
measure the full range temperature from -55 degree centigrade to 150-degree
centigrade. This configuration is a little complex but yields high results. We
have to connect an external resistor, in this case, to switch the level of negative
voltage upwards. The external resistor value can be calculated from the formula
given below the configuration circuit. The second configuration circuit can be
made in various ways.
Code
Schematic

You might also like