USB MUG WARMER AMINURRASYID BIN ABASumpir.ump.edu.my/id/eprint/332/1/3255_Amminurashid.pdf ·...
Transcript of USB MUG WARMER AMINURRASYID BIN ABASumpir.ump.edu.my/id/eprint/332/1/3255_Amminurashid.pdf ·...
i
USB MUG WARMER
AMINURRASYID BIN ABAS
A thesis submitted in partial fulfilled of the
requirement for the awarded of the Degree of Bachelor of Electrical & Electronic
Engineering
Faculty of Electrical & Electronic Engineering
Universiti Malaysia Pahang (UMP)
November, 2008
ii
“All the trademark and copyrights use herein are property of their respective owner.
References of information from other sources are quoted accordingly; otherwise the
information presented in this report is solely work of the author.”
SIGNATURE: _________________________________________
AUTHOR : AMINURRASYID BIN ABAS
DATE: 3 NOVEMBER 2008
Specially Dedicated to:
To my beloved father and mother …
Who always give me a courage to finish this thesis.
Also, to those people who have guided and inspired me throughout my journey. Thank you for
the supports and advices that have been given.
iv
ACKNOWLEDGEMENT
Firstly, I would like to thank my family for their support through all this year. I have been in Universiti Malaysia Pahang. Next, also thank you to my supervisor, Mdm. Ezrinda bte Mohd Zaihidee. This thesis could not have been written without her advice and support throughout my final year project.
Secondly, I would like to thanks the entire lecturer especially to my personal advisor which is Mrs Zainah bin Mat Zin because she always gives me moral support and idea to initialize my project.
Last but not least, I would like to thanks all my friends and all that have involve in helping me directly or indirectly. Without your support and help, this project would not success.
vi
ABSTRACT
The using of USB technology is quite popular in this era. We can prove it by
looking at the latest products which using it such as USB fan, USB lamp, USB mouse, USB
printer and many other types of equipment. Another proves is by looking at the specification
of latest computer. For example, latest laptop does not provide other port except USB port.
Usually, we can found another port such as parallel port and serial port at Personal computer
(PC) only. For this PSM project, UBS will be using as power supply for this mug warmer.
vii
ABSTRAK
Penggunaan teknologi USB amat popular pada masa kini. Buktinya, kita boleh
melihat pelbagai produk terkini yang menggunakan teknologi USB seperti kipas USB, lampu
USB, printer USB, dan produk-poduk yang lain. Bukti yang lain pula ialah dengan melihat
specifikasi komputer pada masa kini. Contohnya, komputer riba terkini tidak menyediakan
soket selain soket USB. Biasanya, kita cuma menjumpai soket-soket seperti soket paralal dan
soket serial pada komputer meja. Untuk projek PSM ini, USB akan digunakan sebagai
sumber tenaga bagi pemanas cawan ini.
V
TABLE OF CONTENTS
CHAPTER TITLE PAGE
TITLE PAGE i
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENT iv
TABLE OF CONTENTS v
ABSTRACT vi
ABSTRAK vii
LIST OF FIGURES viii
LIST OF APPENDICES ix
1 INTRODUCTION 1
1.1 Background 1
1.2 Scope of Project 2
1.3 Objective 2
1.4 Methodology 3
1.5 Thesis Outline 5
2 LITERATURE REVIEW 6
2.1 Introduction 6
2.2 Previous Journal 6
2.2.1 Thermostat 6
2.2.2 Automatic Egg Incubator 7
2.2.3 Digital Temperature Sensor 9
V
3 SYSTEM DESIGN 12
3.1 Overall System Design 12
3.2 Hardware Design and Development 12
3.2.1 Introduction 12
3.2.1.1 Heater Circuit 12
3.2.1.2 Sensor Circuit 14
3.3 Software Design and Development 15
3.3.1 Introduction 15
3.3.2 Type of Software Development 15
3.3.3 Graphical User Interface (GUI) 15
3.3.4 Writing a Program 17
3.3.4.1 MScomm Module 17
3.3.4.2 Display GUI Mode Module 17
3.3.4.3 Error Temperature Module 17
4 RESULT 18
4.1 Introduction 18
4.2 Hardware 18
4.3 Software 19
5 CONCLUSIONS AND RECOMMENDATIONS
5.1 Conclusions 22
5.2 Problem Encountered 22
5.3 Future Recommendation 24
REFERENCES 25
V
APPENDICES 26
Appendix A 26
Appendix B 28
Appendix C 31
Appendix D 32
Appendix E 33
Appendix F 34
Appendix G 35
Appendix H 52
Appendix I 64
Appendix J 83
viii
LIST OF FIGURES
FIGURE TITLE PAGE
2.2.2 Automatic Egg Incubator 9
2.2.3 Digital Temperature Sensor 11
3.2.1.1 Heater Circuit 13
3.2.1.2 Sensor Circuit 14
3.3.3 Example of Visual Basic 16
4.2 Picture of Project 19
4.3 Example of Visual Basic 21
ix
LIST OF APPENDICES
APPENDIX TITLE PAGE
A Display GUI Mode Code 26
B MScomm Module Code 28
C Error Temperature Code 31
D Heater Circuit 32
E Sensor Circuit 33
F Aluminium Plate 34
G Datasheet of DS1621 35
H Datasheet of USB Electrical Connector 52
I Datasheet of USB 2.0 design 64
J Datasheet of Zener Diode 83
1
CHAPTER 1
INTRODUCTION
1.1 BACKGROUND
In this sophisticated era, people are basically likes to do multiple jobs at certain
time. This is because of nowadays condition which forces them to do it. For example, a lot of
peoples nowadays use computer or laptop as a medium or equipment for them to do their
jobs. So, at the same time, they drink and sometimes eat while they are using the computer.
Peoples also like the portable equipment and portable software because this will convenient
them. As a solution, by combining multiple works with portable equipment concept, we can
create some prototype for their needs. In this case, we take a word “drink” as a main idea. By
combining this idea with portable USB technology, we can create a mug warmer. This
warmer will not heat water until it boiled. But it only heats the water to certain temperature
only which classified as warm condition. By using USB as power supply, computer users that
like warm water while doing their job can using this equipment in order to ensure their water
in warm condition. Basically, this project used USB 2.0 technology as a power supply. Mug
will act as heating item where the 5V from USB will trigger the heater to heat the iron plate.
At the same time, graphical user interface are applied onto this project.
2
1.2 SCOPE OF PROJECT
This project is focused on heating the iron plate and display the temperature of the
iron plate at the computer. This project is restricted / effective to a small type of mug with a
low volume of water. Graphical User Interface is also applied into this project.
1.3 OBJECTIVE
The objective of this project is to develop a mug warmer based on USB technology. This prototype will be able to heat a specific type of mug with a specific volume of water. Another objective is to apply GUI technique based on temperature sensor.
3
1.4 METHODOLOGYSTART
Literature review about the project topic
Design sensor circuit
Design power circuit
Develop the VB programming
Assemble the program
Develop the hardware for mug
warmer system
Develop the VB programming
Success
Yes
No
No
4
Figure above show the flow chart of work progress. First of all, the literature
review is done after decided the title project that is USB Mug Warmer. The content of the
literature review are from the internet, library, and also from the lecturer. All of them have
to be saving because it can be use it as references soon. Then, by referring the sources, the
better hardware and the software are chosen.
Stability test
Test
Combining hardware and programming circuit
Testing for heating process
Success
Combining hardware and programming circuit
Yes Yes
Yes
No
STOP
5
Basically the process was divided into two parts. The first part one is hardware
development and the second one is software development. For the hardware, the system’s
circuit is studied especially the temperature sensor, USB architecture and heater plate
design. Then, all are combining and assemble together. The detail about hardware is as
below:
[1]Hardware Development:
For hardware, it divided into 2 parts which is heater circuit and sensor circuit.
Both circuits will require 5V voltage and 2.5W from power supply. That value of power
supply is same with the value that supplied by USB 2.0 ports. Data from digital temperature
sensor DS1621 will be sending to ADC before sending to computer by serial communication.
For software development, the main purpose is to display the temperature in computer either
in words or graphically. The detail about hardware is as below:
[2]Software development:
Software development involved the application of Graphical User Interface (GUI)
into the circuit. Visual Basic 6.0 are selected as main software for this project. Data from
analog digital converter (ADC) will be sending to computer by serial port. Then, the data will
be modified in visual basic and will be displayed in computer as indicator to the heating
process at hardware. Anything that occurs at hardware will cause changes in software.
6
After both parts are ok, process of integration are made. Then, this system has to
be tested to the mug. Usually in the simulation result is not same as the real. That why
testing and analyzing are did in order to get the better result. Lastly, the report is writing.
1.5 THESIS OUTLINE
Chapter 1 discuss on the background of the project, objectives, scope of the
project, problem statement, methodology and also the thesis outline. Chapter 2 focuses on
literature reviews of this project based on journals and other references. Literature review is
based on the previous project or journal that related to this project. Chapter 3 mainly discuss
on the system design of the project. Details on the progress of the project are explained in
this chapter. Details on the progress include figure of circuits and picture about this
prototype. Chapter 4 presents the results of the project. The discussion focused on the result
based on the experiment. Chapter 5 concludes overall about the project. Obstacles faces and
future recommendation are also discussed in this chapter.
7
CHAPTER 2
LITERATURE REVIEW
2.1 INTRODUCTION
In this chapter include the study of previous journal and project that related to this project.
2.2 PREVIOUS JOURNAL
2.2.1 Thermostat
A thermostat is a device for regulating the temperature of a system so that the
system's temperature is maintained near a desired set point temperature. The thermostat does this
by controlling the flow of heat energy into or out of the system. That is, the thermostat switches
heating or cooling devices on or off as needed to maintain the correct temperature. Thermostats
8
can be constructed in many ways and may use a variety of sensors to measure the temperature.
The output of the sensor then controls the heating or cooling apparatus.
2.2.2 Automatic Egg Incubator.
There are prominent needs for egg incubators around the globe, because of many
factors. A person fascinated by birds likes to raise ornamental birds but he couldn’t find or get a
broody bird as such, non vegetarians eat birds where in most cases they are imposed to take birds
that are raised through artificial injections, in many cases even if we have an egg in hand we
can’t hatch the egg naturally since it is difficult to find the bird and get it hatched etc. All these
matters expose the importance of this project called Automatic Egg Incubator.
The project that is being portrayed here implements an Automatic Egg Incubator using ATMEL
AVR ATMEGA32. The main four parameters in any bird hatching would be incubation
temperature, relative humidity inside the incubator, ventilation and egg turning. Hatching
temperature, optimum relative humidity, number days for hatch etc depends on the bird species.
The incubation area is an enclosed chamber with various mechanisms and controls. There is a
carrier which holds the eggs inside the chamber for an easy rotation of eggs. Above mentioned
four vectors have its own importance that failure in any one of them can cause lose of entire
hatch. Temperature of the incubation decides quality of the batch. Both low and high
temperatures lead to decreased hatchability and produce weak chicks. So keeping incubation
temperature at optimum value is a must. Mixing ensures uniformity of temperature and humidity
inside the chamber to prevent localization of any factors. Aeration takes in fresh oxygen and
removes carbon dioxide gas evolved out of egg shells out. Egg turning ensures entire mixing of
albumen to provide sufficient nutrients. Looking holistically, all of the above factors matters a lot
and an overall stability has to be attained by adjusting all of them. AVR ATMEGA32 maintains
9
this equilibrium perfectly by using the features and peripherals available on it. The design files
and relevant documents explains how the entire system is setup and ATMEGA32 manage those
four vectors. Two digital thermometer chips DS1631 acts as dry and wet electronic
thermometers, DS1307 acts as the time keeping RTC for the entire system and the LCD provided
shows live status of the incubator. Both digital thermometer chips and RTC utilize the TWI
available on the ATMEGA32 microcontroller. Temperature control of the chamber is met
through a motorized kerosene wick lamp. Depending on the wet temperature reading, AVR
controls exposure of the wick to keep temperature within the range. Relative humidity is
calculated from the dry and wet electronic thermometer readings and duration of aeration is
decided on this reading. RTC maintains overall timing of the system which includes; aeration,
mixing of air inside the chamber, rotation of eggs, tracking the number of days etc Additional
features of the system are: signaling first hatch and monitoring the baby, by detecting sound of
the baby bird once baby breaks egg shell. This feature is being implemented by utilizing ADC of
ATMEGA32. Sound is picked up using a condenser microphone and is amplified and fed to
ADC input. Risk in any malfunction of motorized wick lamp is monitored using a LM35 based
temperature to voltage converter, with the voltage fed to another ADC channel. A siren will blow
sound in case of wick lamp and a C application has been developed to configure the no of days
for hatch, temperature etc depending on the bird. The communication protocol between PC and
the AVR is serial, implemented using USART module available on ATMEGA32. DC motors are
provided for rotation, mixing, aeration and wick lamp control, which are driven through motor
driver chips. Separate voltage regulator is provided for these motors to prevent spurious signals
and momentary currents from entering the AVR supply line. To provide necessary torque, simple
gear from a mechanical clock is used. The entire board works on 5V power supply. For normal
operation, system is powered from 230V line with rectifiers to convert AC to DC. NiCd Battery
backup is provided to power the system during power failures. There is a relay which manages
the switching between the rectifier supply and battery supply. A 2200uF capacitor provided on
the rectifier output eases the switching task without any fluctuations in the voltage. AVR
manages charging intervals of the battery along with RTC. Although there are many incubators
available in market, most of them are not affordable to the common man and many of them rely
on heating coils which uses AC power supply. Those incubators can’t be used in remote areas
and where there are frequent power failures. As a remedy for this problem, this project
10
implements a kerosene lamp based design, which is more reliable. In the case of remote
locations, whole control circuit and related stuffs can be powered from a 12V solar panel.
Below is the block diagram of this past project:
Figure 2.2.2
2.2.3 Digital Temperature Sensor
The use of temperature devices in temperature measurement and sensing has made
tremendous progress in the last few decades. There are a few types of measurement solutions that
you can implement in your projects. The use of thermostats or thermocouples is the two most
widely used devices in measurement solutions. The recent decade has seen the use of integrated
circuits devices in many temperature control related systems because they are much smaller,
provide a more accurate measurement and simpler to be integrated to other digital control
devices.
Most of the digital temperature sensor system has a built-in communication bus to
enable it to communicate with the master control IC. The most used communication interface is
11
called I2C, a simple bi-directional 2-wire bus that was developed by Philips Semiconductors in
the 1980's. Since then, many devices have this built in communication protocol that enables all
devices that have this feature to be linked together without any other additional components. The
I2C interfacing standard has become a world standard that is used in more than 1,000 integrated
circuits.
I2C in Brief
The I2C standard basically defines the start, stop, and device selection addressing and data
transfer interfacing protocol. The hardware consists of 2 I/O lines called SDA and SCL lines.
START Condition
The Start Data Transfer is initiated when there is a change of state of SDA line from HIGH logic
to LOW logic while the SCL line is at HIGH logic. This is the START condition.
STOP Condition
The Stop Data Transfer is initiated when there is a
change of state of SDA line from LOW logic to HIGH
logic while the SCL line is at HIGH logic. This is the
STOP condition.
DATA Transfer Condition
The data transfer is done between the START and
STOP conditions with the data being transferred when
SCL transition from LOW to HIGH logic. Data is read when SCL is at HIGH logic. SDA line
data will only change when SCL line is at LOW logic. There is no limit to the number of data
bytes transferred and is determined by the master device. Acknowledgement of successful
transfer of data is done between the master and the slave devices at regular interval.
12
Digital Temperature Sensor Applications:
This device can be connected to the microcontroller using the SCL and SDA lines.
The features of the TMP100 sensor include:
Low Quiescent standby current of 0.1uA means if you choose a proper microcontroller,
the device using battery powered could last for years compared to the use of thermostat.
Temperature range from -55 °C to 125 °C.
Wide Power supply range from 2.7V to 5.5V.
Accuracy of +/- 2.0 °C.
Resolution up to 0.0625 ° C.
The typical application of the TMP100 digital temperature sensor is as shown in the diagram
below.
Figure 2.2.3
13
CHAPTER 3
SYSTEM DESIGN
3.1 OVERALL SYSTEM DESIGNS
For this chapter, it divided into two main parts which is hardware part and
software parts. Further explanation is as below:
3.2 HARDWARE DESIGN AND DEVELOPMENT
3.2.1 Introduction
The main purpose of this research is to develop the heater system design circuit
that suitable with USB 2.0 technology. According to the scope of the project, the main scope for
the hardware is only to develop circuit that can heat water but not to boil it. The main supply is
from USB 2.0 which is 5V voltage. For data transfer, it does not detail by using a specific port.
As mention before in previous chapter, hardware development is divided into two parts which is
power circuit/ heater circuit and sensor circuit.
3.2.1.1 Heater Circuit/Power Circuit
For this circuit, we connect the USB with 2 resistors. The selection of resistor
value is depended on some consideration. Firstly, the resistors should be able to handle the