You are on page 1of 8

Construction

Design Your Own In- SUNIL K


UMAR

frared Remote
 Gp Capt. (Retd) K.C. Bhasin tion, which was adequate to encode a
set of 32 or 64 key functions as simple

M
ost of the home appliances binary values. With proliferation of the
like TV sets, stereo systems, remote-controlled devices, addition of
CD/DVD players/recorders, a device address or system code made
air-conditioners, microwave ovens, it possible to operate multiple devices
multimedia computers and set-top in the same room using the same com-
boxes come with an IR remote control. mand/instruction encoding scheme.
An infrared remote offers several For example, if we have five address
advantages: Fig. 1: Logic 1 format or system bits and six command bits,
1. It is a cost-effective signaling we can operate 32 devices using 64
system. electrical or mag- commands for each device, which may
2. Unlike radio-frequency-based netic interference, be used for identical or totally different
control devices, it is not subject to any the infrared sig- functions in each specific device.
stringent regulation and restriction. nal is somewhat The NEC format features error
3. It is a line-of-sight system with a subject to interfer- control. It is of primary concern to
range of 5 to 10 metres, hence its radia- ence from sunlight prevent false operation rather than
tion stays confined to a single room in and other infrared correct the wrong operation. In its
which it is used. It thus prevents inter- Fig. 2: Logic 0 format sources as also flu- most basic format, the transmitter
ference between units operating in dif- orescent lights. repeats each IR data frame (explained
ferent rooms even when using identical later) some minimum number of times.
device address and command code. The receiver compares the decoded
4. A relatively broad modulation data from two or more consecutive
frequency range is available using in- frames and ignores the signal if they
expensive ASICs and components. are not identical. Sony, for example,
5. It is generally insensitive to in- Fig. 3: Leader format Fig. 4: Repeat format uses such an approach in its standard
terference from external electrical or IR protocol called ‘SIRCS’ (short for
magnetic fields.
6. It offers relatively high energy
efficiency, which enhances the battery
life.
7. Infrared emitters and detectors
are inexpensive and readily available.
Limitations are:
1. Line-of-sight propagation be-
comes a limitation when you need to
control a device from another room.
2. Infrared is subject to mutual
interference from multiple sources
in the same room as most consumer
IR transmissions use a wavelength of Fig. 5: Typical NEC transmission (above) and expanded view of first frame (below)
either 880 or 940 nm (corresponding to
the two commonly available IR-emit- ‘Sony infrared control system’). This
ting LED types). This limitation can be Encoding methods technique is simple to implement and
tackled by using different sub-carrier Multitudes of different methods/for- quite reliable.
frequencies to modulate the light sig- mats/protocols for encoding the actual Another popular solution is to
nals coupled with different encoding key/command/instruction data have send both the command value and its
schemes to carry the data content. evolved. Early IR command codes inverse. The receiver then compares
3. Although largely immune to comprised five or six bits of informa- the two halves of the received data and

9 6 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Parts List
(NEC Remote)
Semiconductors:
IC1 - CD6121 remote Tx 20-pin
SMT
T1 - BC548 npn transistor
IR LED1 - LD271 or equivalent IR
LED
LED1 - Red LED
Resistors (all ¼-watt, ±5% carbon):
R1 - 330-ohm
R2 - 1-kilo-ohm
R3 - 2.2-ohm, 0.5W
R4, R5, R6 - (100-kilo-ohm)
Capacitors:
C1, C2 - 220pF ceramic disk
C3 - 47µF, 10V electrolytic
Miscellaneous:
K2, K3, K6
K14, K15,
K19, K28 - Tactile switch(10x10mm)
XTAL - 455kHz (2-pin) ceramic
resonator
BAT. - 2x1.5V=3V
- 2-cell battery holder
- PCB, etc

