StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Design of Temperature Sensor - Assignment Example

Cite this document
Summary
In the "Design of Temperature Sensor" paper, a micro-controller based temperature sensor with a digital display is designed. A process is based on a PIC18F45K22 microcontroller and an LM35 temperature sensor, an analog sensor used in the conversion of surrounding temperature to an analog voltage…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER97.7% of users find it useful
Design of Temperature Sensor
Read Text Preview

Extract of sample "Design of Temperature Sensor"

Temperature sensor Temperature sensor Temperature monitor and control is of extreme importance in modern applications for process control. In this paper a micro-controller based temperature sensor with a digital display is designed. The process is based on PIC18F45K22 microcontroller and an LM35 temperature sensor which is an analog sensor used in conversion of surrounding temperature to a corresponding analog voltage. The sensor’s output is linked to one of the several ADC channel inputs in the PIC18F45K22 microcontroller in order to derive equivalent digital format temperature value. The resulting computed temperature is displayed in a 2×16 character LCD, both in °C and °F scales. Theory The LM35 temperature sensor series used are a product of the National Semiconductor Corporation. The sensors are rated between -55 °C and 150°C temperature range. The sensors have no need for external calibration and their output voltage is directly proportional to temperature. The temperature to voltage conversion scale factor is 10 mV/°C. Hermatic TO-46, one of LM35 sensor series transistor package is used with its metal cage connected to the negative pin (Gnd). Nonetheless, this project has no need for any negative voltage source, and hence it will only demonstrate use of sensor for measurement of temperatures exceeding 0°C and capped at 100°C. The sensor’s output voltage is converted into a 10-bit digital number with assistance of an internal ADC of the PIC18F45K22. Given that the voltage is measured by ADC ranges from 0 to 1.0V (corresponding to max. temp. range, 100 °C, the ADC needs a lower reference voltage (rather than supply voltage Vdd = 5V) for A/D conversion as a way of getting higher accuracy. On the other hand, the lower reference voltage is provided by the Zener diode or a resistor. In this case, the circuit figure one is used with a resistor is used. Design and implementation The project uses a HD44780 controller baser LCD that is connected to a PIC18F45K22 microcontroller. This is operated from an 8MHz crystal. The LCD is connected to the microcontrollers Port B as follows, LCD pin Microcontroller pin D4 RB0 D5 RB1 D6 RB2 D7 RB3 R/S RB4 E RB5 R/W LCD pin is not used and is linked to GND. The LCD’s brightness is controlled via an arm of a 10 K potentiometer through pin V0 of the LCD. The other pins from the potentiometer are directed to power and ground. //Start of LCD module connections AbitLCD_RS at RB4_bit AbitLCD_RS at RB5_bit AbitLCD_RS at RB0_bit AbitLCD_RS at RB1_bit AbitLCD_RS at RB2_bit AbitLCD_RS at RB3_bit The analogue voltage being measured is connected to the microcontroller’s port pin RA0. The A/D converted on measured PIC18F45K22 microcontroller is 10 bits wide and hence has a +5V as reference voltage while minimum voltage is read as 4.88mV. LMD35DZ integrated circuit analogue temperature sensor is used. It has 3 pins where one of its pins goes to +V, while the other is connected to GND and the last one is connected to the output pin. The output voltage recorded is proportional to temperature and is given as, SbitLCD_RS_Direction at TRISB4_bit; SbitLCD_RS_Direction at TRISB4_bit SbitLCD_RS_Direction at TRISB4_bit SbitLCD_RS_Direction at TRISB4_bit SbitLCD_RS_Direction at TRISB4_bit SbitLCD_RS_Direction at TRISB4_bit //End of LCD module connections // //Start of main program // Void main() { Unsigned int ConvertedData; Float mV; Unsigned char Head[]= “V=”; Unsigned char Txt[15]; ANSELA = 1; //Port A configured as analogue ANSELB = 0; // Port B configured as analogue TRISB = 0; // PORT B is output TRISA = 1; //RA0 is input Lcd_Init(); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Cmd(_LCD_CLEAR); ADC_Init(); For(;;) { ConvertedData = ADC_Get_Sample(0); mV = ConvertedData*5000.0/1024.0; FloatTpStr(mV,Txt); Lcd_Out(1,1,Head); Lcd_Out_Cp(Txt); Delay_Ms(1000); Lcd_Cmd(_LCD_CLEAR); } } Based on the algorithm, at 10 C, output voltage reading will be 100mV, at 25 C, output voltage will be 250mV. Block diagram The project’s block diagram is shown in the figure below, Notably, jumper J15 is disconnected across RA0 as well as RA1 inputs. Additionally, the jumpers Read-X and Read-Y of SW3 are set at off positions. A further algorithm is proposed to handle instances where the temperature surpasses the threshold value. Algorithm 1) initialize LCD 2) start the ADC to measure temp 3) read ADC byte 4) convert ADC byte into temperature and record into the flash 5) increase no of samples by one 6) display temp on LCD 7) compare the temperature with the threshold value 8) waiting time according to recording interval 9) start the conversion of ADC..conversion frequency is around 640KHz 10) convert ADC digital output into temperature and store its 2 digit value into flash 11) increase number of samples by one 12) convert decimal to hexadecimal value 13) add one to hex value of no of samples 14) convert hex value to decimal number 15) display 2 digit temperature to LCD 16) compare temp value with threshold values 17) hex value of current temperature 18) hex value of threshold temperature 19) LED on if current temperature more than threshold value 20) LED off if current temperature more than threshold value 21) provide measuring interval delay 22) converts the ADC 8 bit output to 2-digit temperature value in ASCII 23) convert the 4 digit decimal into 2 byte hex 24) Input in t3 t2 t1 t0 and output in hex1 hex0 25) provide threshold value range from 20 to 49 degree Celsius for user 26) provide recording interval range from 01 to 99 secs for user 27) display a 16 byte in ASCII string on LCD 28) send the command to LCD 29) send ASCII data to LCD In general, an external reference voltage to the internal ADC of PIC16F688 can be provided through RA1 I/O pin. The output from the LM35 sensor is read through RA2/AN2 ADC channel. The temperature is displayed on a 16×2 character LCD that is operating in the 4-bit mode. A 5K potentiometer is used to adjust the contrast level on the display. Detailed algorithm CODE FOR TEMPERATURE SENSOR /* * Project name: LM35 Sensor (Temperature measurement) * Copyright: (c) Mikroelektronika, 2011. * Revision History: 20110929: - initial release (FJ); * Description: A simple example of using the LM35 sensor. Temperature is displayed on LCD. * Test configuration: MCU: PIC18F45K22 http://ww1.microchip.com/downloads/en/DeviceDoc/41412D.pdf Dev.Board: EasyPIC7 - ac:LM35 http://www.mikroe.com/eng/products/view/757/easypic-v7-development-system/ Oscillator: HS-PLL 32.0000 MHz, 8.0000 MHz Crystal Ext. Modules: LM35 Sensor, Character Lcd 2x16 http://www.mikroe.com/eng/products/view/277/various-components/ SW: mikroC PRO for PIC http://www.mikroe.com/eng/products/view/7/mikroc-pro-for-pic/ * NOTES: - Place LM35 in proper position and place jumper J25 in the left position (RE1). (board specific) - Turn on Lcd backlight switch SW4.6. (board specific) */ // LCD module connections sbit LCD_RS at LATB4_bit; sbit LCD_EN at LATB5_bit; sbit LCD_D4 at LATB0_bit; sbit LCD_D5 at LATB1_bit; sbit LCD_D6 at LATB2_bit; sbit LCD_D7 at LATB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB0_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit LCD_D6_Direction at TRISB2_bit; sbit LCD_D7_Direction at TRISB3_bit; // End LCD module connections // Set VREF according to the voltage reference : // 5.00 - power supply jumper set to 5V position (reference = 5V) // 3.30 - power supply jumper set to 3.3V position (reference = 3.3V) const unsigned short VREF = 5.00; unsigned int temp_res = 0; float temp; char txt[15]; void main() { ANSELB = 0; // Configure PORTB pins as digital ANSELE = 0x02; // Configure RE1 pin as analog TRISE1_bit = 1; // Configure RE1 pin as input ADC_Init(); // Initialize ADC Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1, 1, "Temperature :"); Lcd_Chr(2,8,223); // Different LCD displays have different // char code for degree Lcd_Chr(2,9,C); // Display "C" for Celsius temp_res = 0; do { temp_res = ADC_Get_Sample(6); // Get 10-bit results of AD conversion temp = (temp_res * VREF)/10.240; // Calculate temperature in Celsuis // change Vref constant according // to the power supply voltage FloatToStr(temp, txt); // Convert temperature to string txt[4] = 0; Lcd_Out(2,3,txt); // Write string in second row Delay_ms(300); } while(1); } Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(Design of Temperature Sensor Assignment Example | Topics and Well Written Essays - 1250 words, n.d.)
Design of Temperature Sensor Assignment Example | Topics and Well Written Essays - 1250 words. https://studentshare.org/engineering-and-construction/1813400-temperature-sensor
(Design of Temperature Sensor Assignment Example | Topics and Well Written Essays - 1250 Words)
Design of Temperature Sensor Assignment Example | Topics and Well Written Essays - 1250 Words. https://studentshare.org/engineering-and-construction/1813400-temperature-sensor.
“Design of Temperature Sensor Assignment Example | Topics and Well Written Essays - 1250 Words”. https://studentshare.org/engineering-and-construction/1813400-temperature-sensor.
  • Cited: 0 times

CHECK THESE SAMPLES OF Design of Temperature Sensor

Executive Management Support

154) for the temperature conditions should have been specified in risk response documents which seemingly were not.... Project management: strategic design and implementation.... The approach and methods depend on the general nature of senior management itself, which generally has lesser time, is more concerned with… To gain trust and support from this group in the client organization on a sustained basis, it is necessary that they are shielded from day to day activities and yet their active involvement is ensured....
3 Pages (750 words) Essay

