E00c072.PDF
(
84 KB
)
Pobierz
004055-UK univ.receiver
COM
PUTER
Multi-Purpose
For ‘Running Text Display’
Design by F. Wohlrabe
This universal IR receiver
works with the IR key-
board transmitter for the
Running Text Display
described in the February
2000 edition of Elektor
Electronics. Its versatility
allows it to perform simple
switching tasks or complex
control of test equipment
remotely from a standard
PC keyboard.
5V
K1
R2
+5V
3
5
6
IC3
KEYBOARD
2
DATA
16
DIN 5
RESET
rear view
4
IC1
7
1
CLK
17
L0
ZSM560
G0/INT
JP1
*
8
9
GND
18
G1
L1
L2
L3
19
G2
10
COP8782
11
9V
5
6
1
DATA
3
GND
4
+5V
5
CLK
L4
1
G4/SO
12
KEYBOARD
L5
2
3
4
G5/SK
D
1
13
PS-2
L6
3
G6/SI
14
rear view
L7
12
TSUS
5201
G3/T10
20
IC2
R3
R1
G7/CKO
CKI
5V
9V
7
805
4
R4
1M
5
15
T1
C3
C4
C1
C2
100n
220µ
16V
33p
X1
10MHz
33p
ZTX603
*
see text
990090 - 12
Figure 1. The IR keyboard transmitter from the February edition.
There are two basic methods used for send-
ing data over an infrared link. The simplest is
to switch the transmitting diode on and off to
represent 1‘s and 0‘s in the data stream. To
save energy, these bits are made as short as
possible. This however makes it more difficult
for the receiver to detect the signal, especially
if there are high levels of ambient light. The
accepted method of overcoming this problem
is to switch the transmitter diode with a carrier
frequency that is modulated by the data. The
receiver electronics are relatively simple and
can be easily integrated along with the IR
receiving diode to produce a compact device
with good sensitivity and immunity to ambi-
ent light levels.
There are many integrated receivers avail-
able and they generally operate with a carrier
frequency in the range of 30 kHz to
40 kHz. Much remotely controlled
household equipment employs the
RC5 encoding standard, this has a
carrier of 36 kHz. We will also use
this frequency in our design.
The circuit diagram for the IR key-
board transmitter is reproduced here
as
Figure 1
. It was fully described in
the February 2000 edition of
Elek-
tor Electronics
, but just to re-cap; a
36 kHz carrier frequency is gener-
ated by the microcontroller, this is
modulated by the code of the
pressed key. This signal then drives
the transmitting diode D1. Using a
standard receiver, it is possible to
achieve a line of sight range of about
10 m. Most walls and ceilings offer
good reflectivity to Infrared so a line
of sight link is not strictly necessary.
The communications protocol
used for this project does not comply
with any IR communication stan-
dard. It was chosen as a compromise
between low current consumption,
good data security and simplicity of
decoder design. Each keypress gen-
erates a message comprising 1 start
bit, 8 data bits, 1 parity bit and 1
stop bit. The parity bit ensures that
the number of 1’s in the data (includ-
ing the parity bit) is always an even
count. A typical message generated
by a keypress is shown in
Figure 2.
The infrared transmitting diode is
72
Elektor Electronics
12/2000
IR Receiver
COM
PUTER
driven by Darlington transistor T1.
This transistor produces pulses of
current to drive the transmitting
diode from the control signal. To
increase the range of the unit, it is
possible to reduce the value of the
current limiting resistor R1 and
replace D1 with a high intensity IR
LED. In principle, any IR LED can be
used for this transmitter. The short
pulses of current are not sufficient to
generate excessive power dissipa-
tion in the transistor.
start bit 6
ms H,
6 ms L
data bit "1"
2
ms H, 4
ms L
data bit "0"
2
ms H, 1
ms L
stop bit
2
ms H
990090 - 13
Figure 2. Modulation signal format.
output lines. These lines can be used
to control or switch external equip-
ment. Alternatively the receiver can
be configured to output the hex code
for each key press of the keyboard.
Applications for this design range
from simple control of remote lamps
or devices to a remote front panel for
some test equipment. Building keypads into
test equipment can often make the equip-
ment design too complicated. This remote
keyboard could also help to simplify testing
procedures.
The IR signal is received by a sensitive IR
detector (IC4). This device includes an IR
photodiode, filter, amplifier and demodulator.
The output signal is fed directly to an input of
the microcontroller (IC2).
A low-pass filter formed by R1 and C1
removes noise and ripple from the supply
voltage.
In order to make the receiver as versatile
as possible it can be configured to output the
key presses in two ways:
Receiver
The receiver is shown in
Figure 3
.It
decodes the IR signal and outputs
the corresponding data to its eight
Microcontroller
The OTP-Microcontroller from National Semiconductor is particularly suited for
this application and is used in the transmitter as well as in the receiver:
- 4096 x 8 OTP EPROM
- 128 Bytes RAM
- 1 µs cycle at 10 MHz
- 16 Bit Timer with the operational modes: Timer with Auto-Reload, External
Event Counter and with Capture Function
- 16 I/O, of these 14 can be individually programmed as input or output
- Selectable Pin configuration: TriState, push-pull or pull-up
- Microwire interface
- Interrupt source: External Interrupt with selectable edge, Timer Interrupt, Soft-
ware Interrupt
Mode 1
This configuration is used for direct control.
The eight output lines L0 to L7 are switched
when one of the 1 to 8 keys is pressed on the
keyboard. For example, one press of key 1 will
set output L0 high. Pressing key 1 again will
cause L0 to be reset low. LED’s D1 to D8 will
switch on when the corresponding output is
5V
R1
D9
R2
20
IC1
1N4148
10
35ms
6
trigger
20
G3/T10
RESET
16
IC1
R4
IC2
L0
7
2
4
6
8
1D1
18
16
14
12
470
Ω
D1
D2
D3
D4
D5
D6
D7
D8
8
9
8
IC3
1
19
L1
L2
L3
470
Ω
470
Ω
470
Ω
CS
SK
G2
7
2
2
1
3
10
C1
X
93C06
G5/SK
G4/SO
G6/SI
6
3
11
11
13
15
17
9
7
5
3
X
CB1
DIN
L4
1D2
470
Ω
470
Ω
470
Ω
470
Ω
5
4
12
100µ
DOUT
L5
13
L6
COP8782C
IC4
2
14
L7
3
17
G0/INT
G1
18
R11
G7/CKO
CKI
1
EN1
EN2
19
1
4
5
15
TFMS
R3
74LS244
5360
1M
JP1
C2
C3
C4
100n
33p
10MHz
33p
coding
004055 - 11
Figure 3. The IR receiver also makes use of the COP8-Microcontroller from National Semiconductor.
12/2000
Elektor Electronics
73
COM
PUTER
high. When the Enter key is pressed all eight
outputs will be reset low.
Project Software
The software (source code) for both COP8 controllers may be found on a
diskette with order code
004055-11.
Ready-programmed controllers are also available from Elektor Electronics:
996527-1 (transmitter)
004055-41 (receiver)
Mode 2
This configuration will cause the controller to
output the hexadecimal code for the pressed
key. The output code corresponds to the scan
code of the pressed key as explained in the
February 2000 edition of
Elektor Electronics.
For example:
Key Code
Esc 08H
Return 5AH
Space 29H
A
1CH
decoding in the receiver.
Pin G1 of the microcontroller is
used to switch between the two
operating modes of the receiver. If no
jumper is fitted the pin will be pulled
high by an internal pull-up resistor,
and the receiver will operate in
mode 1. A jumper fitted to G1 will
pull this pin low and this will signal
the receiver controller to operate in
mode 2.
Output G3 provides a trigger sig-
nal whenever a key is pressed on the
transmitter keypad. This can be
used by external equipment to cap-
ture and latch the new key value. It
has a pulse width of approximately
35 ms and is output in both modes of
operation.
R2, C2 and D9 generate a power-
up reset for the microcontroller.
Bus driver chip IC1 buffers the
output from the controller and can
supply a useful 15 mA from each out-
put pin. The controller itself can only
supply 3 mA per pin, but in applica-
tions where this is sufficient, IC1 can
be omitted. In this case the output
LEDs will not be fitted either.
The receiver also includes a small,
economical serial EEPROM that can
store up to 32 bytes of information.
Only one byte of this memory is
used. When the receiver is switched
off, it will store the state of its output
pins L0 to L7 in this EEPROM and
read them out at power-up to ensure
that the output pins remember their
last state. This device can also be
omitted if this feature is not impor-
tant in you application
S
1BH
This hexadecimal code will appear on the
output pins L0 to L7 and can be used for your
chosen application. Each time a new key is
pressed, it will simply overwrite the last code
at the output.
The article ‘PC Keyboard Encoding’ in the
February 2000 edition of
Elector Electronics
gives an insight into how versatile a PC key-
board can be and how it can be reconfigured
for different uses. In our application, the con-
troller in the IR transmitter configures the key-
board to use Scan Code Set 3. The keyboard
will therefore output only one keycode when
a key is pressed, for example, pressing key 1
will output the value 16hex. This simplifies
(004055-1)
74
Elektor Electronics
12/2000
Plik z chomika:
TirNaNog
Inne pliki z tego folderu:
bge.jpg
(22 KB)
detail10.htm
(5 KB)
detail1.htm
(5 KB)
detail12.htm
(15 KB)
detail11.htm
(7 KB)
Inne foldery tego chomika:
1974
1975
1976
1977
1978
Zgłoś jeśli
naruszono regulamin