ries of abbreviated repeat signals (9ms


burst, followed by 2.25ms space ter-
minated with 560µs burst) after every
108 ms for as long as the key remains
(Note. Three linked resistors for achieving address ‘0076H’ and shaded keys for the command
codes as shown in Fig. 6 were used for the ‘Digital Audio Processor’ project published in EFY pressed. Since the repeat frame signal
Feb. 2005). The software for that digital audio processor has accordingly been modified and is consists of only a short ‘blip’ instead of
given in this month’s EFY-CD. Parts list and PCB details are given in this article.) the whole data frame, a key held down
Fig. 6: A complete schematic of NEC remote employing 32 keys for a long period uses less energy than
in many other encoding schemes.
The advantage of this approach
is conservation of battery power.
However, if the receiver misses the
first frame for any reason, no recovery
is possible as the subsequent signal
pulses are devoid of any data. The key
has to be released and pressed again
Fig. 7: Format of remote modulated output from pin 5 of encoder IC before anything happens. Also, error
detection in this approach requires use
ignores the command if they are not turers such as Pioneer, Onkyo, Akai, of data field and inverse data field.
complement of each other. NEC uses Canon, Goldstar, Hitachi, Kenwood,
such a format. NEC, Teac and Yamaha use NEC Features of NEC format
The third method makes use of format. Exceptions are Sony, Sharp, 1. 8-bit long addresses and 8-bit long
a checksum, which generally results Toshiba and Philips. In this article, commands are transmitted twice—
in a more compact frame size than we shall focus on NEC and Phil- however, the second (lower-order)
sending the data and its inverse. This, ips RC5 formats, which are more address byte is not necessarily an exact
however, requires a more complex commonly used. For both of these complement of the first (higher-order)
receiver-decoding algorithm. This for- formats, dedicated encoder chips address byte, while the second com-
mat is used by General Instruments. are available from a number of mand byte is a true complement of the
Some other encoding schemes include manufacturers. first command byte. Thus a total of 64k
built-in redundancy to facilitate error (216) addresses and 256 (28) commands
checking without the use of any added NEC-format remotes are possible. (Note. The LSB of the bit
data field. The actual data frame is sent only once pattern is transmitted first, followed
Majority of the Asian manufac- in the NEC format, followed by a se- by higher-order bits.)
2. Pulse-distance modulation
9 8 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
terpart.
Soldering the Small SMT Parts Example. Assume that the device
To solder small SMT parts such as resistors, capacitors, inductors, transistors and ICs, address is ‘8435H,’ where ’84H’ is the
proceed as follows: higher 8-bit address and ’35H’ is the
1. Add a small amount of flux to the area and add a small amount of the solder to one lower 8-bit address.
pad. ’84H’ in binary is ‘0010 0001’ (read
2. Pick up the component using tweezers, ensuring that the component is horizontal.
it from right to left). It transpires that
Alternatively, just move the component until it is close to the final position.
column lines C7 and C2 (pins 12 and
3. Whilst holding the component with your tweezers, melt the solder on the pad and
put the component into position. 17) need to be made ‘1’ using diodes
4. Remove the iron but continue holding the component until the solder solidifies. Check between these two pins and CCS pin
to see that the component is sitting flat on the PCB. If not, re-melt the solder whilst 20 (cathodes facing pin 20).
pushing gently on top of the component with tweezers. Now examine the lower 8-bit ad-
5. Solder the other side of the component. Re-melt the first solder joint and let it dress corresponding to ’35H’ or ‘1010
solidify. 1100’ (read it from right to left). Com-
6. Check your work under magnification. The joint should be shining and concave. If pare it with the higher eight bits (0010
you added too much solder, wick up with a small solder wick and try again. 0001). We observe that bits C0, C4, C5
and C7 are complementary, while bits
scheme is employed. the use of external diodes and resistors C1, C2, C3 and C6 are identical (not to
3. To improve noise rejection, and 32 command codes (expandable be complemented). Hence pull up the
the pulses are modulated at a carrier to 64 commands through SEL pin). A pins corresponding to bits C1, C2, C3
frequency of 38 kHz, so the IR receiver complete schematic employing 32 keys and C6 (pins 18, 17, 16 and 13) to Vcc
module chosen for the reception should is shown in Fig. 6. via 100-kilo-ohm resistors.
have an optimum response frequency The shaded keys, linked resistors 8-bit command (also called ‘data’).
of 38 kHz. (The 38kHz modulated and bold lines indicate the compo- With D7/SEL (pin 7) shorted to Vcc,
pulse is termed here as ‘burst.’) nents, keys, etc used for the remote the most significant bit (MSB) of the
4. Logic-’1’ bit time (Fig. 1) is 2.25 of digital audio processor (published command is set to ‘0.’ The command
ms (i.e., burst period of 560µs + space/ in EFY Feb. 2005). These fix the code (and its complement) is automati-
rest period of 1690 µs). address output as ‘0076H,’ while cally generated (along with leader and
5. Logic-’0’ bit time (Fig. 2) is 1.12 command codes used for the project address code, as already set) when a
ms (i.e., burst period of 560µs + space/ are given in the box inside the sche- row (R0 through R3) is momentarily
rest period of 560 µs). matic. shorted to the respective column lines
6. Leader code preceding the ad- Determining the output code. It C0 through C7 using switches/keys
dress field comprises 9ms burst fol- is necessary to configure the circuit marked K1 through K32.
lowed by 4.5ms space during data to output code corresponding to any The command code is ‘1’ less than
frame as shown in Fig. 3 or a 9ms burst of the possible 65,535 addresses and the key No., i.e., K1, when pressed,
followed by 2.25ms space followed by any of the first 32 commands (000000b generates decimal ‘0,’ while K32 will
560µs burst during a repeat frame as through 011111b, i.e., decimal ‘0’ generate decimal ‘31’ (11111000b, read
shown in Fig. 4. through ‘31’) or next 32 commands from right to left) or ‘1FH.’ You can
The data frame comprises leader (100000b through 111111, i.e., decimal similarly find out the command/data
code, address, address, command and ‘32’ through ‘63’). code generated by other keys. If you
command bits and an additional 560µs short D7/SEL (pin 7) to ground, add
burst. The data frame length is variable Fixing the address output decimal ‘128’ (80H) to the code gener-
between 58.5 and 76.5 ms depending (refer Fig. 7) ated otherwise.
upon the number of logic-0 and logic-1 Higher 8-bit address. Column lines
bits contained in a frame and so also is C0 through C7 (pins 19 through 12) Circuit description
the gap length between the last com- determine the corresponding bit value. Part of the circuit for generation of
mand bit and repetition frame. The gap If a column line is left open (i.e., not address and command signals has al-
is minimum 32 ms and maximum 49.5 connected to CCS pin 20 via diode), ready been explained in the preceding
ms (Fig. 5). the corresponding bit is ‘0.’ If it is con- paragraphs. IC1 can operate off a 2V-
A number of manufacturers make nected to CCS pin 20 via diode, the 3.3V battery (two cells of 1.5V each).
compatible ASICs for NEC-format corresponding bit is ‘1.’ The carrier frequency is determined
code transmission (µPD6121, CD6121, Lower 8-bit address. Lower eight by the frequency of the crystal/ceramic
PT2221 and HT6221, all equivalent to bits will be the complement of higher resonator connected across pins 8 and
each other) by employing minimal ex- eight bits unless the corresponding line 9. It is one-twelfth of the frequency of
ternal components. These ICs allow se- is pulled to Vcc. Else, those particular the crystal/resonator. With a 455kHz
lection of up to 65,536 device addresses bits will have the same logic value resonator, the carrier frequency is ap-
(also, called custom-codes) through as their higher 8-bit address coun- proximately 38 kHz.

1 0 0 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Parts List
(Philips RC-5 Remote)
Semiconductors:
IC1 - SC3010 RC5 encoder
T1 - BC548 npn transistor
IR LED1 - LD271 or equivalent
Resistors (all ¼-watt, ±5% carbon):
R1 - 1-kilo-ohm
R2 - 2.2-ohm, 0.5W
R3 - 1-kilo-ohm
Capacitors:
C1 - 47µF, 10V electrolytic
Miscellaneous:
XTAL - 455kHz ceramic
resonator
- 2-pin male/female
connector for battery
Fig. 8: Actual-size, single-side PCB layout for remote control digital audio processor
- Two-cell (pencil) holder
- 3-pin SIP connector (M)
with shorting link
- 25×10mm tactile
switches (N/O type)
- PCB

Table I
Systems and Their
Address Numbers (5-bit)
System address Equipment
(in decimal)
0 Tv set 1
1 Tv set 2
2 Videotext
3 Expansion for TV 1 and 2
Fig. 9: Component layout of remote control PCB 4 Laser video player
5 Video recorder 1 (Vcr 1)
CCS (pin 20) is custom-code-select 14 serial bits is repeated only once after
6 Video recorder 2 (Vcr 2)
(or device-address-select) input pin. a time interval of 88.9 ms (i.e. duration
7 Reserved
Pin 11 is the lamp/LED output, which of 50 bits), while a command key on
8 Sat 1
goes low when any key is pressed. The the remote remains pressed.
9 Expansion for Vcr 1 or 2
modulated output is available at DOUT In the biphase modulation tech-
10 Sat 2
pin 5, which is used for driving an IR nique, every bit consists of two parts,
11 Reserved
LED for transmission of the modulated which are never the same. So a bit is
12 Cd video
output in the form of IR signals. always a high-to-low or a low-to-high
13 Reserved
An actual-size, single-side PCB transition (or phase change), which
14 Cd photo
layout for remote control of the digital occurs exactly in the middle of the
15 Reserved
audio processor published in EFY Feb. bit-time.
16 Audio preamplifier 1
2005 is shown in Fig. 8 and its compo- In RC5 code, ‘1’ represents a low-
17 Receiver/tuner
nent layout in Fig. 9. to-high transition and ‘0’ represents a
high-to-low transition. For all the bits, 18 Tape/cassete recorder 
Philips’ RC5-format remote the most significant bit is transmitted 19 Audio preamplifier2
The RC5 code (known as ‘biphase’ first. The duration of each bit is 1.778 20 Cd
code) comprises 14 serial bits as fol- ms (with the change in phase occur- 21 Audio rack
lows: two start bits, one toggle bit ring at 0.889 ms), and the total time 22 Audio sat receiver
(which changes every time a new but- of a full RC5 code, i.e., frame period, 23 Dcc recorder
ton is pressed on the remote), five ad- is 24.892 ms (14x1.778 ms). The space 24 Reserved
dress bits as the system/device address (rest period) between the end of the 25 Reserved
and six command/instruction/data preceding frame and the start of 26 Writable Cd
bits for the pressed key. This frame of the next frame equals the duration 26-31 Reserved

1 0 2 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Table II
Commands and Functions
(6-bit)
Command Description of function
(in decimal)
0-9 Numeric keys 0-9
12 Standby
13 Mute
14 Presets
16 Volume up
17 Volume down
18 Brightness + 
19 Brightness –
20 Colour saturation +
21 Colour saturation –
22 Bass up 
23 Bass down
24 Treble + 
25 Treble –
26 Balance right
27 Balance left
48 Pause
50 Fast reverse Fig. 10: The time relationship and typical bit pattern conforming to standard Philips RC5 protocol
52 Fast forward –
53 Play
54 Stop Table III
55 Record  Pin Signals/Functions of IC SC3010
63 System select
Pin no. Symbol I/O Description Note
71 Dim local display
77 Linear function (+) 1 K17 IP Key-sense input pin
78 Linear function (–) 2 SMS I System-mode-selection input pin
80 Step up 3-6 C0-C3 IP Key-sense input pins
81 Step down 7 MDOUT O Generated output data pin modulated with
82 Menu on 1/12 oscillator frequency at a 25 per cent IP = Input with p-channel
83 Menu off duty factor pull-up transistor
84 Display A/V sys status 8 DOUT O Generated output data pin
85 Step left OD = Output with open
9-13 KO7-KO3 OD Scan driver pins
drain n-channel transistor
86 Step right 14 VSS Power Negative power supply
87 Acknowledge 15-17 KO2-KO0 OD Scan driver pins
88 Pip on/off 18 OSC I Oscillator input pin
89 Pip shift
19 T2 I Test pin 2
90 Pip main swap
20 T1 I Test pin 1
91 Strobe on/off
21-27 KI0-KI6 IP Key-sense input pins
92 Multi strobe
93 Main frozen 28 VDD Power Positve power supply
94 3/9 multi scan
95 Pip select of 50 bits or 88.9
96 Mosaic multi pip ms. Repetition
97 Picture Dnr period is equal
98 Main stored to frame period
99 Pip strobe plus space pe-
100 Recall main picture
riod, which thus
101 Pip freeze
equals 113.792
102 Pip step up
ms.
103 Pip step down
118 Sub mode
The time re-
119 Options bus mode lationship and
123 Connect typical bit pat-
124 Disconnect Fig. 11: Data output format terns are shown