MEMS and Product Design

According to Browne (2006, 1), the manner in which MEMS has affected product design in industrial application systems and in the manufacturing of accelerometers is very elaborate, being evidenced by developments in iPhone and TAHE refrigerators, as shall be seen in the discussion which ensues forthwith.... The reason behind iPhone and TAHE refrigerators increased volume of sales is because of the integration of MEMS technology into their operating systems, since this approach highly promotes effective and finer product design....
4 Pages (1000 words) Essay

Integrated Technology Systems

They have developed computer in order to become capable of getting even the tiniest calculations right.... There are supercomputers in this world that have the ability to plot flight plans… In biomedical research, scientists have successfully developed the means to see through human body.... The traditional X-ray technology has transformed in MRI and CT Scanners which are pretty However, humanity is developing ever since the first dawn of jungle life when humans were living in caves and eating raw flesh of animals and they used leaves to cover their bodies but one thing they had in common with modern man and it was the urge to develop and grow into better beings....
10 Pages (2500 words) Essay

Structural Health Monitoring

Instrumentation of monitoring types of equipment within the rotating parts requires the design of temperature resistance sensors with the ability to detect slight changes in flaws within the engine.... The article remains imperative in presenting an investigative approach to other scientists towards establishing a novel sensor that would significantly reduce structural health issues and accidents associated with aircraft....
1 Pages (250 words) Essay

