Project Report

Share Embed Donate


Short Description

Temperature sensing project report...

Description

12/11/2016

Building a Temperature Sensing System Using DE2-115 FPGA and System Verilog

(Group 3) 


CSEG580: Principles of Computer System Design

Study Project

Fall 2016

(Group 3)

Building a Temperature Sensing System Using DE2-115 FPGA and System Verilog

Table of Contents Introduction ........................................................................................................................2 Sensors .............................................................................................................................2 Processing ........................................................................................................................2 Temperature Sensing and Control System ......................................................................3 High-Level Design ...............................................................................................................4 Block Diagram ..................................................................................................................4 Solution Algorithm ...........................................................................................................5 Code Hierarchy ...............................................................................................................6 Code Remarks .................................................................................................................. 6 Lower-Level Design .............................................................................................................8 Hardware..........................................................................................................................8 Results................................................................................................................................. 11 Conclusion .......................................................................................................................... 14 Appendix ............................................................................................................................14 TemperatureSensing.sv ..................................................................................................14 LCD_Display.sv ..............................................................................................................16 References.......................................................................................................................... 20

1! ●

(Group 3)

Introduction Many of today’s industrial systems rely on stabilized temperature readings to maintain the safety and quality of the products and appliances. For the most part, many modern procedures rely on balanced out temperatures and henceforth it is vital to manage an ideal temperature. Temperature control can be characterized as the method of detecting temperature change and coordinating the warmth energy into or outward of the framework to realize the correct temperature [1]. Temperature control frameworks are for the most part useful for closed loop control frameworks [1]. In such frameworks, an action is taken according to the monitored temperature in the vicinity. To achieve temperature control, two components must be considered, which are sensing and processing [3]. Securing the information is the key part of the entire controlled process. Sensors assume a noteworthy part in gaining the information and the processor assesses the information and gives a standard coherent output to accomplish the required outcome [2].

Sensors The study of sensing can be characterized as the process of obtaining information from remote geological areas. Various sensors are positioned into the surveillance field to collect data. Sensor can be characterized as a transducer which changes over one type of energy into another [2]. Sensors operate by detecting any variations in the surrounding area, then they send such observations in the form of an output that convey the changes. The market offers a variety of accessible sensors, such as temperature sensors, gas sensors, humidity sensors, light sensors and so forth. What’s common between such sensors is that they produce their output in an electrical form that can be used for additional processing [3].

Processing The idea of processing can be described as the act of evaluating data through some type of program. Electric signals form the input to the processor from the sensor devices. Based on the given input signal, the processor evaluates the given data and produces an output with respect to the input data. There are two major types of processors, which fall under PLCs (programmable Logic controllers) or FPGAs (field programmable entryway exhibits) which can be modified and programmed to perform in a certain manner. Coding of the FPGA can be performed using different types of software, which vary depending on the processor compatibility [3].

! ● 2

(Group 3)

Temperature Sensing and Control System Many of today’s modern industrial systems rely on a variety of parameters that range from weight, temperature, humidity, light and so forth. Such parameters must be improved for the best production of different materials and merchandise. Temperature is one of the critical facets that should be considered amid the assembling of materials. A temperature control system consists of an integrated set of sensors and processors that measure and control temperature. Controlling and observing of temperature can't be accomplished with any physical intervention as the temperatures would be too enormous or too low. This may make an impediment for the process of gathering readings and controlling temperature. Given the extreme boundaries of temperature readings, the atmosphere will be excessively antagonistic which might introduce severe damages [3]. Controlling temperature can be extremely challenging without accurately reading the temperature. Hence, a temperature control system can aid in accurately obtaining temperature readings by solving the problem of human intrusion to completely and precisely control temperature [1, 2]. The aim of the project is to highlight the process of building a temperature control system using Altera DE2-115 FPGA1 and System Verilog, but due to lack of time and required components, the scope is limited to only a temperature sensing system.

!

Figure 1 Altera DE2-115 FPGA 1

http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=502 ! ● 3

(Group 3)

