Upload
others
View
5
Download
1
Embed Size (px)
Citation preview
(PFKE106) UNIVERSAL REMOTE CONTROL
MOHD RUZAIMI BIN MOHD ARIFFIN
This thesis is submitted as partial fulfillment of the requirements for the award of the
Bachelor Degree of Electrical Engineering (Control and Instrumentation)
Faculty of Electrical & Electronics Engineering
Universiti Malaysia Pahang
NOVEMBER 2007
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 : MOHD RUZAIMI BIN MOHD ARIFFIN
Date : 23rd NOVEMBER 2007
iii
DEDICATION
Specially dedicated to
My beloved parents, brother and sister.
iv
ACKNOWLEDGMENT
Alhamdulillah, the highest thanks to God because with His Willingness I can
complete the final year project in time.
I would like to express my gratitude to my dedicated supervisor, Mr Raja
Mohd Taufika bin Raja Ismail for guiding this project with clarity and that priceless
gift of getting things done by sharing his valuable ideas as well as his knowledge.
I also would like to thank to all UMP lecturers, electrical technicians, my best
colleagues and forumers from electronicsforum.net for their openhandedly and
kindly guided, assisted, supported and encouraged me to make this project a
reality.
The great cooperation, kindheartedness and readiness to share worth
experiences that have been shown by them will be always appreciated and treasured
by me. Once again, thank you very much.
v
ABSTRACT
With most pieces of consumer electronics, from camcorders to stereo
equipment, an infrared remote control is usually always included. Video and audio
apparatus, computers and also lighting installations nowadays often operate on
infrared remote control. There are many different coding systems in use, and
generally different manufacturers use different codes and different data rates for
transmission. A universal remote control was developed by using C language via
serial communication data transfer port. Basically, the Graphical User Interface
(GUI) for the Universal Remote Control program was developed by using Microsoft
Visual C++, the Microsoft application that enables the programmer to create
conventional console and Windows applications. The hardware was interfaced to PC
via the serial communication port. The remote can be operated on any standard TV,
DVD player, satellite receiver and air-conditioner, operate over range of 15 ft, easy
to use, and also reliable.
vi
ABSTRAK
Hampir kebanyakan peralatan elektrik dan elektronik hari ini, dari perakam
video kepada kelengkapan audio, unit kawalan jauh inframerah turut disertakan.
Peralatan video dan audio, sistem komputer dan pencahayaan rumah pada hari ini
beroperasi berasaskan unit kawalan jauh. Terdapat banyak system kod yang berbeza,
dan pada kebiasaannya pengeluar berlainan menggunakan kod dan kadar data
tranmisi yang berbeza. Sebuah alat kawalan jauh universal telah dibina dengan
menggunakan bahasa program C menerusi terminal data komunikasi serial.Pada
asasnya, antaramuka grafik pengguna untuk program kawalan universal telah
dibangunkan dengan menggunakan perisisan Microrosft Visual C++, sebuah perisian
Microsoft di mana ia membolehkan pemprogram untuk mencipta peraturan konsol
dan aplikasi Windows. Unit perkakasan (penghantar/penerima) dihubungkan ke
komputer melalui terminal komunikasi serial. Unit kawalan ini mampu beroperasi ke
atas pelbagai jenama televisyen, pemain DVD, set penerima satelit, dan penghawa
dingin, boleh beroperasi sehingga jarak 15 kaki, dan mudah dikendalikan.
vii
TABLE OF CONTENTS
CHAPTER CONTENTS PAGE
CHAPTER 1
CHAPTER 2
TITLE
DECLARATION
DEDICATION
ACKNOWLEDGMENT
ABSTRACT
ABSTRAK
TABLE OF CONTENTS
LIST OF TABLES
LIST OF FIGURES
LIST OF APPENDICES
INTRODUCTION
1.1 Introduction
1.2 Infrared Remote Control
1.3 Problem Statement
1.3.1 Problem Solution
1.4 Project Objectives
1.5 Project Scopes
1.6 Thesis Outline
LITERATURE REVIEW
2.1 Introduction
2.2 IR Remote Theory
2.3 Infra-Red Light
2.4 Modulation
2.5 The Transmitter
2.6 The Receiver
2.7 Universal Remote Control
i
ii
iii
iv
v
vi
vii
x
xi
xii
1
1
1
3
3
4
4
5
6
6
6
7
8
9
11
13
viii
CHAPTER CONTENTS PAGE
CHAPTER 3
CHAPTER 4
CHAPTER 5
2.8 Protocols
2.9 Types of Universal Remote Control
2.9.1 Learning Universal Remote Controllers
2.9.2 Lookup Table Universal Remote Controllers
2.10 Project Study
METHODOLOGY
3.1 Introduction
3.2 Title
3.3 Literature Review
3.4 Hardware Specification
3.5 Software Specification
3.6 Designing the Interface Software
3.7 Writing Report
HARDWARE SPECIFICATIONS
4.1 SURC Hardware
4.2 Signal Capture
4.3 Signal Playback
4.4 RS-232 Serial Communication Port
4.4.1 Pinouts
SOFTWARE SPECIFICATIONS
5.1 Overview of Software Implementation
5.2 Algorithm of Developing C Files
5.3 The Application Layout of Visual C++
5.4 Building the GUI Interface Application
5.4.1 SURC GUI Interface
5.5 Compile, Build and Release
13
15
15
16
17
18
18
18
18
20
20
20
21
22
22
23
24
25
26
27
27
28
29
33
34
36
ix
CHAPTER CONTENTS PAGE
CHAPTER 6
CHAPTER 7
5.5.1 Debug
5.5.2 Release
RESULT AND DISCUSSION
6.1 Introduction
6.2 Design of the SURC Hardware
6.3 Design and Analysis of the GUI
6.4 Learning, Storing and Transmitting Process
6.5 Signal Analysis
6.5.1 SHARP TV Remote Controller
6.5.2 JVC DVD Player Remote Controller
6.5.3 HP Laptop Remote Controller
6.5.4 ASTRO Satellite Receiver Controller
6.6 Problems and Troubleshoot
6.6.1 SURC Hardware
6.6.2 SURC Software
CONCLUSION AND RECOMMENDATION
7.1 Introduction
7.2 Conclusion
7.3 Recommendation and Future Expectation
7.3.1 Cost and Commercialization
REFERENCES
APPENDICES
APPENDIX A: Source Code for Visual C++
APPENDIX B: Circuit Diagram
APPENDIX C: GP1UX51QS IR Receiver Datasheet
37
38
40
40
40
42
44
46
46
48
50
53
55
55
56
58
58
58
59
59
62
63
63
73
84
x
LIST OF TABLES
TABLE TITLE PAGE
Table 2.1
Table 4.1
Table 7.1
Table 7.2
Table 7.3
Sony Control-S protocol
RS-232 serial port pin assignment
Cost for the casing and cabling
Cost for the transceiver circuit
Overall cost for one universal remote control unit
14
26
59
60
60
xi
LIST OF FIGURES
FIGURE TITLE PAGE
Figure 2.1
Figure 2.2
Figure 2.3
Figure 2.4
Figure 2.5
Figure 2.6
Figure 2.7
Figure 2.8
Figure 2.9
Figure 3.1
Figure 3.2
Figure 3.3
Figure 4.1
Figure 4.2
Figure 4.3
Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4
Figure 5.5
Figure 5.6
Figure 5.7
Figure 5.8
IR light emitted from a RC
Signal modulation
IR LED transistor circuit
IR LED transistor circuit with two diodes in series
Block diagram of an IR receiver
IR receiver
Sony TV pulse signal
Universal learning remote control
Example of lookup table
Block diagram of the proposed solution for the
universal remote control
Transmitting signal flow chart
Flowchart of Methodology
Circuit for capture and timing function
IR transmitter circuit
RS-232 serial port
Basic algorithm for developing the SURC software and
GUI
Choosing the type of project application to be created
Blank workspace
Adding file to Visual C++ project
Blank text file to write program
Library command for learning sub-program
Output command for displaying words and reading
data from serial input
Insert Resource window
7
8
9
9
11
11
15
16
17
19
19
21
23
24
25
28
30
30
31
31
32
32
33
xii
FIGURE TITLE PAGE
Figure 5.9
Figure 5.10
Figure 5.11
Figure 5.12
Figure 5.13
Figure 5.14
Figure 5.15
Figure 5.16
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 6.5
Figure 6.6
Figure 6.7
Figure 6.8
Figure 6.9
Figure 6.10
Figure 6.11
Figure 6.12
Figure 5.9 Workspace with basic menu box
Configuration window model workspace
Learn window model workspace
The code for linking the program with button in GUI
Main control window design
Building project
Switching from Debug to Release mode
Executing SURC application from Visual C++
Front view of the SURC hardware box
Rear view of the box with top cover opened
Top view of the circuit
Configuration window
Learn window
Main SURC program window
Transmitting IR signal from a remote control unit
Saving a control button
Selecting the type of remote and button code to
transmit
IR LED transmitting pulse code signal
(a) TV “channel up” output signal from remote control
unit
(b) TV “channel up” output signal from SURC
hardware unit
(a) TV “power” output signal from remote control unit
(b) TV “power” output signal from SURC hardware
unit
33
34
35
35
36
37
38
39
41
41
42
43
43
44
45
45
45
46
47
48
xiii
FIGURE TITLE PAGE
Figure 6.13
Figure 6.14
Figure 6.15
Figure 6.16
Figure 6.17
Figure 6.18
Figure 6.19
Figure 6.20
(a) DVD player “power” output signal from remote
control unit
(b) DVD player “power” output signal from SURC
hardware unit
(a) DVD player “stop” output signal from remote
control unit
(b) DVD player “stop” output signal from SURC
hardware unit
(a) HP laptop “DVD player” output signal from remote
control unit
(b) HP laptop “DVD player” output signal from SURC
hardware unit
(a) HP laptop “My Picture” output signal from remote
control unit
(b) HP laptop “My Picture” output signal from SURC
hardware unit
(a) HP laptop “Power” output signal from remote
control unit
(b) HP laptop “Power” output signal from SURC
hardware unit
“Power” output signal from ASTRO remote controller
“Info” output signal from ASTRO remote controller
“Guide” output signal from ASTRO remote controller
49
50
51
52
53
54
54
55
xiv
LIST OF APPENDICIES
APPENDIX TITLE PAGE
APPENDIX A
APPENDIX B
APPENDIX C
Source Code for Visual C++
Circuit Diagram
GP1UX51QS IR Receiver Datasheet
63
83
84
1
CHAPTER 1
INTRODUCTION
1.1 Introduction
This chapter explains about the characteristic of infrared remote control and
how they function. This chapter also explains about the problem statement,
objectives of the project, project scopes and thesis outline.
1.2 Infrared Remote Control
With most pieces of consumer electronics, from camcorders to stereo
equipment, an infrared remote control is usually always included. Video and audio
apparatus, computers and also lighting installations nowadays often operate on
infrared remote control. The carrier frequency of such infrared signals is typically in
the order of around 36 kHz. The control codes are sent in serial format modulated to
that 36 kHz carrier frequency (usually by turning the carrier on and off). There are
many different coding systems in use, and generally different manufacturers use
different codes and different data rates for transmission.
"IR" stands for infrared. Infrared light is invisible since its frequency is below
that of visible red. Otherwise, it is like any other light source, operating under the
same laws of physics. In most cases, the IR signals are produced by an LED source.
2
TV remotes send commands only one way, in a low-speed burst for distances
of up to 30 feet. They use directed IR with LEDs that have a moderate cone angle to
improve ease-of-use characteristics. The IR signal sent out by those devices is
generally modulated to around 38 kHz carrier using amplitude shift keying (carrier
on or off). The data rate send is generally in range of 100-2000 bps. There are some
IR systems which use other frequencies and other modulation systems.
IR transmit and receive systems are inexpensive and are generally reliable.
However, interference from other IR sources can be a minor issue. Interference can
come from IR remote controls, IR audio systems (these broadcast an IR signal
continuously) or other IR sources. Interference can also be caused by other light
sources such as fluorescent lights (the ballast can cause IR interference). Sometimes
some electronic ballasts powered light can cause interference problems. In order to
avoid any interference with this kind of equipment, the operating frequency of all
electronic ballasts has to be chosen so that problems in the 36 kHz frequency area are
out of the question.
Many existing IR systems modulate the IR light at around 36-40 kHz (this is
the frequency of the IR carrier and should not to be confused with the actual
frequency of the IR light itself). The possibility of interference is more likely around
the 40 kHz frequencies. One way to limit interference is to use higher IR carrier
frequencies. Some IR systems now use carrier frequencies into the megahertz region.
Generally infrared remote controls are a 32-40 kHz modulated square wave
for communication. This square wave is then send to IR transmitter (IR LED). The
carried frequency is amplitude modulated by the data, usually full on/off type
modulation. The data rate is typically in 50-1000 bit/s range depending on the system
used. Usually the transmitter part is constructed so that the transmitter oscillator,
which is driving the infrared transmitter LED, can be turned on/off by applying a
TTL voltage on the modulation control input (the signal that goes here is usually
serial data from remote control keyboard decoding IC). On the receiver side a
photodiode takes up the signal. The integrated circuit inside a typical receiving chip
is sensitive only around a specific frequency in the 32-40 kHz range. The output is
the demodulated digital input, just what was used to drive the transmitter. The output
3
is the demodulated digital input, just what was used to drive the transmitter. Usually
this kind of receivers work so that when IR the carrier is present, this output is high.
When no carrier is detected, the output is low. This type of circuits can usually
transmit a 1-3 kHz digital signal through infra light. When trying to receive IR
signals, leave demodulation to one of the special IC's/modules meant for this and
deal with the data only.
The free air IR data transmission, IR remote control as well as the most
optoelectronic sensors and light barrier systems work with a wavelength between
870nm and 950nm.
The system described above is not the only one IR remote system in use, it is
just the most commonly used one. Asystem that use unmodalated signals of a one
kHz or 100 kHz (and several other frequencies) exist as well.
1.3 Problem Statement
There is no doubt that remote controls are extremely popular and it has
become very hard to imagine a world without them. Nowadays it is not surprise to
see 4 or 5 different remote control units in an average living room. TV, Stereo set,
DVD player, Air-conditioner and a Satellite receiver are among the most popular
devices and each and every one of them has a unique remote control unit. No wonder
that people want to control all these devices with one single universal remote control
unit. Problems also occur when some of the remote unit stops functioning, broke or
lost.
1.3.1 Problem Solution
A universal remote control is going to be develops by using C language via
serial communication data transfer port. Basically, the Graphical User Interface
4
(GUI) for the Universal Remote Control program is going to be develop by using
Microsoft Visual C++, the Microsoft application that enables the programmer to
create conventional console and Windows applications. The circuits were constructed
from two modules, one to capture the signal and provide timing functions, and the
second as transmitter placed somewhere near the target equipment. The hardware
was interfaced to PC on the communication port, using the Data lines 1 and Data
lines 5 as input, and Data lines 3 and 5 as output. The remote can be operated on any
standard TV, DVD player, satellite receiver and air-conditioner, operate over range
of 15 ft, easy to use, and also reliable.
1.4 Project Objectives
The objective of this project is to develop a functional universal serial remote
control software or program that will make it possible for all people to control any
brand of their TV, DVD player, Satellite receiver and other remote control based
electrical appliances from their personal computer or notebook.
1.5 Project Scopes
This project was developed by using C language and Microsoft Visual C++
for the Graphical User Interface (GUI). The prototypes can receive and store the data
in the computer memory for every function button that it learn from a remote control
unit, and transmit it back after that.
The program or software for the serial universal remote designed to be run in
Windows.
For this project, the scope of electrical appliances expected to be test and
analysed with standard brand of Television, DVD player, ASTRO satellite receiver
and HP notebook.
5
The hardware was constructed from two modules:
(i) Receiver to capture the signal, stores the data, and provides timing
functions.
(ii) Transmitter to resend the data stream under computer control placed
somewhere near the target equipment.
1.6 Thesis Outline
Chapter 1 explains about the characteristic of Robot and its implementation to
the industry and interfacing with the computer. It also explains about project
objectives, problem statement and project scopes.
Chapter 2 explains about the literature review including the applications in
daily life and feedback from users. It also includes review articles of the past project
from other party.
Chapter 3 discuss about the methodology that have been taken to develop this
project. This methodology is important to make sure the project is finish on time.
Chapter 4 focuses on hardware specifications and describe about serial port,
input port in the receiver circuit and output port for transmitter circuit.
Chapter 5 describe about software specifications including Visual C++,
source code (.c) and header files (.h).
Chapter 6 is for result of this project and the discussions. This also including
problem faced while finishing this project.
Chapter 7 concludes this project and the future enhancement that can be done
on this project.
6
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
This chapter review about the remote control, how it works, the protocol, the
universal remote control, types and the software used to program the graphical user
interface (GUI) for Serial Universal Remote Control (SURC).
2.2 IR Remote Control Theory
The cheapest way to remotely control a device within a visible range is via
Infrared light. Almost all-audio and video equipment can be controlled this way
nowadays. Due to this wide spread use the required components are quite cheap, thus
making it ideal for us hobbyists to use IR control for our own projects.
This part of my knowledge base will explain the theory of operation of IR
remote control, and some of the protocols that are in use in consumer electronics.
7
2.3 Infra-Red Light
Infrared actually is normal light with a particular colors. Humans can't see
this colors because its wavelength of 950nm is below the visible spectrum. That's one
of the reasons why IR is chosen for remote control purposes, we want to use it but
we're not interested in seeing it. Another reason is because IR LEDs are quite easy to
make, and therefore can be very cheap.
Although humans can't see the Infrared light emitted from a remote control
doesn't mean it can't make it visible. A video camera or digital photo camera can
"see" the Infrared light as shown see in Figure 2.1. By using web cam, point a remote
to it, press any button and see the LED flicker.
Unfortunately for us there are many more sources of infrared light. The sun is
the brightest source of all, but there are many others, like: light bulbs, candles,
central heating system, and even our body radiates infrared light. In fact everything
that radiates heat, also radiates infrared light.
Therefore we have to take some precautions to guarantee that our IR message
gets across to the receiver without errors. [8]
Figure 2.1 IR light emitted from a RC
8
2.4 Modulation
Modulation is the answer to make our signal stand out above the noise. With
modulation we make the IR light source blink in a particular frequency. The IR
receiver will be tuned to that frequency, so it can ignore everything else.
You can think of this blinking as attracting the receiver's attention. We
humans also notice the blinking of yellow lights at construction sites instantly, even
in bright daylight.
In Figure 2.2, a modulated signal driving the IR LED of the transmitter on the
left side. The detected signal is coming out of the receiver at the other side.
Figure 2.2 Signal modulation
In serial communication we usually speak of 'marks' and 'spaces'. The 'space'
is the default signal, which is the off state in the transmitter case. No light is emitted
during the 'space' state. During the 'mark' state of the signal the IR light is pulsed on
and off at a particular frequency. Frequencies between 30kHz and 60kHz are
commonly used in consumer electronics.
At the receiver side a 'space' is represented by a high level of the receiver's
output. A 'mark' is then automatically represented by a low level. Note that the
'marks' and 'spaces' are not the 1-s and 0-s we want to transmit. The real relationship
between the 'marks' and 'spaces' and the 1-s and 0-s depends on the protocol that's
being used. More information about that can be found on the pages that describe the
protocols.
9
2.5 The Transmitter
The transmitter usually is a battery-powered handset. It should consume as
little power as possible, and the IR signal should also be as strong as possible to
achieve an acceptable control distance. Preferably it should be shock proof as well.
Many chips are designed to be used as IR transmitters. The older chips were
dedicated to only one of the many protocols that were invented. Nowadays very low
power microcontrollers are used in IR transmitters for the simple reason that they are
more flexible in their use. When no button is pressed they are in a very low power
sleep mode, in which hardly any current is consumed. The processor wakes up to
transmit the appropriate IR command only when a key is pressed.
Quartz crystals are seldom used in such handsets. They are very fragile and
tend to break easily when the handset is dropped. Ceramic resonators are much more
suitable here, because they can withstand larger physical shocks. The fact that they
are a little less accurate is not important.
The current through the LED (or LEDs) can vary from 100mA to well over
1A! In order to get an acceptable control distance the LED currents have to be as
high as possible. A trade-off should be made between LED parameters, battery
lifetime and maximum control distance. LED currents can be that high because the
pulses driving the LEDs are very short. Average power dissipation of the LED
should not exceed the maximum value though. You should also see to it that the
maximum peek current for the LED is not exceeded. All these parameters can be
found in the LED's data sheet.
A simple transistor circuit, as shown in Figure 2.3, can be used to drive the
LED. A transistor with a suitable HFE and switching speed should be selected for
this purpose.
10
Figure 2.3 IR LED transistor circuit
The resistor values can simply be calculated using Ohm's law. Remember that
the nominal voltage drop over an IR LED is approximately 1.1V.
The normal driver, described above, has one disadvantage. As the battery
voltage drops, the current through the LED will decrease as well. This will result in a
shorter control distance that can be covered. An emitter follower circuit can avoid
this. The 2 diodes in series, as shown in Figure 2.4 will limit the pulses on the base of
the transistor to 1.2V. The base-emitter voltage of the transistor subtracts 0.6V from
that, resulting in a constant amplitude of 0.6V at the emitter. This constant amplitude
across a constant resistor results in current pulses of a constant magnitude.
Calculating the current through the LED is simply applying Ohm's law again.
Figure 2.4 IR LED transistor circuit with two diodes in series
\