design a multi-function digital thermometer md

24
DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD RIDZUAN BIN TALIB This report is submitted in partial filfillment of requirements for the award of Bachelor of Electronic Engineering (Industrial Electronic) with honours. Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer Universiti Teknikal Malaysia Melaka May 2008

Upload: lamlien

Post on 26-Jan-2017

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER

MD RIDZUAN BIN TALIB

This report is submitted in partial filfillment of requirements for the award of

Bachelor of Electronic Engineering (Industrial Electronic) with honours.

Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer

Universiti Teknikal Malaysia Melaka

May 2008

Page 2: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

UNIVERSTI TEKNIKAL MALAYSIA MELAKA f FAKULTI KESURUTERAAN ELEKTROMK DAN KJXJRUTERAAN KOMPUTER L - - BORANG PENGESAHAN STATUS LAPORAN - - - PROJEK SARJANA MUDA I1

Tajuk Projek - DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER

Sesi Pengajian : 200712008

Saya MD RIDZUAN BIN TALIB

mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat- syarat kegunaan seperti berikut:

1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.

2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi

pengajian tinggi.

4. Silatandakan( 4 ) :

sum* (Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSIA RASMI 1972)

TERHAD* (Mengandungi maklumat terhad yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan)

TIDAK TERHAD

Disahkan oleh:

(COP DAN TANDATMGAN PENYELIA)

Ahmat Tetap: LOT 1695, LRG PAKCU DAUD FAUlYAH BT SACEHUDDIN NO. 6. KG GUNUNG, Censyarah 16390 BACHOK Fakulti Kej Ekktronik dan Kej Komputer (FKEKK). KELANTAN Universiti Teknikal Malaysia Melaka (UTeM),

Kamng mllruncl 12W Ayer Koroh, 75451 Melaka

16 /q/zoo d Tali kh: . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 3: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

"I hereby declare that this report is the result of my own work except for quotes as cited

in the references."

Author : MD RIDZUAN BIN TALIB

Date . 16 MAY U 0 $ * ...................................

Page 4: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

"I hereby declare that I have read this report and in my opinion this report is sufficient in

terms of scope and quality for the award of Bachelor of Electronic Engineering

(Industrial Electronic) with honors."

Signature

Supervisor's Name : PN FAUZIYAH BT SALEHUDDIN

Date

Page 5: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

Be Yourselfin Everything You Do.

BY

Md Ricliuan bin Talib

Specially dedicated to my beloved mother,

Che Eshah binti Ibrahim and my beloved late father,

Talib bin Yaacob, who have encouraged, guided and inspired me

throughout of my succeed andfill of thanks because always be my side.

To my beloved sisters and all my supportvefi.iends.

Always hoping andpray that you will be successfil in whatever

you do and be strong in facing the challenges of life.

Page 6: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

ACKNOWLEDGEMENT

Alhamdulillah

Firstly, I would like to thank Allah the All Mighty, which is with His bless, I

manage to complete this thesis as required completing my study in Universiti Teknikal

Malaysia (UTeM).

I would like to thank Pn. Fauziyah bt Salehuddin for all of the assistance she has

provided throughout the year. She has been most helpfbl in lending his expertise and

knowledge and ensuring that my work progressed with as few problems as possible.

When problems arose, she was willing to sacrifice her time to help me resolve the issues.

My appreciation is also extended to Mr. Noremy bin Salehuddin, Mr. Sulaiman

bin Hashim, and Mr. Che Mazlan bin Che Marof for their invaluable advice and

comments during to improve my thesis.

Last but not least, I would like to express my deepest gratitude to my parent Mrs.

Che Eshah bt Ibrahim and my sisters Tisni, Dini Haryani, Adriana, Syarnsiah Sobath,

Siti Noor Adha, Akrnal Dulina, and Nor Adnin Islami for their support and

encouragement they have provided me over the project and also to all my Housemates

and Friends.

Page 7: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

ABSTRACT

This final project involved the design of a fully functional, multi-purpose digital

thermometer. This was attempt at producing a portable device that could be widely used

for a variety of different purposes. For example, think of the many situations where the

precise measurement of temperature is of high importance. Temperature control and

monitoring is important in homes for the comfort of its occupants. The main objective

for this project is to develop a program that can measure surrounding temperature and

can communicate between the sensor and microcontroller and then can monitor the

temperature using the digital display. The purpose of the project is to build or design a

system that can measure surrounding temperature and then give warning using the alarm

after the temperature displayed on LCD. This temperature will be detected by thermistor

sensor detector. The data will be sent in analog signal after that will be converting using

