This is only a preview of the March 1994 issue of Silicon Chip. You can view 34 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Build A 50W Audio Amplifier Module":
Articles in this series:
Items relevant to "Level Crossing Detector For Model Railways":
Items relevant to "Switching Regulators Made Simple":
Items relevant to "Voice Activated Switch For FM Microphones":
Articles in this series:
Items relevant to "Build A Simple LED Chaser":
Items relevant to "Computer Bits":
Articles in this series:
Articles in this series:
|
By BEN DOUCHKOV
❋ Circuit uses a microcontroller IC
❋ Features toggle & momentary outputs
❋ Works with any TV or VCR infrared remote control
Build an intelligent
IR remote controller
This simple project allows you to add
infrared remote control functions to
your favourite equipment. It works
with almost any TV, VCR or universal
remote control.
The idea for this project first occurred many years ago when the author owned an old colour TV that was
not remote controlled. One feature that
was really missed was a remote on/off
control but that problem can be easily
overcome using this infrared receiver.
It’s based on a 68HC705 microcon
troller and can be used to remotely
switch appliances such as old TV sets,
or to perform a range of remote control
functions in other equipment.
A few applications that come to
mind include amplifier power control,
speaker mute functions, model trains,
16 Silicon Chip
controlling small motors, robot control, and lighting control.
To make it as versatile as possible,
the receiver features toggled DPDT
relay outputs and two open collector
(ie, transistor switched) outputs (designated output 1 & output 2). These
outputs are controlled by the channel
1 and channel 2 buttons on the transmitter. The channel 1 button controls
the relay outputs, while the channel
2 button toggles output 1.
The other open collector output
(output 2) is either held low while
ever the channel 2 button is pressed
(repetitive code transmitter) or briefly
pulsed low each time this button is
pressed (one-shot code transmitter).
Output 1 could thus be used for power
switching via a relay or solenoid, while
output 2 could be applied to user-controlled functions; eg, slide projector
advance or focus motor control.
Note: some remote control transmitters only send the code once when
a button is pressed and held down,
while others will continuously send
the code while ever the button is held
down.
There were two important goals set
in developing this project: (1) it had
to be inexpensive; and (2) it had to
work with virtually any common TV,
VCR or universal IR remote control
transmitter. It also had to be flexible
so that it could be used in a number
of different applications and configurations. A circuit based on a single
chip microcontroller was the natural
choice and also offers the chance to
5
+5V
R1
150k
8 IN+
D1
TFK186
4
F0
R11
10k
1
VCC
C4
.01
R3
4.7k
GND
6
5
C2
4.7
C1
0.47
3
OUT 2
C1
+5V
R4-R8
3
C3
220pF
8
7
6
X2
4
2
F1
4
AC1
+DC
D3-D6
4x1N4004
IN
C9
1000
3
AC2
IRD
0V
PA1
PB5
PA2
IC2
68HC705J2
PB0
OUT
IC3
7805
GND
PA4
PB2
PA5
PB3
PA6
PA7
PB4
5x10k
OSC1
+5V
OSC2
R16
R15
1k
VIEWED FROM
BELOW
A
K
B
Q3
BC337
A
17
4
16
3
15
2
14
1
TP
2
C
4
3
E
AUX1
AUX2
AUX3
0V
13
12
11
GND
10
C6
22pF
+DC
+5V
4
5
1
B
C
R12
1k
18
RELAY 1
D2
1N914
R9
10M
C8
4.7
+DC
E
2
XTAL1
4MHz
C7
22pF
I GO
PA3
PB1
1
1
0V
VCC
PA0
5
+DC
RESET
+5V
19
C5
4.7
7 INCD
LED1
9
20
IC1
UPC1490
R2
10
R10
10k
C1
NC1
C2
D8
1N4004
D7
1N4004
X1
R14
1k
Q2
BC337
B
NC2
R13
1k
C
E
Q1
BC337
B
+DC OUT
C10
.01
2
OUTPUT 1
TOGGLE
3
OUTPUT 2
MOMENTARY
C
E
1
K
+5V OUT
0V
INFRARED REMOTE CONTROL
Fig.1: signals from the IR transmitter are picked up by photodiode D1 & fed to
IR preamplifier stage IC1. The signal from IC1 is then fed to IC2, a 68HC705J2
microcontroller with programmed ROM tables. Its outputs drive Q3 to toggle
relay 1, while Q1 & Q2 provide toggle & momentary open collector outputs.
tackle more complex applications at
a later date.
The ability to use an existing TV
or VCR remote control transmitter
means that you do not have to buy
another one. It also means that quite
a number of different codes have to
be recognised by the microcontroller.
This is achieved by using code tables
that reside within the microcontroller’s ROM.
The ROM codes that were selected
for each remote control are for channel
1 and channel 2.
With the current version of the software, 10 different transmitter groups
(five TV and five VCR) are recognised.
Each of these groups covers a number
of different manufacturers and models, which means that a wide range of
transmitters can be used.
Unfortunately, not all the popular
manufacturers and models can fit
within the limited amount of ROM
available and so, for this reason, a
general purpose learning mode is also
included. This mode allows one remote control code to be learned when
the project powers up or is reset. The
learnt code is stored in RAM and is
lost when power is removed.
Note that, due to the limited amount
of RAM within the microcontroller
used, only one code can be learned
and so the same button is used to control all three outputs simultaneously.
Thus, if the receiver is using a learned
code, pressing the transmitter button
will toggle the onboard relay, toggle
output 1 and either pulse output 2
or activate output 2 for as long as the
code is received.
Although not guaranteed to work
with all transmitters, this mode does
allow the use of a lot of remote control
transmitters that would otherwise be
March 1994 17
XTAL 1
R16
C1
NC1
NC2
+5V
R8 10k
R7 10k
R6 10k
R5 10k
R4 10k
RELAY 1
C2
22pF
10M
1
0V
10k
1k
10k
4.7k
IC2
68HC705J2
X1
4.7uF
1k
1k
.01
IC3 7805
X2
150k
4.7uF
F1
1k
AC1
1
D2
AC2
+DC OUT
0V
0V
AUX3
AUX2
AUX1
+5V OUT
22pF
1000uF
A
LED1
K
Q1
0V
OUTPUT 1
OUTPUT 2
Q2
+5V OUT
+DC OUT
.01
D8
D7
10
Q3
D3-D6
0.47uF
220pF
4.7uF
D1
IC1
UPC1490
K
A
Fig.2: install the parts on the PC board exactly as shown here & be sure to use
a socket for the 68HC705J2 microcontroller (IC2). Pin 1 of IC1 can be identified
by the adjacent dot in its plastic body. Note that although shown here & in Fig.1,
the auxiliary outputs are unused in this version of the project.
unsupported. It also allows the user
to customise the code to which the
unit responds.
Circuit description
The circuit can be broken down into
three blocks: a power supply stage, an
infrared preamplifier stage, and the
microcon
troller stage. Fig.1 shows
the details.
The power supply consists of fullwave rectifier D3-D6, filter capacitor
C9 and 5V regulator IC3. Because the
project may be incorporated into a
piece of equipment, an onboard fuse
(F1) is also included. This fuse is
nominally rated at 0.75A but can be
changed to suit the external circuit
being powered via the receiver.
The power supply screw terminals
(X2) provide easy termination for the
input power (AC1 and AC2). These
terminals can accept either 9-20VAC
or 12-30VDC (the polarity does not
matter). In addition, the output from
the bridge rectifier is fed to a +DC
terminal and this could be useful for
powering external circuits.
The infrared preamplifier (IC1 –
UPC1490) was selected for its ability
to operate from 5V and because no external inductor is necessary. However,
the key to any infrared receiver is the
quality of the infrared detector (D1)
and, after a number of experiments, it
was found that a BPW90 photodiode
gave good performance. Unfortunately, it appears that this photodiode is
no longer manufactured and so an
equivalent unit from Telefunken, the
TFK186, was used.
In operation, D1 picks up the infrared pulses from the transmitter and
applies the resulting current pulses
to pin 8 (IN+) of IC1. R2 and C1 set
the initial gain and low frequency
Specifications
Range ���������������������������8-15 metres (depending on transmitter used).
Power supply �����������������12-30V DC or 9-20VAC.
Outputs �������������������������DPDT relay contacts; two open collector outputs;
1 indicator LED.
Codes (preset mode) �����Channel 1 toggles the DPDT relay; channel 2
toggles open collector output 1 and either pulses
open collector output 2 low or holds this output
low for as long as the button is pressed.
Learned mode ���������������A single button toggles the DPDT relay, toggles
open collector output 1, and either pulses open
collector output 2 low or holds this output low for
as long as the button is pressed.
18 Silicon Chip
roll-off for the input amplifier inside
IC1, while R1 sets the bandpass filter.
These components were selected to
provide a wide bandpass.
C2 is the detector capacitor, while
C3 is the integrating capacitor. These
were selected to provide maximum
sen
sitivity but the receiver can be
detuned if necessary by changing C3.
The output from IC1 appears at pin 2.
This is an open collector output and
so requires a pull-up resistor (R3). C4
provides additional pulse filtering.
Microcontroller
IC1 drives the PB5 (pin 3) input of
IC2, an MC68HC705J2 microcontroller
from the 68HC05 family. This device
uses CMOS technology and has 2064
bytes of program space and 112 bytes
of static RAM. The “J2” also has 13
input/output pins and an inbuilt timer.
Resistors R4-R8 on lines PB0-PB4
are used to select the desired ROM
code and are connected to either
the 0V or 5V rails, depending on the
transmitter – see Table 1. This means
that the input port lines (PB0-PB4)
are either pulled to 0V or 5V. A DIP
switch could have been used here but
as the configuration will probably be
permanent, the cost of the switch was
saved by using only resistors.
It is worthwhile mentioning several
important control lines for the microcontroller. These are the oscillator,
reset and IRQ (interrupt request) lines.
C5 provides the power-on reset pulse
by holding pin 20 low for a brief period after power is applied. During
this period, the oscillator starts and
this operates at 4MHz as set by crystal
XTAL1 between pins 1 and 2.
When the receiver is switched on,
the software goes through its reset
routines. One of these routines is
designed to flash an on-board LED
(LED 1) four times each time power
is applied. If the receiver has been
configured for one of the ROM codes,
the microcontroller will then sit in the
main program loop, waiting for infrared pulse signals from the transmitter.
When a valid signal is received, LED
1 pulses on and off in sympathy with
the pulse code.
This feature is useful for testing the
range of the receiver.
If the Learning mode has been
selected, the microcon
troller will
sit in a program loop after power-up
looking for the infrared code to be
learned. Some codes are easier for the
Mount the relay separately from the PC board if you intend using it to switch
mains voltages. Alternatively, you can leave the relay on the board & use it to
control a slave relay.
TABLE 1: Mode Selection
Transmitters
Type
Learning mode (only one code)
Setting
R8
R7
R6
R5
R4
0
0V
0V
0V
0V
0V
mains appliances, mount the relay off
the board or use it to control an external slave 240VAC-rated relay.
Resistor R16 is used to limit the
current through the relay coil when the
output voltage from the bridge rectifier
(D3-D6) is higher than 12V DC. This
rectified voltage is measured across
C9. The nominal coil current is 45mA
so the value of R16 is calculated using
the formula R16 = (VDC - 12)/0.045.
Table 2 shows a range of suitable resistor values.
Outputs PA5 and PA6 drive transistors Q1 and Q2 and these respectively
provide the toggled and momentary
open-collector outputs (output 1 and
output 2). Each output is used by
connecting the load between the collector of the transistor and either the
+5V rail or the +DC rail, depending
on the application; eg, a relay could
be connected between Q1’s collector
and the +DC rail exactly as shown for
relay 1 and Q3 (don’t forget the current
limiting resistor for voltages greater
than 12V - see Table 2).
Diodes D7 and D8 are there to
protect Q1 and Q2 from any high
back- EMF voltages that may be generated by inductive loads. Note that
Q1 and Q2 have a maximum current
rating of 1A.
Akai, Goldstar, Magnavox, Marantz,
AWA/Mitsubishi, NEC, Samsung
TV
1
0V
0V
0V
0V
5V
Marantz, AWA/Mitsubishi
TV
2
0V
0V
0V
5V
0V
GE, Panasonic
TV
3
0V
0V
0V
5V
5V
Panasonic
TV
4
0V
0V
5V
0V
0V
Sony
TV
5
0V
0V
5V
0V
5V
Construction
Hitachi, Pioneer, RCA, Toshiba
VCR
6
0V
0V
5V
5V
0V
Sony Beta, Zenith Beta
VCR
7
0V
0V
5V
5V
5V
Canon, GE, Magnavox, Memorex,
Panasonic, Realistic
VCR
8
0V
5V
0V
0V
0V
Realistic, Sharp
VCR
9
0V
5V
0V
0V
5V
AWA/Mitsubishi
VCR
10
0V
5V
0V
5V
0V
The construction is straightforward
since all the parts are mounted on a
small PC board (code IRJ201, 105 x
58mm). Fig.2 shows the parts layout.
No particular order need be followed when installing the parts on the
PC board, although it’s best to leave
the larger parts until last. Take care
when installing the semiconductors
and electrolytic capacitors, since
these parts are all polarity conscious.
The crystal (XTAL1) can be installed
either way around; its leads should be
bent through 90° so that it will lie flat
against the PC board.
IC1 can be soldered directly to the
PC board, while IC2 should be mounted using a 20-pin IC socket. Pin 1 of IC1
can be identified by the small adjacent
dot in the plastic body of the device.
The cathode (K) of the photodiode
(D1) can be identified by the bevelled
edge along one corner (see the pinout
diagram on Fig.1)
The five 10kΩ resistors (R4-R8) on
pins 4-8 of IC2 must be installed so
that they select the required ROM code
for your transmitter. As mentioned
receiver to learn than others, so several
attempts may be necessary to teach the
receiver the desired code.
Outputs
The PA7 output from IC2 toggles
high or low on each successive press
of the channel 1 transmitter button
and this output drives NPN transistor
Q3. Q3 in turn switches relay 1 on
or off to open or close the two sets
of contacts.
Relay 1 is ideally suited to switching
low voltage circuits such as loudspeaker lines and 12V power supply rails.
The relay contacts are rated at 240VAC
5A but, due to the close proximity of
the contacts to the rest of the circuit,
it is not recommended that the relay
be used for directly switching mains
appliances.
If you do wish to switch 240VAC
TABLE 2
Voltage Across C9
R16
12V
Link
18V
120W 0.5W
24V
270W 1W
27V
330W 1W
30V
390W 1W
March 1994 19
PARTS LIST
1 IRJ201 PC board
1 20-pin IC socket (for IC2)
4 plastic PC board standoffs
2 4-way screw terminals
2 2AG fuseclips
1 2AG 0.75A fuse (F1)
1 FBR621D012 12V relay
1 4MHz crystal (XTAL1)
Semiconductors
1 uPC1490 IR amplifier IC (IC1)
1 68HC705J2 programmed
microcontroller (IC2)
1 78055 5V regulator (IC3)
3 BC337 NPN transistors
(Q1,Q2,Q3)
1 TFK186 infrared photodiode
(D1)
1 1N914 silicon diode (D2)
6 1N4004 silicon diodes (D3-D8)
1 5mm red LED (LED1)
Capacitors
1 1000µF 35VW electrolytic (C9)
3 4.7µF 16VW electrolytic
(C2,C5,C8)
1 0.47µF 16VW electrolytic (C1)
2 0.01µF monolithic (C4,C10)
1 220pF ceramic (C3)
2 22pF ceramic (C6,C7)
Resistors (0.25W, 5%)
1 10MΩ (R9)
1 150kΩ (R1)
7 10kΩ (R4 -R8, R10-R11)
1 4.7kΩ (R3)
4 1kΩ (R12-R15)
1 10Ω (R2)
1 R16 – 0.5W or 1W (see text &
Table 2)
Miscellaneous
Two LEDs plus two 1kΩ resistors
for testing open collector outputs;
plastic case; red plastic window.
Take care when installing the infrared photodiode (D1). It must be oriented so
that its bevelled top edge goes towards diode D7 (see Fig.1 for case outline). The
two large LEDs were installed temporarily to test the open collector outputs.
previously, each resistor can be con
nected to either the 0V rail or to the
+5V rail. Table 1 shows the codes for
a range of TV and VCR transmitters.
By way of example, let’s assume that
you have a Sony TV remote control.
In that case, you would use setting 5;
ie, R4 & R6 connect to the +5V rail,
while R5, R7 & R8 go to the 0V rail.
Similarly, if you have a Sharp VCR
remote control, then setting 9 is the
one to use (ie, R4 & R7 to +5V and R5,
R6 & R8 to 0V).
R16 must be selected so that when
relay 1 is on, only 12V DC is applied
across its coil. It should be left off the
PC board for the time being.
Testing
Once the board assembly is completed, go back over your work carefully
and check that all parts are correctly
Where to buy the kit
Parts for this project are available from Benetron Pty Ltd, PO Box 43, Quakers
Hill, NSW 2763. Phone (02) 963 3868. Prices are as follows:
(1). PC board plus all on-board components (includes programmed microcontroller but does not include case or power supply) .....................$55
(2). Preprogrammed infrared transmitter ...............................................$40
(3). Programmable infrared transmitter (controls up to eight receivers;
does not come pre-programmed) ..........................................................$55
Please add $5 p&p for receiver only or $10 p&p for receiver plus transmitter.
Payment can be made via cheque, money order or credit card.
Note: copyright of the PC board and the ROM code in the microcontroller
is retained by Benetron Pty Ltd.
20 Silicon Chip
oriented. This done, connect a power
supply to the AC1 and AC2 terminals.
Either a 9-20VAC supply or a 12-30V
DC supply can be used.
It doesn’t matter which way around
you connect a DC supply to these
terminals because of the presence of
bridge rectifier.
Switch on and check that LED 1
flashes four times as the unit powers
up. The LED will now probably continue flashing in a random fashion due
to stray infrared signals from various
sources (eg, fluorescent lights). This
is quite normal and does not interfere
with the operation of the unit.
The next step is to measure the DC
voltage across the 1000µF capacitor
(C9). Resistor R16 can now be selected
from Table 2 and installed on the PC
board (switch the power off first).
Re-apply power and check that the
relay toggles each time you press the
channel 1 button on the transmitter. If
it does, then the unit is probably fully
functional but you will need to wire
up some LED indicators to verify the
two open collector outputs (output 1
& output 2). This can be done by connecting a LED and a series 1kΩ resistor
between each output and the +5V rail
(LED anode to +5V).
This done, check that the LED
connected to output 1 toggles each
time the channel 2 button is pressed.
Depending on the remote control, the
LED on output 2 should either flash
briefly each time the channel 2 button
Setting Up A Universal Transmitter
If you purchase the Bondwell preprogrammed universal transmitter, it will
have to be correctly set up before it can be used with the receiver. This
involves programming an appropriate 2-digit code to match a particular
TV set or VCR into the unit, as set out in the manual. Once this has been
done, it’s then simply a matter of choosing the appropriate connection for
resistors R4-R8 from Table 1.
Alternatively, you can use a programmable transmitter (ie, one which learns
its codes from existing TV and VCR transmitters). A suitable unit is available
from the author that can control up to eight separate receivers.
is pressed or remain on for as long as
the button is held down.
Troubleshooting
Check the following points if the
unit appears to power up correctly but
fails to operate:
(1). If the channel 1 and channel
2 keys don’t work, then try the other
keys. The reason for doing this is that
different manufac
turers use similar
codes but with different key assignments on their transmitters.
(2). Some manufacturers use a
number of different codes so, if the
receiver doesn’t work with a particular transmitter, try another setting
from Table 1.
(3). If all else fails and you cannot
find a ROM code for a transmitter, try
the Learning mode. Remember, however, that the learnt code is stored in
RAM and is lost if the power is switch
ed off, as mentioned previously.
Note that, due to the limited amount
of RAM available, some of the longer
codes that are used will not be sampled completely and the receiver may
respond to other codes that match the
limited sample stored.
Keep other light sources to a minimum during the learn
ing process
and position the trans
mitter close
to the receiver so that it swamps out
any interference from such sources.
It’s surprising just how much 50Hz
and 100Hz pickup there can be from
mains-powered lighting!
If you do strike problems here, a
red window placed in front of the
photodiode (D1) can help filter out
some of the unwanted infrared signals.
Failing that, the best procedure is to
temporarily disconnect the indicator
LED and teach the unit the code in the
dark. It’s simply a matter of pointing
the transmitter at the photodiode and
pressing the channel 1 and channel 2
buttons in turn.
Performance
If you don’t wish to use an exiting TV
or VCR remote control, this Bondwell
universal remote control can be used
instead. It comes preprogrammed
with a range of transmitter codes.
The exact range is difficult to specify, as this will depend on the transmitter output. Generally, you can expect
a range of about eight metres and this
is what was achieved by the prototype
when combined with a Bondwell universal transmitter.
Installing the unit in a plastic case
with a red plastic window in front of
the photodiode reduced the range to
about seven metres. Some transmitters, however, will give a range of
up to about 15 metres, although it is
necessary to earth the 0V rail to reduce
interference from unwanted sources
to achieve this figure. In some cases,
this can be done by connecting the 0V
rail to the earth rail of the equipment
SC
being controlled.
March 1994 21
|