High-Level Design Block Diagram The system starts with a temperature sensor  that converts  the measured temperature into electrical signals for further processing. The measured temperature is read in terms of analogue voltage and the DE2115 board only accepts digital data. Hence, from the sensor the output voltage is given to the analogue to digital converter (ADC) which digitizes the voltage for further the processing of data. The output of ADC is given to the board through the GPIO pins. The processor processes the information and displays it on the LCD display [3]. The block diagram is as shown below.

!

Figure 2 Block Diagram of the Temperature Sensing System [3]

! ● 4

(Group 3)

Solution Algorithm The software part of the solution can be defined using the following algorithm.

!

Figure 3 The algorithm of the Temperature Sensing System As shown in the above  figure, the input temperature is taken  from the ADC in binary code and is then converted into integer.

! ● 5

(Group 3)

Code Hierarchy The project code was organized in the following structure (generated through the Tree 2 command on Windows): C: POCSD_final_project_team_3 / main project folder (contains the source files in SystemVerilog) DE2_115.qsf/ Pin assignments file LCD_Display.sv/ System Verilog file for displaying temp on LCD README.txt/ README file for instructions about the project Reset_Delay.sv/ System Verilog file to control resent on DE2-115 TemperatureSensing.sv/ Main System Verilog for temp sensing +---db/ Compilation “temp” folder (May be deleted) +---incremental_db/ Compilation “temp” folder (May be deleted) |

\---compiled_partitions

+---output_files \---simulation / main folder for simulation files \---modelsim

Code Remarks Since the implementation of this project is mainly based on the work done in [3], we tried to re-implement their system by tracing their circuitry and re-writing their VHDL code. However, this attempt failed because of the inherent differences between VHDL and System Verilog. Our project requirements state that we must use System Verilog, and we are more familiar with System Verilog. Moreover, converting code from VHDL to System Verilog was not a straight forward task. For the most part, the major components could be converted. Yet, there were some small issues that caused 2

http://www.computerhope.com/treehlp.htm ! ● 6

(Group 3)

compilation errors and unexpected warnings, which lead us to follow a different approach to display the read temperature. Instead of using the seven segment display and switches like [3], we opted to use the LCD of the DE2-115 board as it was provided to us as a template to benefit from in the project. First, we made sure that the GPIO pins were assigned according to the documentation provided by [3] as follows: wire [3:0] hex1, hex0; wire [7:0] Temp; //Create wire for read temperature from GPIO //Pin assignment of each Temp reading with GPIO assign Temp[0] = GPIO_0[28]; assign Temp[1] = GPIO_0[26]; assign Temp[2] = GPIO_0[24]; assign Temp[3] = GPIO_0[22]; assign Temp[4] = GPIO_0[20]; assign Temp[5] = GPIO_0[18]; assign Temp[6] = GPIO_0[16]; assign Temp[7] = GPIO_0[14]; //Convert Temp to decimal value assign hex1 = Temp[7:4]; assign hex0 = Temp[3:0]; LCD_Display u1( // Host Side .iCLK_50MHZ(CLOCK_50), .iRST_N(DLY_RST), .Temp(Temp), // LCD Side .DATA_BUS(LCD_DATA), .LCD_RW(LCD_RW), .LCD_E(LCD_EN), .LCD_RS(LCD_RS) );

The temperature here is defined as an 8 bit wire that gets its values from the GPIO in binary. Then the values are converted with the hex1 and hex0 assignments that will be done in the LCD_Display.sv file. The code snippet below shows the changes made to the LCD display file in which the output of the display was modified to show the temperature obtained from the sensor. Each ASCII code corresponds to a letter that shows the statement “Temperature(C)=XX” which means the temperature in degrees Celsius equals the value read from the sensor and converted with the ADC. // ASCII hex values for LCD Display // Enter Live Hex Data Values from hardware here // LCD DISPLAYS THE FOLLOWING: //----------------------------//| Temperature(C)= | //| XX | //----------------------------! ● 7

(Group 3)

// Line 1 //[email protected](Temp) //tempOutput = Temp; always case (index) 5'h00: out
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF