DOC PREVIEW
MSU ECE 480 - Application Note LM34 Temperature Sensor Implementation with PIC

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Application Note Page 1 of 12 November 13, 2009 Application Note LM34 Temperature Sensor Implementation with PIC Muhammad Jawad Zaheer November 13th, 2009 Executive Summary This paper discusses the various applications of temperature sensors and their implementation in our project. Many consumers use digital thermometers every day and due to their usefulness they have become cheap and readily available. In our project, temperature sensors are used to detect the ambient temperature. Precision Fahrenheit Temperature Sensor LM34, created by National Semiconductor, with the PIC18F4520 microprocessor provided by Microchip, is used to implement this device. Physical connection between the two devices can be accomplished using a simple breadboard. Different setup of hardware and software implementation will be discussed, which is required by the system to read the desired temperatures. Keywords Temperature Sensor, LM34, PIC18F4520 Microprocessor, LCD.Application Note Page 2 of 12 November 13, 2009 Table of Contents 1. Objective .................................................................................................................. 3 2. Introduction ............................................................................................................ 3 3. Implementation ....................................................................................................... 4 3.1 Hardware Interface .............................................................................................. 4 3.2 Software Interface ............................................................................................... 8 4. Conclusion ............................................................................................................... 8Application Note Page 3 of 12 November 13, 2009 1. Objective Our group is designing a body temperature regulation jacket for quadriplegic patients. The need for this interface is to measure the ambient temperature. The system, consisting of a Peltier junction, does heating and cooling based on the ambient temperature. The actual ambient temperature will also be sent to the LCD screen for the user to know the surrounding temperature. The description of Peltier junction and LCD are not discussed in this application note. 2. Introduction There are many commonly used electrical temperature sensors that can be consider for this system but they are mostly difficult to apply. Thermistors are nonlinear to any temperature scale and needs calibration while thermocouples have low output levels and require cold junction compensation. They also requires extra hardware interface that can change this resistance value into a voltage signal to transmit the signal. The National Semiconductor designed the precision integrated-circuit temperature sensors, LM34, to overcome these limitations. The output voltage of LM34 is linearly proportional to the Fahrenheit temperature and does not require any external calibration. It outputs approximately +10mV/°F over its wide operating temperature range of -50°F to +300°F. As it is calibrated in Fahrenheit temperature compared to other linear sensors calibrated in degrees Celsius, the user is not required to do extra calculations to obtain convenient Fahrenheit scaling. The device can be used withApplication Note Page 4 of 12 November 13, 2009 single power supplies and/or with dual supplies. Due to its low current drain of about only 75 µA, it has very slight self-heating(less than 0.2°F in still air). 3. Implementation 3.1 Hardware Interface The connections servicing the PIC18F4520’s power pins involve hooking pins 11 and 32 to 5 volts, and pin 1 through a 10kΩ resistor to 5 volts. Pins 12 and 31 are connected to ground. Pin 13 on the microcontroller is the clock input and driven by 40 MHz crystal. The LM34 only has three terminals as shown in Figure 1. Pin 1 is connected to ground, pin 3 is connected to a 5 volt source and pin 2 is the output. Figure 1: LM 34 The temperature sensor is easy to use and may be operated with either single or dual supplies. If we connect the sensor using a single supply, the output in this configuration is limited to positive temperatures. As the extreme temperature can fall below 0°F, the sensor is required to operate over its full temperature range of −50°F to +300°F.Application Note Page 5 of 12 November 13, 2009 Using single supply, another resistor is added from the output pin to ground, connecting two diodes in series between the GND pin and the circuit ground, and taking a differential reading. The diodes are used to draw the essential current required for negative temperatures. Figure 2: Temperature Sensor, Single Supply, −50° to +300°F If dual supplies are available, as in our project, the sensor is used over its full temperature range by just adding a pull down resistor from the output to the negative supply as shown in Figure 3. Figure 3: Full-Range Fahrenheit Temperature Sensor, Dual SupplyApplication Note Page 6 of 12 November 13, 2009 The value of this resistor is calculated using following formula A50)(-V RS1μ= While using the Voltage source of 5V, it requires 100kΩ resistor to provide the linear scale. Using these values, our actual temperatures based on output voltages is shown in the following chart, which shows excellent linearity: Temperature [F]-100-500501001502002503003503000 2500 2000 1500 1000 500 0 -500Voltage [mV]Temperature [F] Figure 4: Linear Relationship between Voltage and Temperature The output of the sensor is then connected to Pin 2 of the PIC microprocessor. This reading is sent to a built-in Analog to Digital converter on the PIC which stores the value in HEX. The output is then used to determine which mode of Peltier junction (heating or cooling) should start. The temperature is checked every minute to account for any changes. The timing of the circuitry is controlled by an external clock which isApplication Note Page 7 of 12 November 13, 2009 set to 400 MHz. The output of the sensor reading is also output at the LCD screen using the ports D of the PIC. The logic follow starting from LM 34 till the display is shown below. Figure 5: Logical flow from LM34 to Display The complete sensor connections are shown in figure below. Figure 6: Wiring diagram of Temperature sensor with Microprocessor and ClockApplication Note Page 8 of 12 November 13, 2009 3.2 Software


View Full Document

MSU ECE 480 - Application Note LM34 Temperature Sensor Implementation with PIC

Documents in this Course
ganttv1

ganttv1

6 pages

sd97

sd97

17 pages

ap_EO

ap_EO

14 pages

Load more
Download Application Note LM34 Temperature Sensor Implementation with PIC
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Application Note LM34 Temperature Sensor Implementation with PIC and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Application Note LM34 Temperature Sensor Implementation with PIC 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?