analog to digital converter (ADC). The developed program will process all data in order

to display the temperature on LCD screen.

Page 8: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

viii

ABSTRAK

Projek ini bertujuan membina dan merekabentuk suatu alat yang dapat mengukur

suhu pelbagai guna. Alat ini dapat digunakan untuk pelbagia kegunaan pada masa

hadapan. Sebagai contoh, banyak tempat memerlukan suatu alat pengukur suhu yang

tepat adalah sangat penting. Kawalan dan pemantauan suhu bagi sebuah rumah adalah

penting untuk keselesaan dalam sesuatu kerja. Objektif utama dalam projek ini adalah

untuk membangunkan sesuatu program yang dapat mengukur suhu persekitaran dan

dapat berkomunikasi antara pengesan suhu dengan pengawal mikro seterusnya dapat

memaparkan bacaan suhu dalam bentuk digital menggunakan paparan digital. Projek ini

juga bertujuan untuk mereka suatu alat pengukur suhu yang dapat mengukur suhu

persekitaran seterusnya dapat memberi amaran kepada pengguna selepas suhu di

paparkan pada paparan digital. Pengesan suhu ini akan dikesan menggunakan

thermistor. Kemudian isyarat akan dihantar menggunakan analog signal tetapi akan

ditukarkan menggunakan analog to digital converter (ADC). Suatu program akan dibina

terlebih dahulu untuk memproses segala data yang diperolehi dari pengesan untuk

dipaparkan pada paparan digital.

Page 9: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

TABLE OF CONTENTS

PROJECT TITLE

DECLARATION OF REPORT STATUS

DECLARATION

SUPERVISOR APPROVAL

DEDICATION

ACKNOWLEDGEMENT

ABSTACT

ABSTRAK

TABLE OF CONTENTS

LIST OF FIGURES

LIST OF TABLES

ABBREVIATION

CHAPTER 1 : INTRODUCTION

1.1 Project Introduction

1.2 Objective

1.4 Scope of Work

1.5 Problems Statement

1.6 Report structure

PAGE

1

ii

iii

iv

v

iv

vii

viii

ix

xii

xiv

Page 10: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

CHAPTER 2: LITERATURE REVIEW

Introduction

Microcontroller

PIC Microcontroller

2.3.1 PIC 16F84A

2.3.2 PIC16CXX Family

2.3.3 Data Memory Organization

2.3.4 Workflow

Negative Temperature Coefficient Thermistor

2.4.1 How NTC Temperature Sensors Function

Liquid Crystal Display (LCD)

Voltage Regulator (LM7805)

Software

Analog to Digital Converter (ADC)

2.6.1 ADC 083 1

Diode

CHAPTER 3: METHODOLOGY

3.1 Introduction

3.2 Overall Project Block

3.2.1 Hardware Design

3.2.2 PCB Fabrication

3.3 Data Processing

3.3.1 PIC microcontroller

3.4 Output

3.5 Methodology Flow Chart

3.6 Flow Chart Description

3.6.1 The Information about the project

Page 11: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

3.6.2 Research and the basic project circuit

3.6.3 Research and the basic project circuit

3.6.4 Designing a project circuit

3.6.5 Project circuit testing

3.6.6 Project circuit Testing Create a circuit on PCB

Programmer

3.7.1 Design Simulation

3.7.2 Multisim 2001

3.7.3 Proteus 7 Professional

3.7.4 MPLAB IDE Compiler

CHAPTER 4: RESULT

4.1 Introduction

4.2 Expected Results

4.3 Project Progress

4.3.1 Simulation Results

4.3.2 Simulation of DC-to-DC converter

4.4 Simulation of Hardware Design

4.4.1 Circuit Designing and Testing

4.4.2 LCD Display Testing

4.5 Hardware Design

CHAPTER 5: SUGGESTION AND CONCLUSION

5.1 Conclusion

5.2 Suggestion

REFERENCES

APPENDIX

Page 12: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

LIST OF FIGURES

TITLE PAGE

Block Diagram of Microcontroller

PIC 16F84A pins label

PIC 16F84A

Block Diagram of PIC 16F84A

Workflow Diagram for Complete Operation of PIC

Typical plot of resistance as a function of temperature for

an NTC temperature sensor.

Liquid Crystal Display (LCD)

The structure of the TN (Twisted Nematic) liquid crystal display

The crystal of the liquid crystal matches the constant direction

LM7805

PCB Wizard 3 Design Software

ADC model 083 1 CN

Diode and diode symbol

Block of Project

Etching Process

PCB Fabrication

Flow Chart for this project part A

