Docsity

Temperature Sensor LM-35 Interface and Programming with PIC32 Microcontroller using ADC, Exercises of Power Electronics

Toggle sidebar
bg1
Experiment No. 11
Temperature Sensor Interface with Analog to Digital Convertor(ADC)
of PIC32 Microcontroller
Objective
1- Introduction to Temperature sensor LM-35
2- Working principle of LM-35 sensor
3- Introduction to ADC of PIC32 microcontroller
4- Interfacing and Programming Temperature sensor with ChipKIT Module
Temperature sensor LM-35
The LM35 series are precision integrated-circuit temperature devices with an output voltage
linearly proportional to the Centigrade temperature. The LM35 device has an advantage over
linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large
constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does
not require any external calibration or trimming to provide typical accuracies of ±¼°C at room
temperature and ±¾°C over a full −55°C to 150°C temperature range. Lower cost is assured by
trimming and calibration at the wafer level. The low-output impedance, linear output, and precise
inherent calibration of the LM35 device makes interfacing to readout or control circuitry
especially easy. The device is used with single power supplies, or with plus and minus supplies.
As the LM35 device draws only 60 μA from the supply, it has very low self-heating of less than
0.1°C in still air. The LM35 device is rated to operate over a −55°C to 150°C temperature range.
pf3
pf4

Partial preview of the text

Download Temperature Sensor LM-35 Interface and Programming with PIC32 Microcontroller using ADC and more Exercises Power Electronics in PDF only on Docsity!

Experiment No. 11

Temperature Sensor Interface with Analog to Digital Convertor(ADC)

of PIC32 Microcontroller

Objective

1 - Introduction to Temperature sensor LM- 35 2 - Working principle of LM- 35 sensor 3 - Introduction to ADC of PIC32 microcontroller 4 - Interfacing and Programming Temperature sensor with ChipKIT Module

Temperature sensor LM- 35

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range. Lower cost is assured by trimming and calibration at the wafer level. The low-output impedance, linear output, and precise inherent calibration of the LM35 device makes interfacing to readout or control circuitry especially easy. The device is used with single power supplies, or with plus and minus supplies. As the LM35 device draws only 60 μA from the supply, it has very low self-heating of less than 0.1°C in still air. The LM35 device is rated to operate over a −55°C to 150°C temperature range.

Features

  • 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
  • Low-Cost Due to Wafer-Level Trimming
  • Operates from 4 V to 30 V
  • Less than 60-μA Current Drain
  • Low Self-Heating, 0.08°C in Still Air

Interfacing with ADC

The LM35 is a common temperature sensor. It is often used with the equation temp = (5.0 * analogRead(tempPin) * 100.0) / 1024; However, this does not yield high resolution. This can easily be avoided, however. The LM35 only produces voltages from 0 to +1V. The ADC uses 5V as the highest possible value. This is wasting 80% of the possible range. If you change aRef to 1.1V, you will get almost the highest resolution possible. The original equation came from taking the reading, finding what percentage of the range (1024) it is, multiplying that by the range itself(aRef, or 5000 mV), and dividing by ten (10 mV per degree Celcius, according to the datasheet: However, if you use 1.1V as aRef, the equation changes entirely. If you divide 1.1V over 1024, each step up in the analog reading is equal to approximately 0.001074V = 1.0742 mV. If 10mV is equal to 1 degree Celcius, 10 / 1.0742 = ~9.31. So, for every change of 9.31 in the analog reading, there is one degree of temperature change. To change aRef to 1.1V, you use the command "analogReference(INTERNAL);" Here's an example sketch using 1.1 as aRef: float tempC;

Lab Task

  • Interface the Temperature sensor with PIC32 microcontroller by following the procedure described in the lab.
  • Observe the behavior of the sensor, by measure values at different temperatures.
  • Attach the results of your lab task and codes with your report and submit it before next lab.

Lab Report

**Q1: What is the function of ARef pin of ADC of microcontroller?





Q2: How many analog inputs can be read by ChipKit PIC32 microcontroller?




__________________________________________________________________________**