1 0 4 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
for each of the 32 systems. There
is also a possibility of using
up to 128 commands. This is
achieved by assigning the second
start bit a value of ‘0’ (rather
than ‘1’). Thus when the second
bit is ‘0,’ ‘64’ is added to the
command value defined by six
command bits.
Typical command values (in
decimal) are shown in Table II.
Most of the available RC5 encoder
chips can be used for 64 commands
only as both start bits are prepro-
grammed to a value of ‘1.’
As soon as the encoder IC
senses depression of a key, key
debounce time (=16-bit dura-
tion =28.448 ms) starts. This is
followed by scan time (=2-bit
duration=3.556 ms) and then the
actual code consisting of 14 bits
Fig. 12: Circuit of RC-5 encoder for selecting 1 of 32 system and 64 commands starts. On completion of the first
code frame of 14 bits, there is a
gap of 88.889 ms and then the 14-bit
TABLE IV code repeats. The data output format
Remote Command Codes is shown in Fig. 11.
Button Command Function (as used) Most of the RC5 encoder chips
0-9 0-9 Number keys as mentioned above are available
‘—’ 10 10+ in 28-pin surface-mount packages.
‘Sfx’ 36 20+ Pin signals/functions are shown in
Mute 13 Delete task
Table III.
Fig. 13: Selection of TV1 or TV2 using shorting AC 34 Clear the prog. memory
link Circuit description
PWR 12 Change the password
Fig. 12 shows the circuit of RC-5 en-
Timer 38 Change the time
in Fig. 10. coder for selecting one of 32 system
Search 30 Change the existing tasks
For neatness, addresses (using shorting link, rather
CH+ 32 See the next task
only the en- than a tactile switch). For system selec-
CH- 33 See the previous task
velope is tion, scan-driver pins 17, 16, 15, 13, 12,
shown, while RCL 15 Toggle the LCD backlight
11, 10 and 9 for scan lines KO0 through
the carrier PP 14 Enter a new task
KO7, respectively) need to be con-
frequency of Store 41 Toggle the child lock
nected to key-sense inputs C0 through
36 kHz with Volume+ 16 Increase the value
C3 (terminating at pins 3 through 6),
50% duty Volume– 17 Decrease the value
respectively (only one at a time).
cycle is sepa- TV/AV 56 Confirmation
Fig. 13 shows a shorting-link ar-
rately shown Technology, SL3010 from System Logic rangement enabling selection of either
Fig. 14: Command switches in the right- Semiconductor, etc). TV1 (system address ‘0’) or TV2 (sys-
used for RTC-interfaced
multiple device control hand corner With five bits used for sys- tem address ‘1’). The system address
at the bott- tem/address selection, you (decimal), as shown in Table II, equals
tom. There are 24 pulses of 36 kHz may select/address 32 differ- the address represented by each dot in
during the ‘on’ period (0.889 ms) of ent systems. System addresses the circuit.
any bit. have been standardised for Similarly, for command selection,
In the market, you can easily identifying specific equip- scan-driver pins 17, 16, 15, 13, 12, 11, 10
find RC5-compatible chips from ment types (refer Table I). With and 9 for scan lines KO0 through KO7,
a number of manufacturers (SAA3010 next six bits used for key com- respectively, need to be momentarily
from Philips, SC3010 from Silan Semi- mands/data, it is possible to have a connected to key-sense input pins 21
conductors, PT2210 from Princeton set of 64 different commands through 27 and 1 representing sense

1 0 6 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction

Fig. 15: PCB layout of RC5 remote for RTC-interfaced microcontroller for multiple device control

Fig. 16: Component layout for the PCB shown in Fig. 15

lines KI0 through KI7, respectively, cycle. This output is used to drive IR 2. A key is released between two
one at a time (for one system). Com- LED1 via transistor T1. A single OSC codes.
mand numbers ‘0’ through ‘63’ (deci- input pin 18 is used for connecting 3. During matrix scanning:
mal) for any specific system (selected the 455kHz resonator via a 1-kilo-ohm 1. A key is released while one of
as described above) can be selected resistor, while the other end of the the driver outputs is in the low ohmic
by pressing respective push-switches resonator is grounded. state (logic 0).
marked ‘0’ through ‘63’ (i.e., command System-mode-select (input pin 2. A key is released before that key
number + 1). 2) is to be held low (connected to has been detected.
Once a system is selected and a ground) when the encoder is used 3. There is no wired connection in
command key is momentarily pressed, for combined system operation, the C-KO matrix when pin 2 is high.
14 bits of the code word modulates whereas for a single-system selection (Note. Although 36kHz carrier fre-
a 38kHz carrier generated within IC pin 2 is to be connected to Vcc. Fig. quency has been mentioned in the RC-
SC3010 and the modulated output 12 shows selection of the single- 5 format, but for that you have to use
is available at pin 7 (labeled as ‘MD- system mode. a 432kHz resonator. Since the 432kHz
OUT’). The output signal MDOUT The device will immediately reset resonator is not commonly available,
transmits the generated information under the following conditions: we have used a 455kHz resonator to
modulated by one-twelfth of the os- 1. A key is released during the de- get a carrier frequency of 38 kHz as in
cillator frequency with a 50% duty bounce time. the case of the NEC remote.)

1 0 8 • M a r c h 2 0 0 7 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Example. Let us design an IR re- thor as per Table IV of the project. You are shown in different colour in Fig.
mote for the ‘RTC-interfaced Multiple can easily correlate command numbers 12. (Note that the system address is
Device Control’ project published in (decimal) of Table IV to switch num- equal to the switch No.–1.)
Sept. 2006 issue of EFY, which requires bers shown by red dots in Figs. 12 and The PCB designed for the example
a Philips’ RC5-code compatible remote 14. That makes designing the circuit project shows the command code
controller for programming the RTC really easy. as well as the function in the screen
chip DS12887 used in that project. For system selection, simply short overlay.
Command switches used for RTC- pin 17 to pin 3 as the author has con- Caution. IC1 is a surface-mount
interfaced multiple-device control are figured the project to recognise TV1 device and it is to be mounted on the
separately shown in Fig. 14 (Note. system commands only. An additional track-side itself after proper alignment
Three additional command switches provision can be made for selection of of pins. For soldering the surface-
for functions Volume+ (code 16), TV2 system as well. mount IC, strictly follow the instruc-
Volume—(code 17) and TV/AV (code The system-selection arrangement tions in the box. This caution applies
56) have been added to enhance its is shown in Fig. 13, which makes use to the previous PCB of NEC remote
application for some other projects, of a shorting link to select either TV1 as well.
which may be published in EFY in or TV2 system. The identical system- The PCB for the example remote
due course). The actual command No. selection arrangement is also shown is shown in Fig. 15 and its component
(decimal) is the same as the switch/ by using switches marked ‘1’ (address layout in Fig. 16. Ready-made PCBs
key number. The first 22 command ‘0’ for TV1) and 2 (address ‘1’ for TV2), for both the projects are available with
numbers are the same as used by au- as per Table I. These two switch dots Kits‘n’Spares. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 7 • 1 0 9

You might also like