Flow chart of this project part B

LM7805 voltage regulator

Power supply block diagram

Page 13: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

Power supply circuit diagram using Multisim 2001

DC-to-DC Converter

Result of the output voltage

Sample of circuit design using Proteus ISIS 7 Professional

The design cycle

Testing Power Supply Using Multisim

Output Voltage

Fully Project Circuit

Schematic Diagram

Selecting the program

LCD Display Testing

Data Output of LCD

LCD Output Display

Show the temperature

Show the PCB Design

Show the circuit design that printed on the board

Show the prototype of the project

Show the product print on Circuit Board

Show the finction of the project

Front view of the product

Show the side view of the product

Page 14: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

LIST OF TABLES

2.1 Pin Name of PIC 16F84A.

2.2 The pin assignment of LCD

PAGE

Page 15: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

ABBREVIATION

LCD

ADC

A D

DIA

LED

PIC

PCB

CS

CLK

DO

I10

RAM

ROM

HEX

C

K

F

MSB

BCD

EEPROM

UART

LSI

MPU

Liquid Crystal Display

Analog to Digital Converter

Analog to Digital

Digital to Analog

Light Emitting Diode

Peripheral Interface Controller

Printed Circuit Board

Chip Select

Clock

Data Output

Input Output

Random Access Memory

Read Only Memory

Hexadecimal

Celsius

Kelvin

Fahrenheit

Most Significant Bit

Binary Code Decoder

Electrical Erasable Programmable Read Only Memory

Universal Asynchronous Receive and Transmit

Large-scale Integration

Microprocessor

Page 16: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

MCU

DIP

UV

SFR

GPR

CPU

NTC

IDE

CE

IC

- Microcontroller

- Dual Inline Package

- Ultra Violet

- Special Function Register

- General Purpose Register

- Central Processing Unit

- . Negative Temperature Coefficient

- Integrated Development Environment

- Chip Enable

- Integrated Circuit

Page 17: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

CHAPTER 1

INTRODUCTION

1.1 Project Introduction

This project involved the design of a fully functional, multi-purpose digital

thermometer. This was attempt at producing a portable device that could be widely used

for a variety of different purposes. For example, think of the many situations where the

precise measurement of temperature is of high importance [14]. Temperature control and

monitoring is important in homes for the comfort of its occupants. It is important for

gardeners who want to carefully monitor the atmospheric conditions within a

greenhouse. It is also important in ensuring the correct operation of various electronic

devices where many components may have a sensitive dependence on temperature.

Likewise, this digital thermometer comes equipped with an alarm feature which

allows the user to program a specific temperature range. This is accomplished by

entering lower and upper bound temperatures via four push buttons on the user interface.

When the temperature recorded by this device crosses one of these boundary points, the

"alarmt1 is triggered by flashing a message (HOT! or COLD) in the display window.

Overall, this feature, in particular, greatly extends the applicability of our digital

thermometer. The temperature-range interrupt feature could enable this device as a

Page 18: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

control unit which drives an air conditioner, fan, or heater in a climate controlled

environment or it could send a control signal to turn on a sprinkler system if the upper

threshold is passed [2].

1.2 Objective

To accomplish a project, the objective of the project must be clear and can be

understand to achieve. So, the objectives of this project are:

i. To develop a program that can measure surrounding temperature and can

communicate between the sensor and microcontroller.

ii. To create a program that can monitor the temperature with digital display.

iii. To study and recognize the type of thermistor and sensor that appropriate with

project design.

iv. To explore how the microcontroller will operate.

13 Scope of Work

The purpose of the project is to build or design a system that can measure

surrounding temperature and then give warning using the alarm after the temperature

displayed on LCD [2]. This temperature will be detected by thermometer sensor

detector. The data will be sent in analog signal and then will convert into digital signal

using analog to digital converter (ADC). The developed program will process all data in

order to display the temperature on LCD screen. All the process will execute in

microcontroller. If the value does not satis@ the user requirement, the alarm will be

activated [3].

Page 19: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

Some of the thermistor available in market is a device that can measure

temperature and at the same time user can easily set the range of temperature depending

on differentiate device and it can make electric device better functional. This method can

make equipments last longer especially electric device. It is because they respond

quickly to temperature changes, even small temperature increases cause their resistance

to decrease significantly. The user can easily set the temperature range about -55 T to

300°C [4].

1.4 Problems Statement

Nowadays, temperature become unstable and not all device can hold the

extremely high and low temperature. To conclude, this electric device needs a medium

or other instrument that can control surrounding temperature and not affected the

internal component. As an example, the air conditioning system where it has sensor or

system that will ensure the air conditioner can hold much longer [4]. Thermistor is use

as a sensor where it can measure temperature and will react to shut or switch on some

device depending on suitability and user needs.

1.5 Report structure

The first chapter of this report is about the introduction. This chapter consists of

introduction of project, objective of project, problem statement, and scope of work and

the structure of this report.

The second chapter is about the literature review. This chapter shows the

research of project that related to the theory and concept through the certain figure. It is

about the explanation of the perspective and method of the past research and their

relationship with this project.

Page 20: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

The third chapter is about the research methodology. This chapter is explaining

the methods that used to overcome the problem of project such as the method to collect

the data, process and analyzing the data.

The fourth chapter is about the result and discussion. This chapter explains the

outcome of the project and comparison of this project with the past research. The

explanation is very effective with the certain figure and tables.

The fifth chapter is the last chapter which shows the conclusion and suggestion.

This chapter explains the summary of the project research that had been done. Also

shows the suggestion for any change or upgrade the project.

Page 21: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

LITERATURE REMEW

2.1 Introduction

To complete this project, many researches and analyze about the digital

temperature and their theories had been done. Several of sources were being the

reference for this research such as texts book, journals and internet source. From the past

research, many methods was achieved to solve the problem of this project and related to

the theory.

2.2 Microcontroller

Microcontroller is an essential device that change the electronics design topology

since its inception few decades ago. Basically, microcontroller is a computer system that

is fabricated in a single integrated chip. A microcontroller chip consists of Central

Processing Unit (CPU) memory modules, and several input / output peripherals.

Page 22: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

Control $---+l

Figure 2.1 : Block Diagram of Microcontroller [l]

Switches Memory Indicator

The microcontroller is used as a device that can form the basis of an embedded

system for electronics application. It provides a flexible lowast solution to bridge the

gap between singlechip computers and the use of large numbers of discrete logic chips.

Input Output Ports Ports

Depending on various manufactures, microcontroller is divided into several

categories, for examples 8-bit, 16-bit, 32-bit etc. Most commonly used microcontroller is

8-bit microcontroller. It is simple, small in size, and capable of doing most things related

with control and input 1 output devices [I].

As for the manufactures, the competitiveness of the microcontroller market has

encourages several big name companies to share a piece of the pie. Those companies

are Motorola (68HC 1 1,68HC 12), Intel (805 l), Atmel (AVR) and Microchip (PICmicro)

151-

3 Speakers

Page 23: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

23 PIC Microcontroller

The PIC microcontroller are based on RISC (Reduced Instruction Set Computer)

architecture, therefore use a relatively small number of instructions Most PICs used 35

instructions compared to some general-purpose microprocessors (like Motorola 68000

and Intel 8085) that may have hundred.

Important feature of modem PIC devices is use of electrically erasable and

programmable Flash memory for program storage. These Flash memory devices are

often denoted by the use of the letter 'F' as part of the device coding (e.g PIC16F84).

Flash devices are much easier to work for one-off prototyping because erasure and

reprogramming is greatly simplified [4].

23.1 PIC 16F84A

PIC16F84A is a group of PIC16CXX family of low cost, high performance,

CMOS, hlly static and &bit microcontroller. A PIC16F84A microcontroller typically

achieves a 2: 1 code compression and up to 4: 1 speed improvement at 20 MHz over &bit

microcontroller in their class. The PIC16F84A has up to 68 byte of RAM, 64 byte of

Data EEPROM memory and 13 inputs or outputs. A timer or counter also available [S].

Figure 2.2: PIC 16F84A [lo]

Page 24: DESIGN A MULTI-FUNCTION DIGITAL THERMOMETER MD

Figure 2.3: PIC 16F84A pins label [lo]

The PIC 16F84A has special controller to reduce external components, thus

reducing cost, enhancing system reliability, and reducing power consumption. There are

four oscillator options, of which in single pin RC oscillator provides a low cost solution,

the LP oscillator minimizes power consumption, XT is a standard crystal and the HS is

for High Speed Crystal. The SLEEP (power down) made offers power sawing. The user

can make the chip from sleep through several external and internal interrupts and resets

131-

A microcontroller is a computer. All computers whether it is the desktop

computer or a large mainfiame computer in a major corporation or a micr~~~ntroller

have several things in common. For example, all computers have a CPU (Central

Processing Unit) that executes programs. The CPU loads the program from somewhere.

On a desktop machine the browser program is loaded from the hard disk. The computer

has some RAM (Random Access Memory) where it can store variables. The computer