A Lighting Audit

They operate at a cooler temperature.... The purpose of the paper “A Lighting Audit” is to learn the information needed to do a lighting audit.... Color Rendering affects the quality of light.... Some lamps make everything look cool (blue light) while other lamps render colors in a fashion more similar to natural lighting....
6 Pages (1500 words) Assignment

Embedded System: PIC 16F88, PID Controller

In the paper, a temperature sensor is defined as the analog device (TMP04 serial digital TMP04).... he output pulse train of a TMP04 temperature sensor is nominally thirty-five pulses per second in environments that have a temperature of twenty-five degrees Celsius.... In the "Embedded System: PIC 16F88, PID Controller" paper, a cheap cost application for temperature measurement and communication system using PIC 16F88 was designed and implemented....
5 Pages (1250 words) Coursework

Intelligent Micromouse

The paper "Intelligent Micromouse" highlights that the sensor cable of Intelligent Micromouse should be about 30cm in maximum length.... This sensor is a common component of choice for most projects in which accurate measurements of distance are required.... At 4cm the sensor has the capability of producing an analog output of 3....
9 Pages (2250 words) Essay

How Light Controllers being Control from Voice, Heat Emission, Occupancy or Motion Work

The viewing field of the sensor needs to be selected in a careful way for it to respond to motion or occupancy in the needed space by controlling the lighting of the region of space.... This term paper "How Light Controllers being Control from Voice, Heat Emission, Occupancy or Motion Work" presents lighting controllers that are interfaces linking lighting equipment with the human ideas....
6 Pages (1500 words) Term Paper
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us