This is only a preview of the September 2015 issue of Silicon Chip. You can view 44 of the 112 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 "Senator: 10-Inch Bass Reflex Loudspeakers":
Items relevant to "USB Charger Regulator With Low-Battery Cut-Out":
Items relevant to "Build A 9-Channel Infrared Remote Control":
Items relevant to "Ultra-LD Mk.4 200W RMS Power Amplifier, Pt.2":
Purchase a printed copy of this issue for $10.00. |
9-Channel Infrared
Remote Control
Using a tiny, prebuilt 9-button remote, this infrared
remote control receiver is ideal for use with TVs,
hifi & audio-visual equipment, model train layouts
and for robot control. Not only that but the one tiny
handheld remote can be used to control up to three
separate receivers, each with seven channels. No
surface-mount parts are used in the design and it
can run from a 12V battery or DC plugpack.
By JOHN CLARKE
I
NFRARED REMOTE controllers
are great but most universal remote
controls tend to have lots of pushbuttons to cater for numerous functions
and are quite bulky. If you only need a
few functions, a much smaller remote
is a lot more convenient.
That is why this project uses a
tiny IR remote from Sparkfun in the
USA and available in Australia from
Littlebird Electronics. Normally sold
for use in Arduino projects, it’s used
here with a dedicated receiver which
controls up to nine output channels.
Alternatively, it can control three independent receivers, with up to seven
outputs each. That might sound a little
confusing but the upshot is that this
is a powerful control system with lots
of options.
The Sparkfun IR remote measures
only 80 x 40 x 7mm and is powered
by a 3V lithium CR2025 button cell.
It has nine snap-action pushbuttons:
on/off (shown with the Power logo),
A, B and C, and a 5-switch array with
“OK”, up, down, left and right. The
5-button array is ideal for volume and
channel selectors or forward, reverse,
left and right functions (eg, in a model
railway system).
The Sparkfun remote comes fully
assembled and uses a 16-pin surfacemount IC, type HB8101P. It sends a
unique code via an infrared LED for
each of the nine pushbuttons. The
infrared signal is in 38kHz bursts, in a
format known as “Pulse Distance Protocol”. The controller has nine corresponding outputs and one of these will
be switched if a valid code is received.
The nine outputs can be switched by
reed relays, open-collector transistors
or a combination of both. The transistor outputs can be used to directly
switch LEDs or to switch relays with
higher contact ratings than those of
the on-board reed relays.
By the way, you don’t need to build
the controller with all nine outputs if
you don’t need them; just build it with
as many as you need.
Momentary or toggle?
Each output can be set for momentary or toggle (sometimes called alter78 Silicon Chip
siliconchip.com.au
INTO RADIO?
How about
SiDRADIO?
Take a Cheap DTV
Dongle and end up
with a 100kHz2GHz SoftwareDefined Radio!
Published
October
2013
It’sDon’t
yours
with the 200W
pay $$$$ for a commercial
Ultra
LD
Amplifier
from
receiver: this uses a <$20 USB
DTV/DAB+ dongle as the basis for a very
high performance SSB, FM, CW, AM etc
radio that tunes from DC to daylight!
Features:
Tuned RF front end
Up-converter inbuilt
Powered from PC via USB cable
Single PCB construction
Lots of follow-up articles, too!
The receiver can control nine output
channels or can be built as an A, B or
C device with seven output channels.
Want to know more? Search for “sidradio”
at siliconchip.com.au/project/sidradio
PCBs & Micros available from PartShop
Features & Specifications
Features
•
•
•
•
•
•
Uses pre-built miniature 9-button hand-held remote
Nine output channels (single receiver unit)
Optional A, B or C device (receiver) addressing with seven channels per device
Reed relay outputs or open-collector outputs (suitable for a 12V DC coil relay)
LED indicators
Momentary or toggle operation on each output
Specifications
•
•
•
•
•
IR reception range: 15m
Power: 12VDC at 150mA minimum (increase the current rating for any added
relay coil current)
Output ratings: Reed relay contacts or open collector outputs, 24V <at> 500mA
IR coding: Pulse Distance Protocol
Reception frequency adjustment: ±12.5% in 16 steps (~1.5% steps)
nate) operation. Momentary operation
is where an output and its associated
indicating LED is switched on only
while the button for that function is
being pressed. It goes off immediately
when the button is released.
For toggle operation, an output is
set to switch on with one press of an
siliconchip.com.au
IR remote button and it will stay on
until the same button is pressed again;
a further press of the button switches
the output off again.
A pushbutton switch on the controller board is used to select momentary
or toggle operation for each individual
output and the unit remembers this
MaxiMite
miniMaximite
or
MicroMite
Which one do you want?
They’re the beginner’s computers that the
experts love, because they’re so versatile!
And they’ve started a cult following around the
world from Afghanistan to Zanzibar!
Very low cost, easy to program, easy to use –
the Maximite, miniMaximite and the Micromite
are the perfect D-I-Y computers for every level.
Read the articles – and you’ll be convinced . . .
You’ll find the articles at:
siliconchip.com.au/Project/Graham/Mite
Maximite: Mar, Apr, May 2011
miniMaximite: Nov 2011
Colour MaxiMite: Sept, Oct 2012
MicroMite: May, June 2014
plus loads of Circuit Notebook ideas!
PCBs & Micros available from PartShop
September 2015 79
Parts List
1 double-sided PCB, code
15108151, 132 x 87mm
1 front panel label, 148 x 45mm
1 9-button IR remote control,
(LittleBird Electronics, Sparkfun
COM-11759) – see either:
http://littlebirdelectronics.com.
au/products/infrared-remotecontrol or
http://littlebirdelectronics.com.
au/products/ir-control-kit-retail
1 CR2025 3V alkaline cell
1 UB1 plastic case, 158 x 95 x
53mm
1 SPST micro-tactile switch with
0.7mm (or similar length)
actuator (eg, Jaycar SP-0600)
(S1)
1 12V DC plugpack rated at
150mA or more (see text)
1 2.1mm or 2.5mm PCB-mount DC
socket to suit plugpack (CON10)
9 2-way screw terminals, 5.08mm
pitch (CON1-CON9)
1 cable gland to suit wiring
1 18-pin DIL IC socket
1 3-way DIL header (2.54mm
spacings)
1 jumper shunt for header
3 PC stakes (TP GND, TP1, TP2)
Semiconductors
1 PIC16F88-I/P microcontroller
programmed with
1510815A.HEX (IC1)
1 TOSOP4838 or equivalent 38kHz
IR receiver (IRRx1) (Jaycar
ZD1952, Altronics Z1611A)
1 78L05 5V 100mA regulator
(REG1)
9 high brightness 3mm red LEDs
(LED1-LED9)
1 high brightness 3mm green LED
(LED10)
1 1N4004 1A diode (D10)
Capacitors
2 100µF 16V PC electrolytic
1 10µF 16V PC electrolytic
1 100nF MKT polyester
Resistors (0.25W, 1%)
10 1kΩ 1 470Ω
1 100Ω
Reed relay outputs*
9 SPST DIP 5V reed relays
(Altronics S4100A, Jaycar
SY-4030) (Relay1-Relay9)
9 1N4148 diodes (D11-D19)
9 100Ω 0.25W, 1% resistors
Open collector outputs*
9 BC337 NPN transistors (Q1-Q9)
9 1N4004 diodes (D1-D9)
9 470Ω 0.25W, 1% resistors
LK1-LK9 = resistor lead off-cuts
* Adjust part numbers required
for a mix of reed relay and open
collector outputs
setting even if the power is switched
off. Note that all the outputs are always
initially off whenever power is applied
to the controller.
mode, all nine outputs in the receiver
unit are active and can be controlled
by the remote.
Three separate devices
Now have a look at Fig.1 which
shows the circuit details of the controller. It employs an infrared receiver/
decoder (IRRx1) and a PIC16F88-I/P
microcontroller (IC1) which directly
drives reed relays, NPN transistors or
a combination of both, depending on
how you configure the PCB.
IRRx1 is a 3-lead device that comprises an infrared detector, amplifier,
38kHz bandpass filter and automatic
gain control (AGC). Normally, IRRx1’s
output is high (5V) and it goes low
when it receives a 38kHz IR signal. The
supply for IRRx1 is derived via a 100Ω
resistor from the 5V rail and is decoupled by a 100µF electrolytic capacitor.
IRRx1’s output connects to the RB0
As already noted, the Sparkfun
remote can be used to select and
control up to three separate devices,
designated A, B and C. But if you want
three separate devices, you need three
separate receivers. So to select one of
the three devices, you press button
A, B or C on the remote and then the
remaining buttons on the remote can
be pressed to control the various functions on the selected receiver.
The receiver incorporates three
jumper positions that allow it to be
set as an A, B or C device.
Alternatively, if you don’t need to
control multiple receiver units, you
simply leave out the jumper. In this
80 Silicon Chip
Circuit details
input of IC1. IC1 in turn decodes the
38kHz signal to drive the outputs according to the infrared code sent by
the handheld remote. Each output
comprises an indicator LED driven
via a 1kΩ resistor and either a 100Ω
resistor which drives a reed relay or
a 470Ω resistor which drives the base
of an NPN transistor.
Note that wherever a reed relay is
used, a reverse-biased diode (D11D19) is used to clamp any transient
voltage from the relay’s coil when it
is switched off.
By contrast, if a transistor is used instead, a diode (D1-D9) is used to clamp
any transients from an external relay.
Whenever the transistor is turned on,
the external relay is enabled (turned
on). Note that the circuit shows one
output driven from RB1 (pin 7) and one
driven by RA1 (pin 18) but seven other
outputs are also available, depending
on whether you install the relevant
components on the PCB.
The acknowledge LED (LED10) is
driven via IC1’s RA6 output and
flashes whenever an infrared signal
is received. It’s turned on when signal
from IRRx1 is detected by IC1 as a low
and is off when IRRx1’s output is high.
In addition, LED10 does doubleduty as a power indicator. When power
is applied, it briefly flashes every second (ie, at a 1Hz rate) but flashes rapidly
if an IR signal is received by IRRx1.
The RB4, RB5, RB6 & RB7 inputs are
normally high (+5V) unless pulled to
0V via momentary pushbutton switch
S1 (for RB4) or the link options for the
A, B or C inputs at RB7, RB6 & RB5.
Only one jumper shunt should be
used if the controller is to be used in
its device mode (ie, with A, B or C). If
more than one jumper is connected,
say A and B, only A will be recognised.
Note that if the Device A jumper
is installed, then outputs B & C are
disabled while the others all function
normally. However, pressing either
button B or C on the remote will always
turn the A output off (if it’s on), while
the other outputs will be left in their
current state. These outputs will then
not respond to further button presses
on the remote unless the Device A
button on the remote is pressed again.
The Device B and Device C jumper
options work in similar fashion, ie, a
Device B jumper selection disables
the receiver’s A & C outputs, while a
Device C jumper selection disables the
A & B outputs.
siliconchip.com.au
12V DC INPUT
+
D10
1N4004
A
+12V
REG1 78L05
K
–
GND
100 µF
CON10
OUT
IN
10 µF
16V
10V
OUTPUT
LEGEND ON
REMOTE BUTTON
CON1
A
CON2
B
CON3
C
R1-R9 = 100 Ω FOR RELAY
OUTPUTS; 470 Ω FOR OPEN
COLLECTOR OUTPUTS
CON4
100Ω
100 µF
IRRx1
λ
1
6
2
14
Vdd
MCLR/
RA5
RB1
ACK
RB2
TP GND
λ LED10
RB3
DEVICE A
13
RB7
OSC1/RA7
RA0
DEVICE B
12
9
B
TO
TO
TO
TO
TO
1
16
3
17
2
SC
20 1 5
A
LED2,
LED3,
LED4,
LED5,
LED6,
D12,
D13,
D14,
D15,
D16,
K
7,8
CON2
CON3
CON4
CON5
CON6
K
LED9
λ
D1 – D10: 1N4004
6
K
2
CON9
D9
+
A
C
B
1,14
CON9
–
Q9
BC337
E
EXTERNAL RELAY
CONFIGURATION
(R9 = 470 Ω)
D19
A
LK9
+12V
RELAY9
A
A
2
RELAY2/Q2+D2+LK2,
RELAY3/Q3+D3+LK3,
RELAY4/Q4+D4+LK4,
RELAY5/Q5+D5+LK5,
RELAY6/Q6+D6+LK6,
1k
18
5
D01 – D09: 1N4148
EXTERNAL RELAY
CONFIGURATION
(R1 = 470 Ω)
TO R8, LED8, D18, RELAY8/Q8+D8+LK8, CON8
K
1
E
TO R7, LED7, D17, RELAY7/Q7+D7+LK7, CON7
Vss
IRRx1
R2,
R3,
R4,
R5,
R6,
R9
RA1
CON1
C
RB6
RB5
B
1,14
–
Q1
BC337
ON-BOARD REED RELAY
CONFIGURATION (R1 = 100 Ω)
DEVICE C
11
A
RA3
RB4
RA2
S1
(MOM.
OR
TOGGLE)
8
6
D11
λ
3
IC1
PIC1 6F88
6F8 8-- RA4
I/P
2
K
10
K
A
K
RA6/OSC2
C
RELAY1
1k
7
LED1
15
A
R1
A
CON1
+
D1
CON8
TP2
470Ω
A
RB0
K
CON7
CON9
4
TP1
LK1
+12V
CON6
100nF
1k
3
CON5
+5V
7,8
ON-BOARD REED RELAY
CONFIGURATION (R9 = 100 Ω)
K
9–CHANNEL IR REMOTE CONTROL RECEIVER
BC 33 7
LEDS
K
A
78L05
GND
B
E
C
IN
OUT
Fig.1: the circuit is based on infrared receiver/decoder (IRRx1) and a PIC16F88-I/P microcontroller (IC1). IC1 decodes
the signal from IRRx1 and its outputs drive either reed relays (Relays1-9) or open-collector transistors (Q1-Q9). LEDs19 provide channel on/off indication, while the jumpers at IC1’s RB5-RB7 inputs provide optional device selection.
If no device jumper is fitted, then no
channels are disabled and the remote
controls all of the receiver’s outputs.
Frequency adjustment
While the handheld remote and the
controller are designed to operate with
Pulse Distance Protocol, the actual
times for each 38kHz burst and the off
times can vary from specification. This
is due to tolerances in the clocking rate
for the code transmission and in measuring the transmission time periods.
That’s because both the transmitter
and controller ICs run using internal
oscillators that are not precise. We
have dealt with that by arranging for
the microcontroller’s software to cater
for up to a 10% variation in frequency
siliconchip.com.au
for the transmission rate and the detected time period. However, in some
cases this may not be sufficient to
reliably detect and decode transmissions.
If that is the case, the software controller allows IC1’s internal oscillator to
be shifted in frequency. The available
range of correction is ±12.5%, with
adjustment steps in either direction
of about 1.5%.
All of the relays and/or transistor
outputs are powered from the +12V
rail which is fed via reverse-polarity
protection diode D10. The 5V supply
for IRRx1 and IC1 comes from REG1,
a 78L05 regulator. Its input and output
are bypassed with 100µF and 10µF
capacitors, respectively. In addition,
IC1’s supply is bypassed with a 100nF
capacitor close to the supply pins.
Construction
Building the Remote Control Receiver is easy, with all parts installed on a
PCB coded 15108151 (132 x 87mm).
This is housed in a UB1 plastic case
measuring 158 x 95 x 53mm, while a
148 x 45mm panel label is affixed to
the side.
Figs.2 & 3 show the parts layouts
for two different versions. Follow
Fig.2 to build the unit with reed relay
outputs or Fig.3 if you want open collector transistor outputs (eg, to switch
external relays).
Alternatively, you can have a mix of
relay and open-collector outputs. It’s
September 2015 81
DEVICE
LED10 ACK.
IC1
1k
100Ω
100 µF
A
K
S1 Select
GND
Mom. or Toggle
10 µF
100nF
PIC16F88
CON10
12V
78L05
Select A B C
A,B,C
or Nil
470Ω
REG1
TP2
4004
TP1
(A)
RELAY2
(B)
RELAY3
(C)
RELAY4
D1 2
4148
LED2 ( B )
A
K
100Ω
1k
D1 3
4148
LED3 ( C )
A
K
100Ω
1k
D1 4
4148
>
LED4 ( )
A
K
100Ω
1k
CON5
CON6
( )
RELAY7
( >)
RELAY8
( )
RELAY9
RELAY5
RELAY6
D1 6
4148
LED6 ( )
A
K
LED7 ( > )
1k
100Ω
15180151
D1 7
4148
1k
100Ω
A
K
D1 8
4148
>
LED8 ( )
A
K
)
1k
C 2015
15108151
A
K
1k
100Ω
D1 9
4148
100Ω
>
(< )
CON7
100Ω
1k
CON8
A
K
( )
CON9
D1 5
4148
LED5 ( < )
LED9 (
RELAY1
CON1
100Ω
1k
CON2
A
K
CON3
D1 1
4148
LED1 ( A )
D10
100 µF
CON4
>
IRRx1
IR REMOTE CONTROLLER
ALL CHANNELS CONFIGURED WITH ON-BOARD RELAYS
Fig.2: follow this PCB layout to build the unit with reed relay outputs. A
jumper is shown here in the Device A position but this should be omitted
if you only want a single 9-channel receiver.
just a matter of referring to either Fig.2
or Fig.3 and installing the appropriate
output components for that channel.
As shown in the photos, our prototype was built with open-collector
transistors for outputs A, B & C and
reed relays for the remaining six out-
puts. Note that the output channel
symbols match the buttons on the
remote control.
Note also that if you plan to set the
controller for device operation, you
don’t need to fit the output components for the disabled channels. For
Front Panel Labels
The front-panel label is optional. It can
be made by downloading the relevant
PDF file from the SILICON CHIP website
and then printing it out as a mirror image
onto clear overhead projector film (use
film that’s suitable for your printer). By
printing a mirror image, the toner or ink
will be on the back of the film when it’s
fitted. The label can be secured in place
using white or grey silicone adhesive.
Alternatively, you can print onto a
82 Silicon Chip
synthetic Dataflex sticky label if using
an inkjet printer or onto a Datapol sticky
label if using a laser printer.
(1) For Dataflex labels, go to:
www.blanklabels.com.au/index.
php?main_page=product_info&
cPath=49_60&products_id=335
(2) For Datapol labels go to: www.
blanklabels.com.au/index.php?
main_page=product_info&cPath
=49_55&products_id=326
Our prototype PCB was built with
open collector transistors for outputs
A, B & C and reed relays for the
remaining six outputs.
example, if the controller is to be an
A device, then the B and C output
components (including LEDs 2 & 3)
do not need to be installed.
Similarly, you can leave out the output components for any other channel
that isn’t required but note that LED1
is required for Device A operation
since this is the Device A indicator.
Alternatively, you will need to install
LED2 for Device B operation or LED3
for Device C operation.
If sorting that out all sounds too
hard, then you can just install all the
parts for each output channel.
Begin the assembly by fitting the
resistors. Table 1 shows the resistor
colour codes but you should also
check their values using a DMM before
soldering them to the PCB.
Be sure to fit the correct values for
resistors R1-R9. 100Ω resistors must
be installed for the reed relay channels, while 470Ω resistors are used
with the open collector transistors.
The diodes go in next. Note that
D11-D19 on Fig.2 are 1N4148 types,
while D1-D9 on Fig.3 are 1N4004s
and occupy different positions. D10
is a 1N4004 on both versions. Take
care to ensure that the diodes are all
orientated correctly.
Next, fit the PC stakes for TP1, TP2
and TP GND, then install an 18-pin
DIL socket for IC1 (notched end to
the left). The capacitors can then be
soldered in place, taking care to ensure
that the three electrolytics are oriensiliconchip.com.au
DEVICE
S1
GND
Select
Mom. or Toggle
10 µF
CON10
12V
78L05
100nF
PIC16F88
IC1
1k
100 µF
100Ω
LED10 ACK.
A
K
Select A B C
A,B,C
or Nil
470Ω
REG1
TP2
4004
D7
4004
Q7
BC337
470Ω
1k
D8
>
LED8 ( )
4004
A
K
D9
4004
Q9
BC337
470Ω
1k
–
LK9
)
C 2015
15108151
+
Q8
BC337
470Ω
1k
–
+
( )
(< )
( )
( >)
( )
>
A
K
+
LK8
A
K
+
–
LK7
15180151
LED7 ( > )
Q6
BC337
470Ω
1k
CON1
4004
A
K
–
LK6
D6
LED6 ( )
+
CON2
Q5
BC337
470Ω
1k
CON3
4004
A
K
–
LK5
D5
LED5 ( < )
+
>
Q4
BC337
470Ω
1k
(C)
CON4
>
4004
A
K
+
–
LK4
D4
LED4 ( )
Fig.4 shows how the LEDs are installed. As shown, their leads must be
bent down by 90° exactly 6mm from
their bodies and that’s best done using a 6mm-wide cardboard template.
Make sure that each LED’s cathode (K)
lead (the shorter of the two) is facing
Q3
BC337
470Ω
1k
(B)
CON5
4004
A
K
+
–
LK3
D3
LED3 ( C )
LEDs & infrared detector
Q2
BC337
470Ω
1k
(A)
CON6
4004
A
K
+
–
LK2
D2
LED2 ( B )
LED9 (
Q1
BC337
470Ω
1k
CON7
4004
A
K
tated correctly. The 100nF polyester
(MKT) capacitor can be fitted either
way around.
Follow with the DC socket and
switch S1, then install transistors Q1Q9 (as required) and regulator REG1.
Links LK1-LK9 can now be installed
in those channels where a transistor is
fitted. These links are only very short
(less than 5mm) and can be fashioned
using resistor lead off-cuts.
The 3-way DIL header for device
selection is installed near IC1. Its short
pin lengths go into the PCB, while the
longer pin lengths on top accommodate the jumper shunt (if fitted).
Screw-terminal blocks CON1-CON9
can now all be installed. Make sure
that they sit flush against the PCB and
that their wire entry holes are to the
right before soldering their pins.
LK1
D1
LED1 ( A )
D10
100 µF
CON8
TP1
CON9
IRRx1
–
IR REMOTE CONTROLLER
ALL CHANNELS CONFIGURED WITH OPEN COLLECTOR OUTPUTS
Fig.3: here’s how to build the unit with open-collector transistor outputs. You
can have a mixture of outputs on the same board if you wish – just configure
each channel according to the relevant PCB layout diagram.
6mm
IRRx1
HOW TO BEND
THE LED LEADS
15mm
15mm
6mm
PCB
5mm
Fig.4: each LED has its leads bent
down through 90° exactly 6mm
from its body before installation
on the PCB. That’s best done using
a 6mm-wide cardboard template.
Note that the LEDs are soldered to
the PCB only after the latter has
been installed in the case (see text).
5mm
PCB
Fig.5: the diagram shows how to
bend the leads of infrared receiver
IRRx1. Bend the leads around
5mm and 6mm-wide cardboard
templates and make sure that the
centre of the lens is 15mm above
surface of the PCB when soldering
the device in place.
Table 1: Resistor Colour Codes
o
o
o
o
siliconchip.com.au
No.
10
1
1
Value
1kΩ
470Ω
100Ω
4-Band Code (1%)
brown black red brown
yellow violet brown brown
brown black brown brown
5-Band Code (1%)
brown black black brown brown
yellow violet black black brown
brown black black black brown
September 2015 83
A
B
C
Ack
+
+
+
+
+
>
Power
12V DC
+
+
On-board relay
contacts: 24V,
500mA max.
+
>
+
>
+
.
IR Remote Control Receiver
>
+
+
SILICON
CHIP
Outputs
On-board relays: 24V max. <at> 500mA
+
.
12V DC
Fig.6(a): use this front-panel artwork if you are building a single unit to control nine output channels. It can
either be copied or downloaded in PDF format from the SILICON CHIP website and printed onto clear film or a
sticky label (see text). The rear panel artwork is shown to the right.
A
B
C
Ack
+
+
+
+
>
+
Outputs
Device
On-board relays: 24V max. <at> 500mA
+
.
12V DC
+
Power
12V DC
+
On-board relay
contacts: 24V,
500mA max.
+
>
+
>
+
.
IR Remote Control Receiver
>
+
+
SILICON
CHIP
Fig.6(b): use these artworks if you are building more that one receiver and will be using device selection.
Note that either of the above two front-panel artworks can be used as a drilling template for the case.
Rear-panel drilling template
65mm
A = 12mm diameter
B = 11mm diameter
A
+
25mm
27mm
B
+
22mm
Fig.7: this is the rear-panel drilling template. The two holes are best made by first drilling small pilot holes
and then carefully enlarging them to size using a tapered reamer.
towards you before bending its leads
down, so that the LEDs go in with the
correct polarity.
Don’t solder the LEDs to the PCB
at this stage though – that step comes
later, after the PCB has been installed
in the case.
Having prepared the LEDs, you
can now bend the infrared detector’s
leads as shown in Fig.5. Again, that’s
best done using cardboard templates,
one 6mm wide and the other 5mm
wide. Use the 6mm template to first
bend the leads back by 90°, then use
84 Silicon Chip
the 5mm template to bend them back
down again.
Having bent IRRx1’s leads to shape,
solder it in place with the centre of
its lens exactly 15mm above the PCB.
Fig.5 shows the details.
Drilling the case
The assembled PCB (minus the
LEDs) can now be put aside while you
drill the UB1 plastic case. Figs.6(a) &
(b) show the alternative front panels
for the receiver and you can make a
photocopy and use either one as a
drilling template. Alternatively, you
can download the labels as a single
PDF file from the SILICON CHIP website
and print them out.
You need to drill 3mm-diameter
holes for the 10 LEDs and a 6mm hole
for infrared receiver IRRx1. Deburr
all holes using an oversize drill, then
drill two holes in the rear panel using
the template shown in Fig.7 – one to
provide access to the DC socket and
the other to mount a cable gland.
The DC socket hole has a diameter
of 11mm, while the cable gland hole is
siliconchip.com.au
Fig.8: the top trace of this scope grab shows the output
from IR detector IRRx1, while the lower trace is the
Acknowledge LED voltage and shows the processed and
decoded signal from the microcontroller. The initial 9ms
pulse and 4.5ms gap indicate the start of the sequence
(note: the coding shown is for the remote’s power button).
Fig.9: this scope grab shows the button repeat signal
pulses. The top trace is IRRx1’s output, the lower trace is
the Acknowledge LED’s decoded output.
Fig.9: the bottom trace here shows the bursts of 38kHz
signal as sent by the remote’s IR LED, while the top trace
is the demodulated output from IRRx1. Note that IRRx1’s
output is low when the 38kHz IR signal is present.
The rear panel carries the
cable gland and also has
an access hole for the DC
power socket.
12mm in diameter. They are best made using a small
pilot drill to begin with and then carefully enlarged to
size using a tapered reamer.
Now take a look inside the case. You will find that one
of the LED holes goes through one the internal plastic
ribs, while another hole will be immediately adjacent
to one of these ribs. You will need to cut away the ribs
from around these holes using sharp side cutters, so
that the LEDs will later fit correctly.
Final assembly
Once all the holes have been drilled, the PCB can
be slid into the case and clipped into the slots in the
integral side ribs. Check that the PCB is the right way
siliconchip.com.au
Fig.10: this shows an expanded view of the IR signal’s
38kHz carrier frequency. The carrier is sent as a series
of on and off pulses; ie, it’s switched on and off with a
particular pattern to identify a particular button.
September 2015 85
This view shows the completed remote control
receiver. It’s powered using a 12V DC plugpack
rated at 150mA or more.
Compensating For Frequency Tolerances
Normally, you will not need to compensate for transmission rate tolerances.
However, if the receiver fails to operate reliably, you will need to adjust IC1’s clock
rate. The procedure is as follows:
(1) Switch off the power to the receiver, then reapply power while holding S1
down.
(2) Continue holding S1 down; LED5 (the centre LED in the row on nine) will light to
indicate the current oscillator setting (this is the default “zero change” setting).
(3) Release S1; LED 5 will turn off and the Acknowledge LED (LED10) will turn on to
indicate that the receiver is now in the oscillator adjustment mode (it can still flash if
it receives a signal from the remote).
(4) Press switch S1 again. LEDs 5 & 6 will now both light to indicate that IC1’s
oscillator frequency has been slowed.
(5) Release S1 and test the receiver using the remote to see if it now operates
reliably. In not, press S1 again; LED6 will now be lit on its own, indicating a further
slowing of the oscillator frequency. Check the unit once again to see if it now
operates reliably.
(6) Pressing S1 again will now light LEDs6 & 7, then LED7 on its own, then LEDs7
& 8 and so on up to LED9, with each step progressively slowing IC1’s oscillator.
Check for reliable operation after each step.
(7) Pressing S1 after LED9 has been lit moves the display back to the left (ie,
towards LED1). When LED5 is reached, pressing S1 again will light LEDs5 & 4. This
indicates that the frequency has been increased by one step from the default value.
Further presses of S1 then light LED4, then LEDs4 & 3, then LED3 on its own, then
LEDs3 & 2 and so on, with each step increasing the frequency.
(8) Once you’ve found a setting that gives reliable operation, switch off and then
reapply power to get out of the frequency adjustment mode. The Acknowledge
LED should now resume normal operation (ie, it will flash briefly at a 1Hz rate
to indicate that power is applied, or flash rapidly if a signal is received from the
remote).
around – the pads for the LEDs must
be adjacent to LED holes in the side
of the case.
The 10 LEDs can now be fitted in
86 Silicon Chip
place and their leads soldered to their
pads on the top of the PCB. Check that
each LED is correctly orientated and
that it protrudes through its front-
panel hole before soldering its leads.
LEDs1-9 are all red LEDs while LED10
(Power/Acknowledge) is green.
Now check that the infrared detector’s lens is correctly aligned with its
front-panel hole. If not, bend its leads
until it’s centred.
Testing
Now for the smoke test. Apply
power using a 12V DC plugpack and
check that the voltage between pins 14
& 5 of IC1’s socket is close to 5V (4.855.15V). If no voltage is present, check
diode D10’s polarity and check the
polarity of the plugpack supply (the
centre of the plug should be positive).
Make sure also that REG1 is correctly
orientated and that all leads have been
correctly soldered to their PCB pads.
If the supply checks out, switch
off and install IC1, making sure that
its notched end faces towards LED10
and that all its pins go into the socket
correctly. That done, reapply power
and check that the hand-held remote
can activate each output.
By the way, you will need to insert
a CR2025 cell into the remote before
using it. The cell’s tray is accessed
from the bottom edge of the case. It’s
opened by first pulling its locking tab
sideways (towards the centre) and then
sliding the tray out (it may require
some force to move it). The cell is then
installed with its negative side towards
the pushbutton (top) side of the case.
By default, the outputs are all configsiliconchip.com.au
Driving Devices Using The Open Collector Outputs
RELAY 1
CON X
390Ω
RELAY 2
+
+
–
–
NO
NC
NC
CON Y
A
CON 1-9
+
λ LED
–
NO
K
Fig.11(b): driving a LED output.
MOTOR
390Ω
+ VOLTAGE TO
SUIT MOTOR
Fig.11(a): using two open collector outputs to drive a motor in both directions:
(1) Both outputs set for momentary operation
Pressing (and holding) the button for open-collector output “X” activates Relay
1 and causes to the motor to rotate one way, while pressing the button for
output “Y” activates Relay 2 and causes the motor to rotate the other way.
1
CON 1-9
+
4N28
OPTOCOUPLER
5
λ
–
4
2
Fig.11(c): driving an optocoupler.
(2) Both outputs set for toggle operation
The motor will be stopped until one of the outputs is toggled (its direction will
depend on which output is turned on). The motor can then be reversed by
toggling both outputs or stopped by toggling either output.
(3) One output set for toggle and the other momentary operation
The motor will run continuously in one direction if the toggle output is on or in
the other direction for as long as the momentary output is on while the toggle
output remains off (ie, it runs while the button on the remote is pressed).
ured for momentary operation. If you
want toggle operation for an output,
press and hold S1 on the receiver’s
PCB, then press the required button on
the remote and release S1. Switching
back from toggle to momentary operation is done the same way
If you find that the unit doesn’t
operate reliably, or only works with
certain orientations of the remote, it
may be due to frequency tolerances.
In that case, it’s just a matter of altering IC1’s frequency to improve the IR
code detection. The accompanying
panel (Compensating For Frequency
Tolerances) describes how that’s done.
If the unit fails to work at all, check
your soldering and check that all
parts have been correctly placed and
orientated.
Front panel
Assuming that it’s all working correctly, all that remains now is to fit the
front panel. As shown in Figs.6(a) &
6(b), there are two to choose from. Use
12V RELAY
CON 1-9
+
–
NO C NC
Fig.11(d): driving a 12V relay.
Fig.6(a) if you are simply using the unit
to control nine output channels and
don’t need device selection (ie, you
don’t need to select another receiver).
Alternatively, if you are using device
selection (eg, you have two or more
receivers), use the front panel shown
in Fig.6(b). Don’t forget that you will
need to install a jumper on the 3-way
pin header (near IC1) on the PCB to
select either device A, B or C.
An accompanying panel describes
how to make a front panel using either
Are Your S ILICON C HIP Issues
Getting Dog-Eared?
$
REAL
VALUE
AT
Are your SILICON CHIP copies getting damaged or dogeared just lying around in a cupboard or on a shelf?
Can you quickly find a particular issue that you need
to refer to?
16.95*
PLUS P
&P
Keep them safe, secure and always
available with these handy binders
Order now from www.siliconchip.com.au/Shop/4 or call (02)
9939 3295 and quote your credit card number. *See website
for overseas prices.
siliconchip.com.au
September 2015 87
Pulse Distance Protocol (PDP)
Most infrared (IR) controllers use
a modulation frequency somewhere
between 36kHz and 40kHz – typically
38kHz. This is the frequency at which
an infrared LED is switched on and off
when a signal code is sent to the receiver.
A series of 38kHz signal pulses is
called a “burst” and is inter-spaced with
a pause during which no IR signal is
sent. This series of bursts and pauses
usually conforms to a particular format
or protocol and there are several in common use. These include the Manchesterencoded RC5 and RC6 protocols as
used by Philips, while Sony uses the
Pulse Width Protocol.
By contrast, the remote used in this
project uses NEC’s Pulse Distance
Protocol. Further details on all these
protocols can be found in application note
AN3053 by Freescale Semiconductor
(formerly Motorola) – see: http://cache.
freescale.com/files/microcontrollers/
doc/app_note/AN3053.pdf
Fig.12 shows the basics of the Pulse
Distance Protocol. Logic 1 and logic
0 both comprise an initial 560μs-long
38kHz burst. Each logic 1 is followed by
a 1690μs pause but a logic 0 is followed
by a shorter 560μs pause (ie, the same
length as the logic 0’s 38kHz burst).
The entire data stream uses a 9ms
burst and a 4.5ms pause starting train.
The following data consists first of the
address bits and then the command
bits. The address identifies the handheld remote, while the command bits
correspond to the buttons on the remote.
Note that the address and command
data is sent with the least significant bit
transmitted first. The data comprises
an 8-bit address, after which a complementary 8-bit address is sent. This is essentially the opposite bit of the address
that’s sent. So for every “0” bit that’s sent
in the address, a “1” will be sent in the
complementary address.
Similarly, for every 1 that’s sent in the
address, a 0 will be sent in the comple-
clear film or a Dataflex or Datapol
sticky label. Once you have the label,
remove the PCB from the case, then
affix the label in position and cut out
the holes using a sharp hobby knife.
Output connections
The reed relays are ideal for switching low voltages (up to 24V maximum)
88 Silicon Chip
Logic Bit Encoding
Data Frame Sequence
Repeat Frame
Overall Sequence
Fig.12: the basics of the Pulse Distance Protocol (PDP). The data stream
consists first of the address bits and then the command bits (see text).
mentary address. The command bits
are also resent in complementary form.
As an aside, if you look up the address
and command values that the remote
produces (see https://learn.sparkfun.
com/tutorials/ir-control-kit-hookupguide), you will see that the address is
10EF hex. In addition, the operate button
code is D827 hex.
10 hex is the address value and EF
hex is the address complement value.
These values are in hexadecimal format
(ie, values from 10-15 are designated
A-F).
The complementary address and
command bytes are sent so that they
can be compared to detect errors. If the
complementary data value received
and currents up to 500mA. They can be
used to duplicate pushbutton switches
on equipment by wiring the reed relay
output in parallel with the switch.
If switching inductive loads, then a
reverse-biased diode should be connected across the relay’s contacts.
Do not under any circumstances
use the on-board reed relays to switch
doesn’t match the complement of the
data value received, the signal has been
corrupted somehow (eg, due to interference). Alternatively, the received data
may not be PDP protocol data, which
means that the signal is being sent by
a different hand-held remote.
Following the address and command
data, an end (or tail) comprising a 560μs
burst is sent to complete the data frame.
Any further holding of the hand-held
remote’s button will then produce a repeat frame. This consists of a 9ms burst
followed by a 2.25ms pause and then a
560μs burst.
The repeat frame is repeated at
110ms intervals while ever the remote’s
button is held down.
mains voltages. That would be dangerous since neither the relays nor the
PCB tracks are designed to handle
high voltages.
If you do need to switch high
voltages, use either the reed relay or
the open-collector transistor outputs
to switch appropriately-rated external
SC
relays.
siliconchip.com.au
|