Rolling Code

Published on January 2017 | Categories: Documents | Downloads: 44 | Comments: 0 | Views: 359
of 18
Download PDF   Embed   Report

Comments

Content


Constructional Project
10 Everyday Practical Electronics, August 2009
L
OTSOIDIIILRLNToIoclionIcsys-
lomsluvonovhoonuovoIo¡ouIoi
loyIoss onliy. Tloso IncIuuo sysloms
llul ioquIio u couou oIoclionIc loy,
suclusRIunuInIiuiouliunsmIllois,
RIIDs (RuuIo Iioquoncy IuonlIIculIon
DovIcos), loy¡uus unu svI¡o cuius.
TloiouiouIsounIlslluluonolioquIiou
cououoIoclionIcloyunullosoIncIuuo
Ingoi¡iInl, Iuco unu IiIs iocognIlIon.
RoguiuIoss oI Ioimul, oIoclionIc loys
usuuIIycom¡iIsousmuIIloyIoh-slyIo
liunsmIlloi unu u iocoIvoi llul goos
vIll llo uooi Iocl moclunIsm. Tlo
liunsmIlloi sonus u sliIng oI uulu llul
IsunIquoloouclInuIvIuuuIIoclunu
llIsuulumuslmulclllouulusloiou
InlloiocoIvoihoIoiolloIoclvIIIho
ioIousou. Tlo conco¡l Is iouglIy sImI-
IuilouslunuuiumoluIloy,vlIcllus
u ¡ulloin oI ¡ouls unu vuIIoys uIong Ils
Iongll. Tloso ¡ouls unu vuIIoys musl
mulclllolumhIoisvIllInlloIoclIn
oiuoiIoilloIoclloo¡on.
WIllunyly¡ooIIocl,lloioIsuIvuys
u¡iohIomoIsocuiIly.KoyscunousIIy
hoco¡Iou,vlIIomunyconvonlIonuIRI
unuInIiuiouliunsmIlloisuioIuiIiom
lum¡oi-¡iooI.OnoloclnIquoIslouso
us¡ocIuIiocoIvoiloInloico¡lunuco¡y
lloliunsmIlloucouo.Oncoco¡Iou,llo
sIgnuI cun llon ho io-liunsmIllou lo llo
uooi Iocl lo guIn unuulloiIsou onliy.
In Iucl, llIs loclnIquo vus com-
monIyusouhycuillIovosIncui¡uils
unu ¡iovou voiy oIIoclIvo uguInsl ouiIy
oIoclionIc IoclIng sysloms. Il couIu
uIso ho usou lo o¡on uulomulIc guiugo
uoois unu guIn uccoss lo huIIuIngs.
Rnllingcndosocurity
Mouoin liunsmIllois nov cIicum-
vonl llIs ¡iohIom hy clungIng lloIi
couo oucl lImo lloy sonu u sIgnuI. So
II un unuulloiIsou ¡oison cu¡luios
llo liunsmIllou couo, io-sonuIng llIs
couovIIInolunIoclllouooi.TlIsIs
hocuusollouooiIoclIsnovox¡ocl-
Ing u nov couo husou on un uIgoiIllm
IdoulInrkoylossontryInrdnnrsincurs,hnmos
undindustry,thisKoylossFntrySystomIouturos
u rnlling cndo tn onsuro high socurity. It ulsn
hus twn dnnr-striko nutputs, un ulurm systom
und prnvisinn tn uso up tn !ß sopuruto koyInb
trunsmittorswiththosumorocoivor.
h u l I
d l I k l t I d i h
Rolling Code Keyless
Entry System
Versatile IR unit also
functions as an alarm
Part.1: By JOHN CLARKE
Constructional Project
Everyday Practical Electronics, August 2009 11
llulholllloliunsmIlloiunuiocoIvoi
luvoIncommon.
TlIs couo clungIng loclnIquo Is
commonIy cuIIou u ‘ioIIIng couo’,
uIllougl Il Is somolImos uIso cuIIou
‘couo lo¡¡Ing’. Il ionuois co¡yIng
usoIossunullus¡iovIuosuvoiylIgl
IovoIoIsocuiIly.IlIsuIsovIiluuIIyIm-
¡ossIhIolosonuucoiioclcouovIlloul
luvInguvuIIuioIIIngcouoliunsmIlloi.
TlIsIshocuusooIllolugonumhoioI
couovuiIulIons¡ossIhIo.
BocuusooIIlssocuiIlyuuvunlugos,u
ioIIIngcouoliunsmIlloiIoimsllohusIs
oIlloRoIIIngCouoKoyIossLnliySys-
lomuosciIhouloio.InIucl,lloouusoI
¡IclIngucoiioclcououliunuomIoi
oui ioIIIng couo liunsmIlloi uio ono
In1.4liIIIIonoiiouglIyonoIn1u
12
.
II you vunl lo lnov moio uhoul
ioIIIngcouoliunsmIssIons,ioIoilollo
so¡uiulo¡unoIoIsovloioInllIsuilIcIo.
MuinIouturos
OuinovRoIIIngCouoKoyIossLnliy
Syslomcom¡iIsosusmuIIloyIoh-slyIo
liunsmIlloi unu u so¡uiulo iocoIvoi.
Tlo liunsmIlloi Is smuII onougl lo
houllucloulouloyiIng,unuluslvo
¡uslhullonsvIlclos,ouclcu¡uhIooI
sonuIng u so¡uiulo couo. Lucl lImo
onooIllosvIlclosIs¡iossou,usmuII
InuIculoi LLD luslos lo InuIculo llul
lloliunsmIlloilussonlIlscouo.
Tlo Iuigoi oI llo lvo svIlclos
uclIvulos llo uIuim IunclIons oI llo
iocoIvoi. Il uims llo unIl so llul Il
vIIIsounuunuIuimslouIulloioho
unuulloiIsouuccoss.
TlouIuimIunclIonsIncIuuounoIoc-
liIcuooisliIloconlioI(llIsuIIovsllo
uooi lo ho o¡onou), lvo uIuim In¡uls
(og,lomonIloiuoois,vInuovsoiolloi
sonsois), unu un uimluIsuim oul¡ul.
TlouooisliIlocuno¡lIonuIIyhosollo
o¡oiuloonuimIng,onuIsuimIngoiholl.
In uuuIlIon, un uIuim oul¡ul Is
¡iovIuoulosounuusIionIIioquIiou.
Tlo soconu, smuIIoi ¡uslhullon
svIlclonlloliunsmIlloiIsInuo¡onu-
onl oI llo uIuim. Il cun ho usou lo
o¡oiulouso¡uiulouooisliIlooisomo
olloiuovIcoconnocloulolloiocoIvoi.
SucluovIcoscunIncIuuouIIglloiu
sIionllulcunhousouusu¡unIcuIuim.
TlIscunhoo¡lIonuIIysolloo¡oiulo
momonluiIIyoicunhologgIouonunu
oIIvIllouclsvIlcl¡iossIng.
TlouooisliIlooul¡ulscunhosollo
o¡oiuloIiomholvoonulo64soconus,
vlIIolloIn¡ulscunIncIuuouoIuyou
o¡oiulIonIiomulo64soconus.Tloso
uoIuyou In¡uls uIIov llo uIuim lo ho
uimou vlIIo gIvIng llo usoi onougl
lImolooxIlllouooivIlloulsollIngoII
llouIuim.AnIuonlIcuIuoIuy¡oiIouuI-
IovsllouIuimlohouIsuimouononliy.
DuiIngllooxIluoIuy¡oiIou,lloARM
InuIculoi LLD In llo iocoIvoi unIl luslos
onunuoIIuluonosoconuiulo.Alllo
onuoIllooxIluoIuy,llIsLLDInuIculos
llul llo unIl Is uimou hy luslIng hiIoly
onco ovoiy soconu. TlIs consoivos
¡ovoi unu Inciousos Ils oIIoclIvonoss
vlonIlcomosloulliuclIngullonlIon.
AnAclnovIougolPovoiLLDIsuIso
IncIuuouInlloiocoIvoi.TlIsnoimuIIy
luslos vIll u voiy sloil uuly cycIo.
Hovovoi, vlon llo iocoIvoi ¡Icls u¡
usIgnuIIiomlloliunsmIlloi,lloAcll
Povoi LLD luslos ul u voiy lIgl iulo. Il
uIsoslovsIIlloiocoIvoucouoIsInvuIIu
hymomonluiIIyhIInlIngoIIunuon.
II llo couo Is coiiocl, llo iocoIvoi
ios¡onuslollosIgnuI.TloliunsmIs-
sIoniungoIsuhoul4m,vlIclslouIu
ho suIIcIonl Ioi mosl ¡ui¡osos. Nnto,
hnwovor,thutitwillnntwnrkiItho
IRrocoivorisindiroctsunlight.
Sottingitup
BoIoio usIng llo InIiuiou RoIIIng
CouoAIuim,holllloliunsmIlloiunu
lloiocoIvoimuslhosolu¡coiioclIy.
IIisl,ouclliunsmIlloimuslhogIvonu
so¡uiuloIuonlIlyiungIngIiom1lo16.
TlIsIssoIoclouusIngIInlo¡lIonson
lloliunsmIlloihouiu,hulnolollulno
lvoliunsmIlloisslouIuhogIvonllo
sumoIuonlIly.
Soconu, llo liunsmIlloi musl ho
iunuomIsou.TlIsclungoslloInIlIuI
ioIIIngcouounuuIgoiIllm¡uiumolois
loonsuiollullloliunsmIlloicouoIs
goInglohounIquo.
TlollIiuslo¡InvoIvossynclionIsIng
lloliunsmIlloiunuiocoIvoi.TlIs¡ioc-
oss InvoIvos sonuIng llo ioIIIng couo
¡uiumoloislolloiocoIvoi,usuosciIhou
noxlmonll.YoucunsynclionIsoIiom
1lo16liunsmIllois,¡iovIuououcllus
uuIIIoionlIuonlIly.
AIsoIncIuuouIsuIucIIIlylo¡iovonl
uny oi uII liunsmIllois Iiom o¡oiulIng
lloiocoIvoioncolloyluvohoonsyn-
clionIsou.TlIs‘Iocloul’Iouluiocunho
usoIuIIIuliunsmIlloilushoonIoslunu
younoIongoivunlIllovoilvIllyoui
uIuimsyslom.
A liunsmIlloi IuonlIly cun ho
Ioclou oul InuIvIuuuIIy, hul II you
uon’l lnov llo IuonlIly oI u Iosl
liunsmIlloi, uII IuonlIlIos cun ho
Ioclououl.TloliunsmIlloislluluio
lohousouvIlllloiocoIvoiuiollon
io-synclionIsou.
Features
Transmi tter
s
Rolling code infrared transmission
s
Small keyfob style case
s
Dual function buttons
s
Randomisation of code parameters feature
s
Synchronising of parameters feature
s
Up to 16 identifications
Recei ver
s
12V operation
s
Up to 16 separate transmitters can be synchronised
s
Dual function with an independent output
s
Two alarm inputs with exit and entry delays
s
Two door strike outputs
s
Alarm output
s
Arm/disarm output and LED indicator
s
IR receive acknowledge LED
s
Strike 1 operates on arm, disarm or both
s
Strike 2 operates independently with momentary operation or toggle
output
s
Arm output invert option
s
Adjustable door strike, entry/exit delay and alarm periods
s
200-code look ahead feature
s
Transmitter lockout feature
Constructional Project
12 Everyday Practical Electronics, August 2009
Trunsmittorcircuit
OK, so mucl Ioi llo huclgiounu
uoluIIs.Lol’snovlulouIoolullov
llo cIicuIl voils, sluilIng vIll llo
liunsmIlloi–sooIIg.1.
IC1,uPIC16I628AmIcioconlioIIoi,
Ioims llo louil oI llo liunsmIlloi
cIicuIl. Tlo cIicuIl mIgll Iool quIlo
sIm¡Io,hullloiouiouIoloI‘smuils’
lIuuonInsIuolloPICmIcio,IncIuuIng
llosoIlvuionocossuiylogonoiulollo
ioIIIngcouo.
InuoinoimuIconuIlIons,svIlclos
S1unuS2uioo¡oncIicuIlunuliunsIs-
loiQ2IsoII,sono¡ovoiIsu¡¡IIou.
TlIsIsuonoloonsuioIonghulloiyIIIo.
II¡ovoivoioconlInuousIyu¡¡IIou,
llo cuiionl uiuvn Iiom llo hulloiy
vouIuhouiounu4mAhocuusooIllo
quIosconlcuiionloIlloõVioguIuloi.
ConvoisoIy, ¡iossIng oIlloi S1 oi
S2 connocls llo 12V hulloiy lo llo
In¡ul oI ioguIuloi RLG1 vIu uIouo
D1oiD2.A22ΩiosIsloiIsIncIuuou
InsoiIosholvoonllohulloiyunullo
svIlclosloIImIllloInIlIuIcluigIng
cuiionlInlollo1μIhy¡usscu¡ucIloi
ulRLG1’sIn¡ul.TlIsmInImIsosvoui
onllosvIlclconlucls.
Wlon ¡ovoi Is u¡¡IIou lo RLG1’s
In¡ul,Ilsoul¡uluoIIvoisuioguIulou
+õViuIIloIC1.AsuiosuIl,llomIcio
¡ovoisu¡unuiunsIlsInloinuIsoIl-
vuio¡iogium.
Switchchock
Ono oI llo Iisl llIngs llo ¡iogium
uoos Is clocl vlIcl svIlcl vus
¡iossou (llIs lu¡¡ons uIloi u sloil
uoIuylomulosuiollosvIlclIsIuIIy
cIosou).Ino¡oiulIon,llo¡iogiumcun
uocIuoIIS1oiS2Is¡iossouhocuusooI
llo1ulΩiosIsloiconnoclouholvoon
S2unullomIcio’sRA4In¡ul.
IlvoilsIIlollIs.InIlIuIIy,RA4Is
sol Iov hy llo ¡iogium. TlIs ¡In Is
llonmuuoo¡oncIicuIlsollulIlcun
ho¡uIIoulIglIIsvIlclS2vuscIosou.
Hovovoi,IIS1vuscIosouInslouu,llo
RA4¡InvIIIsluyuluV.BycloclIng
llovoIlugoonRA4,llo¡iogiumcun
llus uoloimIno vlIcl svIlcl vus
¡iossouunuInIlIulollocoiioclIunc-
lIoncouosIoillulsvIlcl.
Tlo 1ulΩ iosIsloi Is nocossuiy lo
IImIl llo cuiionl Inlo llo InloinuI
cIum¡Ing uIouos ul RA4 vlon S2 Is
cIosou.In¡iuclIco,llo¡osIlIvocIum¡
uIouovIIIconuucl,cIum¡InglloRA4
In¡ullou.6Vuhovollo+õVsu¡¡Iy.
TlIs¡ioloclslloIn¡ulIiomuumugo.
DIouosD1unuD2¡iolocllloiogu-
IuloiIiomiovoiso¡oIuiIlyslouIullo
hulloiy ho Insoilou llo viong vuy
uiounu.TlosouIouosuIsoIsoIulollo
svIlcloul¡ulsIiomouclolloi,sollul
lloRA4In¡ulvIIIonIygolIglIIS2
Is¡iossou.IIS1Is¡iossou,llo12Vul
RLG1’sIn¡uliovoisohIusosD2,unuso
IshIoclouIiomiouclIngRA4.
Noxl,llo¡iogiumsolsRA2ul¡In1
oIllomIciolIgl.TlIsoul¡uluiIvos
llo huso (B) oI NPN liunsIsloi Q1
vIu u 1ulΩ iosIsloi. As u iosuIl, Q1
svIlclosonunullIsInluinsvIlclos
onliunsIsloiQ2.
TlIs uclIon Iulclos llo su¡¡Iy lo
ioguIuloiRLG1,ovonIIsvIlclS1oiS2
IsioIousou.TlIsIsnocossuiylouIIov
lImoIoilloioIIIngcouocuIcuIulIonslo
Parts List – Rolling Code Keyless Entry System
Receiver
ᗂ1 PC board, code 721, size
61mm × 122mm
1 UB3-type plastic box, size
130mm × 68mm × 44mm
5 2-way PC-mount screw
terminal blocks (5mm or
5.08mm pin spacing)
1 SPST vertical mount micro
tactile switch, with 0.7mm
actuator (S1)
3 3-way pin header terminal
strips (2.54mm spacing)
4 2.54mm jumper shunts
3 PC stakes
1 25mm length of 0.8mm tinned
copper wire
Semiconductors
1 PIC16F88-I/P microcontroller
programmed with irrcroll.hex
(IC1)
1 78L05 low-power 5V regulator
(REG1)
1 38kHz infrared receiver (IRD1)
2 BD681 Darlington NPN
transistors (Q1,Q2)
2 BC337 NPN transistors (Q3,Q4)
1 16V 1W Zener diode (ZD1)
4 1N4004 1A diodes (D1-D4)
1 1N5404 3A diode (D5)
2 3mm red LEDs (LED1,LED2)
Capacitors
5 100μF 16V PC electrolytic
3 100nF MKT polyester
3 10nF MKT polyester
1 1nF MKT polyester
Resistors (0.25W, 1%)
4 10kΩ 1 220Ω
2 2.2kΩ 2 100Ω
2 1kΩ 1 10Ω
2 680Ω
Test Components
4 red LEDs
4 2.2kΩ 0.25W 1% resistors
Transmitter
ᗂ1 PC board, code 722,
measuring 30 × 36mm
1 keyfob remote control
case (Jaycar HB-5605 or
equivalent)
1 12V A23 car alarm battery (9.5
diameter × 27mm)
2 SPST SMD tactile switches 6 ×
6 × 3.85mm (S1,S2)
1 TO-3P transistor silicone
insulating washer, cut to 20 ×
24mm
5 PC stakes
1 25mm length of 0.8mm tinned
copper wire
1 ICSP 5-pin connector (CON1)
Semiconductors
1 PIC16F628A-20/SO
18-lead SOIC microcontroller,
programmed with irxmroll.hex
(IC1)
1 MC78M05 DPAK 5V regulator
(REG1)
1 MMBT100 SOT-23 SMD NPN
transistor (Q1)
1 MMBT200 SOT-23 SMD PNP
transistor (Q2)
2 1N4148 diodes (D1,D2)
1 3mm infrared emitting LED
(LED1)
1 green gull wing style surface
mount LED (2.2 × 2.2mm)
(LED2)
Capacitors
2 1μF monolithic ceramic
1 100nF monolithic ceramic
Resistors (0.25W, 1%)
2 10kΩ 2 22Ω
3 1kΩ
2 10kΩ horizontal trimpots
(VR1,VR2)
ᗂ Printed circuit boards available
from the EPE PCB Service
Constructional Project
Everyday Practical Electronics, August 2009 13
homuuounusloiouvIlloulInloiiu¡-
lIon,olloivIsollocouomuyhocomo
coiiu¡lou.IluIsoonsuiosllullloioII-
IngcouoIsliunsmIllouInIlsonlIioly.
Tlo noxl slugo In llo ¡iogium In-
voIvoscuIcuIulIngllocouounusloiIng
llo vuIuos. TlIs cuIcuIulIon Is husou
on llo ¡iovIousIy liunsmIllou couo
unuusosunInloinuIuIgoiIllm.Onco
cuIcuIulou, llo nov couo u¡¡ouis ul
oul¡uls RBu lo RBõ, vlIcl In luin
uiIvounInIiuiouLLD(LLD1).Tlo22Ω
iosIsloiInsoiIosvIllLLD1IImIlsllo
cuiionllousuIovuIuo.
In o¡oiulIon, LLD1 Is uiIvon usIng
1uumA¡uIsosuluiulooI88.46lHz.A
lIgl(oiu‘1’)IsliunsmIllouusuõ12μs
huisl oI 88.46lHz sIgnuI, IoIIovou hy
õ12μsoInoliunsmIssIon.ConvoisoIy,u
Iov(oiu‘u’)consIslsoIuõ12μs¡oiIou
oInoliunsmIssIonIoIIovouhyuõ12μs
huisloI88.46lHzsIgnuI.
LLD2 Is llo TiunsmIl LLD unu Is
uiIvon hy oul¡ul RA8 uuiIng couo
liunsmIssIon.BusIcuIIy,RA8gooslIgl
oucllImolloioIsu‘1’InlloliunsmIl-
loucouo,unuIovoucllImolloioIsu
'u`. As u iosuIl, LLD2 luslos lo mImIc
lloliunsmIssIoncouo.
Trunsmittoridontity
TiunsmIlloiIuonlIlyIssoIoclouusIng
lloLK1loLK4IInlconnoclIonsloRA1,
RAu, RA7 unu RA6. As slovn, oucl
InuIvIuuuI In¡ul cun ho connoclou lo
oIlloillo+õVsu¡¡Iyoillogiounu(uV)
su¡¡Iy,hulNOTloholloillosu¡¡Iy
vIIIhosloilou.TlonumhoioI¡ossIhIo
comhInulIonsIs16.
LucloIllosoIn¡ulsIsInIlIuIIylIou
lo+õVonlloPChouiu(vIullInPC
liucls)unullIssoIoclIonIsIuonlIly1.
Tloolloi1õIuonlIlIosuiosoIoclouhy
hioulIngonooimoiooIllosoconnoc-
lIons lo llo +õV iuII unu connoclIng
llomInslouulounuujuconluViuII.
Wo’II luIl moio uhoul llIs In llo
consliuclIon.
In-circuitprngrumming
IIvo-¡InlouuoiCON1Is¡iovIuou
on llo cIicuIl lo uIIov Ioi In-CIicuIl
SoiIuIPiogiummIng(ICSP)oIIC1us-
InguPIC¡iogiummoi.AIloinulIvoIy,
vo luvo uovoIo¡ou u suiIuco-mounl
convoiloihouiullulvIIIuIIovIC1lo
ho ¡iogiummou uIioclIy usIng u PIC
¡iogiummoi.Wo’II¡uhIIslllouoluIIs
onllIsnoxlmonll.
Tlo ICSP connoclIons on llo
liunsmIlloi uio uIso usou lo iun llo
iunuomIsulIon unu synclionIsulIon
IunclIonsusInguhiIugoholvoon¡Ins
8unuõunu8unu4ios¡oclIvoIy.
IC1 iuns ul u nomInuI 4MHz, us
¡iovIuou hy un InloinuI oscIIIuloi.
TlIs oscIIIuloi lus u 1º loIoiunco
unu Ils uccuiucy Is suIIcIonl Ioi llIs
u¡¡IIculIon (Io, lloio’s no noou Ioi u
ciysluI oscIIIuloi). Hovovoi, hocuuso
llo oscIIIuloi Iioquoncy cun vuiy
vIll lom¡oiuluio, vo luvo IncIuuou
umounsIoilloiocoIvoiloIoclonlo
llo liunsmIlloi’s cIocl iulo, so llul
vuiIulIonsovoiuIonglImo¡oiIouuo
nolmulloi.
By llo vuy, llo liunsmIlloi usos
sovoiuI suiIuco-mounl com¡ononls
so llul llo cIicuIl vIII Il Inlo u smuII
loyIoh cuso. Tloso suiIuco-mounl
¡uils IncIuuo IC1, RLG1, Q1, Q2,
LLD2,S1unuS2.TloiomuInIng¡uils
uioslunuuiulliougl-loIocom¡ononl
ly¡os llul uio smuII onougl lo Il onlo
lloPChouiu.
Rocoivorcircuit
RoIoi nov lo IIg.2, vlIcl slovs
llo iocoIvoi cIicuIl. Il’s huIIl uiounu
InIiuiou iocoIvoi IRD1 unu PIC mI-
cioconlioIIoiIC1,lloIulloio¡oiulIng
ul 4MHz lo mulcl llo liunsmIlloi’s
Iioquoncy. Onco uguIn, mucl oI llo
com¡IoxIlyIslIuuonhyllosoIlvuio
¡iogiummouInlollomIcioconlioIIoi.
IRD1onIyluslliooIouus,hulInsIuo
Il com¡iIsos u com¡Iolo InIiuiou uo-
locloiunu¡iocossoi.IIisl,IliocoIvos
llo 88lHz InIiuiou ¡uIso sIgnuI Iiom
+5V
INFRARED ROLLING CODE TRANSMITTER
Fig.!:uPIC!ßFß28AmicrncnntrnllorInrmsthohourtnIthotrunsmittorcircuit.ItcnntuinsullthosnItwuronocossury
tngonorutothornllingcndounddrivosuninIrurodLFD(LFD!}.
Constructional Project
14 Everyday Practical Electronics, August 2009
llo liunsmIlloi unu um¡IIIos llIs lo u
conslunl IovoI. TlIs sIgnuI Is llon Iou lo
u 88lHz hunu¡uss IIloi lo iomovo uny
õuHz oi 1uuHz muIns sIgnuI unu olloi
noIso. Il llon uomouuIulos llo sIgnuI
lo ¡iouuco u soiIuI uulu huisl ul IRD1`s
¡In 1 oul¡ul.
TlIs soiIuI uulu sIgnuI Iiom IRD1 Is
Iou lo llo RB4 In¡ul oI IC1 vIu u 1uuΩ
iosIsloi. A 1nI cu¡ucIloi IIlois oul uny
liunsIonls.
IRD1 Is ¡ovoiou Iiom llo iocoIvoi`s
+õV su¡¡Iy iuII. A 1uuΩ iosIsloi unu
u 1uuμI cu¡ucIloi ¡iovIuo su¡¡Iy uo-
cou¡IIng unu IIloiIng, lo ¡iovonl llo
iocoIvoi Iiom ¡iouucIng IuIso sIgnuIs
uuo lo ¡ovoi IIno clungos.
As voII us llo IR iocoIvoi, lloio
uio lvo olloi In¡uls lo llo PIC
mIcioconlioIIoi. Tloso uio uIuim
sonsoi In¡uls ÷ In¡ul 1 unu In¡ul
2 ÷ unu lloso connocl lo llo RBõ unu
RB6 In¡uls oI IC1 vIu 2.2lΩ iosIslois.
Lucl In¡ul Is uIso hy¡ussou usIng u
1uunI cu¡ucIloi lo IIloi oul liunsIonls
unu llus ¡iovonl IuIso liIggoiIng oI
llo uIuim.
Wlon lloso In¡uls uio o¡on, holl
RBõ unu RB6 uio loIu lIgl (Io, ul
+õV) vIu InloinuI ¡uII-u¡ iosIslois.
In ¡iuclIco, llIs mouns llul you cun
uso noimuIIy-o¡on (NO) oi noimuIIy-
cIosou ioou svIlcl unu mugnol ussom-
hIIos lo liIggoi llo In¡uls.
II you uso un NO svIlcl, llo In¡ul
vIII noimuIIy ho lIgl unu llo syslom
vIII liIggoi II u svIlcl Is cIosou. Con-
voisoIy, II un NC svIlcl Is usou, llo
In¡ul vIII noimuIIy ho ¡uIIou Iov hul
vIII go lIgl II llo svIlcl Is o¡onou.
BusIcuIIy, uny clungo In IovoI vlon
u ioou svIlcl o¡ons oi cIosos vIII ho
uoloclou unu sounu llo uIuim ul llo
onu oI llo onliy ¡oiIou ÷ ¡iovIuou
llul llo iocoIvoi Is In Ils uimou slulo.
Nolo, lovovoi, llul llo uIuim vIII nol
sounu II llo iocoIvoi Is slIII vIllIn Ils
oxIl uoIuy ¡oiIou.
Dnnrstrikonutputs
Wlon un IR sIgnuI liunsmIssIon
Is iocoIvou, llo oul¡ul Iiom IRD1 Is
¡iocossou hy IC1. TlIs llon uiIvos
DuiIInglon liunsIslois Q1 unu Q2 us
u¡¡io¡iIulo lo conlioI llo uooi sliIlo
oul¡uls (Io, SliIlo1 unu SliIlo2).
As slovn, Q1 unu Q2 uio uiIvon
vIu 68uΩ iosIslois Iiom IC1`s RBu unu
RA2 oul¡uls ios¡oclIvoIy. DIouos D1
unu D2 cIum¡ llo voIlugo ¡iouucou
hy llo uooi sliIlo soIonoIu lo llo
su¡¡Iy iuII vlon llo liunsIsloi Is
svIlclou oII.
TiunsIslois Q1 unu Q2 uio holl
BD681 DuiIInglon ly¡os unu cun ho
usou lo uiIvo Iouus u¡ lo 1.õA. A
ly¡IcuI oIocliIc uooi sliIlo onIy uiuvs
uhoul 8uumA ul 12V.
Tlo olloi lvo oul¡uls uio llo AIuim
unu Aim oul¡uls unu lloso uio con-
lioIIou hy liunsIslois Q4 unu Q8 (holl
BC887) ios¡oclIvoIy. Q4 Is uiIvon hy
IC1`s RB1 oul¡ul vIu u 22uΩ cuiionl
IImIlIng iosIsloi. Hovovoi, llo huso
cuiionl Is suIIcIonl Ioi llo liunsIsloi
lo iomuIn IuIIy suluiulou Ioi u 2uumA
Iouu unu llIs Is IuouI Ioi muny ¡Iozo
sIions.
SImIIuiIy, liunsIsloi Q8 Is uiIvon vIu
u 1ulΩ iosIsloi Iiom IC1`s RB2 oul¡ul.
Q8`s coIIocloi ¡iovIuos llo Aim oul¡ul
unu llIs cun ho usou us u loggIo oul¡ul
lo sol u soconu uIuim syslom.
Ty¡IcuIIy, you vouIu uso u 1lΩ
¡uII-u¡ iosIsloi holvoon llo Aim
oul¡ul unu llo +12V iuII, so llul llo
IovoI cun svIng holvoon uV unu 12V.
AIloinulIvoIy, Q8`s coIIocloi couIu ho
usou lo uiIvo u ioIuy coII. In llIs cuso,
llo 1ulΩ huso iosIsloi vIII noou lo ho
iouucou lo 1lΩ so llul llo liunsIsloi
cun iomuIn In suluiulIon vlIIo uiIvIng
u28õΩ 12V ioIuy coII.
Tlo unIl cun ho o¡lIonuIIy conIg-
uiou vIll Q8 oIlloi on oi oII vlon
uimou. TlIs Is sol usIng IInl LK4.
Wlon LK4 Is In llo '+` ¡osIlIon, Q8
Is on vlon llo unIl Is uimou unu oII
vlon uIsuimou. In llIs cuso, llo RB8
In¡ul Is loIu ul +õV vIu un InloinuI
¡uII-u¡ iosIsloi vIllIn IC1.
Specifications
Transmi tter
Standby current: 0mA
Total transmit current: rolling code transmission = 35mA for 80ms;
synchronise = 35mA for 100ms; randomisation = 10mA.
Infrared transmit frequency: 38.46kHz
Code transmission rate: 1.024ms
Encoding: a high (or a 1 bit) is transmitted as a 512μs burst of 38.46kHz
infrared signal, followed by 512μs of no transmission. A low (or 0 bit) is
transmitted by a 512μs period of no transmission, followed by a 512μs
burst of 38.46kHz infrared signal.
Rolling code: sends four start bits, an 8-bit identifier, the 48-bit code plus
four stop bits. The start bits include a 16.4ms gap between the second
start bit and the third start bit.
Synchronise code: sent as two blocks. Block 1 sends four start bits, the
8-bit identifier, a 32-bit seed code and four stop bits. Block 2 sends four
start bits, a 24-bit multiplier, the 8-bit increment and 8-bit scramble values,
and four stop bits. The start bits include a 16.4ms gap between the second
start bit and the third start bit.
Code randomisation: alters the multiplier values, the increment value, the
scramble value and the seed code at a 40μs rate.
Infrared transmission range: 4m
Recei ver
Supply Current: 7.6mA typical when armed and with no external devices
powered.
Strike 1 period: adjustable from 0-64 seconds in 0.25s steps
approximately.
Strike 2 period: adjustable from 0-64 seconds in 0.25s steps
approximately.
Input 1 delay: adjustable from 0-64 seconds in 0.25s steps approximately
for exit and entry delays.
Input 2 delay: adjustable from 0-64 seconds in 0.25s steps approximately
for exit and entry delays.
Alarm period: adjustable from 0-128 seconds in 0.50s steps
approximately
Constructional Project
Everyday Practical Electronics, August 2009 15
INFRARED ROLLING CODE RECEIVER
SYNCHRONISE
MovIngLK4lollo‘–’¡osIlIon¡uIIs
RB8logiounuunuclungosllosonso
oI llo Aim oul¡ul. In llIs cuso, Q8
IsoIIvlonllounIlIsuimouunuon
vlonuIsuimou.
LLD2InuIculoslloslulooIllounIl.
Il’suiIvonIiomlloRA4oul¡uloIIC1
vIu u 1lΩ iosIsloi unu luslos vlon
llounIlIsuimou.
Tloio uio lvo uIIIoionl lusl slyIos.
DuiIng llo onliy unu oxIl uoIuy ¡oiI-
ous, llo LLD luslos vIll u õuº uuly
cycIo (Io, Il Is on Ioi luII llo lImo unu
oIIIoiluIIllolImo).Hovovoi,ulllo
onu oI llo uoIuy ¡oiIou, Il luslos on
Ioi onIy 4º oI llo uuly cycIo (Io, oucl
lusl Is voiy hiIoI).
Othorlinknptinns
LInls LK1, LK2 unu LK8 uio In-
cIuuou lo ¡iovIuo Iuilloi o¡lIons.
Ioi oxum¡Io, LK1 cun ho lIou lo
oIlloi llo +õV iuII oi lo uV, oi Il cun
ho IoIl o¡on. Tloso llioo o¡lIons
uoloimIno lov llo SliIlo1 oul¡ul
o¡oiulos. BusIcuIIy, SliIlo1 cun ho sol
lo o¡oiulo vlon llo unIl Is uimou,
vlon Il Is uIsuimou oi on holl uim-
IngunuuIsuimIng.
In o¡oiulIon, llo soIlvuio ¡io-
giummou Inlo llo PIC mIcio uocIuos
vloio llo IInl Is Insoilou hy iunnIng u
Iovlosls.IIisl,IlluloslloRA7oul¡ul
lIgl (õV) unu llon sols llo RA7 ¡In us
unIn¡ulloiouullovoIlugo.IIllovoIl-
ugo Is nov Iov, llon llo IInl musl ho In
llo‘–’¡osIlIon.Hovovoi,IIlloIn¡ul
iomuIns lIgl, llon llo IInl Is oIlloi
In llo ‘+’ ¡osIlIon oi Is o¡on cIicuIl
(Il iomuIns lIgl vlon llo IInl Is o¡on
hocuuso oI llo cluigo on llo ussocIulou
1unI cu¡ucIloi lo giounu).
ToloslIIlloIInlIsInllo‘+’¡osIlIon
oio¡on,lloRA7¡InIsmuuounoul¡ul
uguIn unu Is uiIvon Iov (lo uV). Tlo
RA7¡InIsllonclungoulounIn¡ul
unulloIovoIcloclouuguIn.IIllovoIl-
ugo Is nov lIgl, llon llo IInl musl ho
In llo '+` ¡osIlIon. ConvoisoIy, II llo
voIlugoIsIov,llonlloIInlIso¡on.
Tlo 1ulΩiosIsloiInsoiIosvIllRA7
Islloiolo¡iovonlsloilIngvlonllIs
¡InIslulonlIglunuIovvIlluIInl
In¡osIlIon.
LK2 sols SliIlo2’s o¡oiulIon Ioi
oIlloi momonluiy o¡oiulIon oi Ioi
loggIo o¡oiulIon. TlIs IInl ¡uIIs llo
RAõ In¡ul oIlloi lo +õV vlon Il Is In
llo '+` ¡osIlIon (momonluiy) oi lo uV
vlon Il Is In llo '÷` ¡osIlIon (loggIo).
Nolo llul llIs IInl cunnol ho IoIl o¡on
hocuuso llo RAõ ¡In cun onIy ho usou
usunIn¡ul.
Fig.2: inIrurod rocoivor IRD! und PIC micrncnntrnllor IC! uro tho muin purts in tho rocoivor. IRD! picks up und
domndulutosthoinIrurodtrunsmissinns,whiloIC!docndosthodutuunddrivosthovurinusnutputs.
Constructional Project
16 Everyday Practical Electronics, August 2009
uuuIlIon,IIS1IscIosouuuiIng¡ovoi-
u¡, Il soIocls llo liunsmIlloi IuonlIly
IocloulIunclIon.
Pnworsupply
Povoi Ioi llo cIicuIl Is Iiom u
12V su¡¡Iy sucl us u hulloiy oi DC
¡Iug¡ucl.DIouoDõ¡iovIuosiovoiso
¡oIuiIly¡ioloclIonunuIsiulouul8A
sollulIlcunlunuIollocuiionlsllul
muyhouiuvnhyunoIocliIcuooisliIlo
unusIion.
Tlo 1uΩ iosIsloi unu Zonoi uIouo
ZD1¡iovIuoliunsIonl¡ioloclIon,vIll
lloZonoicIum¡IngvoIlugosovoi16V.
Tlo 1uΩ iosIsloi IImIls llo cuiionl
lliouglZD1lousuIoIovoI.
IoIIovIng ZD1, llo su¡¡Iy Is IIloiou
usIngu1uuμIcu¡ucIloiunuu¡¡IIou
lollo8-loimInuIioguIuloiRLG1.Tlo
iosuIlIng ioguIulou +õV iuII Is llon
Resistor Colour Codes (Transmitter)
❏ No. Value 4-Band Code (1%) 5-Band Code (1%)
❏ 2 10kΩ brown black orange brown brown black black red brown
❏ 3 1kΩ brown black red brown brown black black brown brown
❏ 2 22Ω red red black brown red red black gold brown
Capacitor Codes
Value μF Code IEC Code EIA Code
100nF 0.1μF 100n 104
10nF .01μF 10n 103
1nF .001μF 1n0 102
LK8 Is usou In conjunclIon vIll
liIm¡olsVR1unuVR2losolllovuiIous
lImo¡oiIous.TlosoIncIuuolloSliIlo1
unuSliIlo2momonluiyon¡oiIous,llo
onliy unu oxIl uoIuys Ioi In¡ul1 unu
In¡ul2,unullouIuim¡oiIou.
AsslovnInIIg.2,liIm¡olsVR1unu
VR2uioconnoclouuciosslloõVsu¡-
¡IyunulloIivI¡ois(movIngconlucl)
connocl lo unuIoguo In¡uls ANu unu
AN1ios¡oclIvoIy.TlovoIlugou¡¡IIou
loouclunuIoguoIn¡ulIsconvoiloulo
uuIgIluIvuIuovIllInllosoIlvuiounu
Il Is lloso vuIuos llul uoloimIno llo
lImooul¡oiIous.
Synchrnnisoswitch
SvIlclS1IslloSynclionIsosvIlcl,
unu llIs connocls lo llo RB7 In¡ul.
TlIs In¡ul Is noimuIIy loIu lIgl vIu
unInloinuI¡uII-u¡iosIsloi,hulvlon
S1IscIosou,Il¡uIIsRB7louV.
BusIcuIIy,
S1Isusoulo
synclionIso
llo iocoIvoi
vI l l l lo
liunsmIlloi.
IlIsuIsousou
vlon sol -
lIngllolImo
¡oiIous. In
Note: transistor Q2
mounts under 10kΩ
resistor
Thosotwnlurgor-thun-liIo-sizophntnsclourlyshnwhnwthopurtsuromnuntodnnthotrunsmittorbnurd.Ynuwillnoodu
ñno-tippod snldoring irnn (2mm diumotor nr loss} und u mugniIying gluss tn dn tho ussombly.
Fig.8:Inllnwthosopurtsluynutdiugrumstnbuildthotrunsmittorbnurd.Nnto
thut ynu huvo tn sot tho trunsmittor's idontity boInro instulling IC! (soo toxt}
und dnn't Inrgot trunsistnr Q2 - it gnos undor u !0kΩ rosistnr, just bolnw S2.
Fig.4: this onlurgod truck soctinn shnws
tho lncutinns nI links LK!-LK4 nn tho
trunsmittor bnurd. Tho trunsmittor
idontity is chungod by brouking nno nr
mnro nI tho thinnod link cnnnoctinns
tn tho +öV ruil und bridging thom (with
snldor} tn tho udjucont 0V ruil instoud.
Constructional Project
Everyday Practical Electronics, August 2009 17
Tho koyInb cuso is suppliod with
tho koy switch cnvors mnuntod us
shnwnhoro.Thisussomblymustbo
romnvod.
Fig.ö:nncothoswitchcnvorshuvo
boon romnvod, tho ßungos uro grnund
dnwnusing!80-gritsundpupor,sn
thutnnlythotnpsromuin(sootoxt}.
Abnvo: tho Iinishod trunsmittor
bnurdinsidoitskoyInb-styloplustic
cuso.PnworcnmosIrnmu!2VA28
cur ulurm buttory. Nnto hnw tho
koyswitch cnvors uro mnuntod nn
tholid,usingu20×24mmsilicnno
wushor–sootoxt.
Right: tho twn koyswitch
cnvors uro uttuchod tn tho
20×24mmsilicnnowushor
usshnwnhoro.Usosilicnno
soulunt tn ‘gluo’ thom in
pluco.ThokoyInblidcunbo
usodusutomplutotnpnsitinn
thomcnrroctly.
hioulsInlloco¡¡oioisloilsholvoon
liucls.Ro¡uIiunyIuuIlsllulyouuo
Inu (iuio lloso uuys), llon clocl llo
slu¡o oI llo houiu. Il slouIu luvo u
cuivouIionlougounuusmuIIcIicuIui
cul oul ul llo olloi onu. In uuuIlIon,
lloioslouIuholvosIolsIoillohul-
loiycII¡s.
Noxl, clocl llul llo PC houiu Ils
noulIyInlollohusooIlloloyIohcuso.
II Il uoos nol Il, Il`s jusl u mulloi oI IIIng
IlnoulIyuIonglloougosunlIIIluoos.
Sottingthoidontity
BoInro mnunting uny nI tho
purts, it's ñrst nocossury tn sot tho
trunsmittor’sidontity–butnnlyiImnro
thunnnotrunsmittoristnbousod.II
mnrothunnnotrunsmittorisusod,thon
ouchwillroquirouuniquoidontity.
As su¡¡IIou, llo PC houiu InI-
lIuIIy lIos IInls LK1 lo LK4 lo llo
+õV su¡¡Iy iuII. TlIs Is IuonlIly1,
oiID1.IIonIyonoliunsmIlloiIslo
ho usou, llon you uon`l luvo lo uo
u llIng ÷ jusl Iouvo Il ul llo uoIuuIl
IuonlIly (ID1).
IIyouuovIslloclungolloIuon-
lIly, Il`s jusl u mulloi oI uIloiIng ono oi
moio oI llo IInls us slovn In TuhIo
1. You uo llul hy hioulIng llo IInl`s
llInnouconnoclIonlollo+õVliucl
usou lo ¡ovoi IC1 unu llo InIiuiou
iocoIvoi (IRD1).
Povoi onloII InuIculIon Is ¡iovIuou
hy LLD1, vlIcl uIso uclnovIougos
llo InIiuiou sIgnuI. NoimuIIy, LLD1
luslos vIll u 4º uuly cycIo uhoul
lvIco ¡oi soconu. Hovovoi, vlon un
InIiuiou sIgnuI Is iocoIvou, Il luslos
ullloInIiuiouioco¡lIoniulo.
LLD1 uIso luslos vIll un ovon uuly
cycIo Ioi u sloil lImo ul llo onu oI
synclionIsulIonunuIIlloInIiuiou
sIgnuIIsIncoiiocl.
Cnnstructinn
Tlo RoIIIng Couo KoyIoss
Lnliy Syslom Is huIIl on lvo PC
houius: u RocoIvoi houiu, couo
721, unu u TiunsmIlloi houiu,
couo722.BollhouiusuiouvuII-
uhIoIiomlloEPE PCB Service.
Wo`II sluil vIll llo liunsmIlloi
ussomhIy, vlIcl Is llo liIclIoi oI llo
lvo. In oiuoi lo Il In llo loyIoh cuso,
llo liunsmIlloi houiu mousuios jusl 8u
× 86mm unu usos Iols oI suiIuco-mounl
com¡ononls.
Hovovoi, lloso uio nol loo uIIIcuIl
lo soIuoi In, ¡iovIuou you luvo u
soIuoiIng Iion lI¡ llul Is jusl 2mm In
uIumoloi oi Inoi. A mugnIIyIng gIuss
(oi, ¡ioIoiuhIy, u 'muggIo Ium¡`) Is
uIso ioquIiou lo clocl youi soIuoiIng,
vlIIouIonglloI1.õmmuo-soIuoiIng
hiuIu (SoIuoivIcl) vouIu uIso ho uso-
IuIIoicIounIngu¡unyoxcosssoIuoi
llul muy lov holvoon connoclIons.
IIg.8 slovs llo com¡ononl Iuyoul
on llo PC houiu. Tlo Iisl slo¡ Is lo
clocl llo PC houiu cuioIuIIy Ioi uny
Table 1: Transmitter Identity
Iden-
tity
LK1 LK2 LK3 LK4
1
+ + + +
2
+ + + -
3
+ + - +
4
+ + - -
5
+ - + +
6
+ - + -
7
+ - - +
8
+ - - -
9
- + + +
10
- + + -
11
- + - +
12
- + -
13
- - + +
14
- - + -
15
- - - +
16
- - - -
Ro¡iouucouhyuiiungomonl
vIll SILICON CHIP
muguzIno 2uuu.
vvv.sIIIconclI¡.com.uu
Constructional Project
18 Everyday Practical Electronics, August 2009
unuconnoclIngIllollouujuconluV
liuclInslouuvIuusmuIIsoIuoihiIugo.
Mulosuio,lovovoi,lluluIInlcon-
noclIonIsnolmuuolohollllo+õVunu
uV liucls. Wo luvo IuhoIIou llo +õV
connoclIonvIllu¡Ius(+)sIgnunullo
uVconnoclIonvIllumInus(–)sIgn.
Itisimpnrtunttnsoloctthoidontity
nnw bocuuso tho +öV truck soctinn
cunnnt bo uccossod whon IC! is in
pluco. Tlo +õV connoclIons slouIu
onIy ho hiolon vIll u slui¡ ciuIl
lnIIounu,oncohiolon,slouIunolho
iosoIuoiou.Tlul’shocuusoIC1vouIu
no Iongoi sIl ¡io¡oiIy on llo houiu,
mulIng Il uIIIcuIl lo soIuoi Ils ¡Ins.
Tlo soIoclou IuonlIly slouIu ho
muilou on llo hucl oI llo PC houiu
usIng u muiloi ¡on. Ioi oxum¡Io, II
lloIuonlIlyIs2,viIloID2onlloPC
houiu.TlIsnumhoicunuIsohoviIllon
onllohucloIlloloyIohliunsmIlloi
cuso,InlloInuonlulIon¡iovIuou.
SnItwuro
II you uio huIIuIng llo unIl Iiom
u lIl, llon IC1 vIII ho su¡¡IIou ¡io-
¡iogiummou. II nol, you vIII luvo
lo ¡iogium llo PIC youisoII usIng u
suIluhIo ¡iogiummoi. As ¡iovIousIy
monlIonou,voluvo¡iovIuoulvo¡io-
giummIng o¡lIons, llo Iisl oI vlIcl
Is lo uso llo In-cIicuIl ¡iogiummIng
connocloionlloPChouiu.
AIloinulIvoIy,youcunhuIIuunuuso
llosuiIucomounluuu¡loihouiuloho
uosciIhounoxlmonll,sollulIC1cun
ho¡iogiummououloIcIicuIl.
Tlo soIvuio IIos vIII ho uvuIIuhIo
vIulloEPELIhiuiysIlo,uccossouvIu
www.opomug.cnm. Pio-¡iogiummou
PICs vIII uIso ho uvuIIuhIo Iiom Mu-
gonluLIoclionIcs–soolloIiuuvoilIn
lloIssuoIoiconlucluoluIIs.
Purtsussombly
Lxco¡l Ioi u sIngIo vIio IInl, uII
¡uils Ioi llo liunsmIlloi mounl on
lloco¡¡oisIuooIlloPChouiu.Don’l
InsluIIlloIInlyolllougl–llulslo¡
comosuIloiyouInsluIIIC1.
To InsluII IC1, ¡osIlIon Il on llo
houiuvIllIls¡In1ullo¡iIgll–soo
IIg.8 (¡In 1 Is InuIculou hy u smuII
uujuconl uol In llo houy oI llo IC).
CuioIuIIyuujuslIlsollulIls¡InsIIno
u¡vIlllloliuclsunuusoucIollos
¡og(oisomoolloismuIIs¡iIng-cIum¡)
loloIuIlIn¡osIlIon.
Tlul uono, soIuoi u cou¡Io oI uI-
ugonuIIy o¡¡osIlo ¡Ins, clocl llul
ovoiyllIngIscoiiocl,lloniomovollo
¡ogunucuioIuIIysoIuoilloiomuIn-
Ing¡Ins.
TlomuInllInglovulcloulIoiloio
Is unvunlou soIuoi hiIugos holvoon
uujuconl co¡¡oi liucls. II llIs uoos
lu¡¡on,usosomosoIuoivIcllouiuv
u¡llooxcosssoIuoilocIouillosloil.
AmugnIIyInggIussvIIIholunuyloio
loIns¡oclyouivoil.
Nolo llul ¡Ins 6 lo u unu 1u unu
11uioconnocloulogolloiunyvuy,so
soIuoiholvoonlloso¡InsIsOK.
OncolloICIsIn,youcunInsluIIllo
IInlhonoullIlonlloolloisIuooIllo
houiu. TlIs IInl musl sIl lul uguInsl
llohouiu,olloivIsollohouiuvIIInol
sIluovnInllocusocoiioclIy.
Tlo iomuInIng suiIuco mounl
com¡ononls – Q1, Q2, LLD2 unu
RLG1–cunnovhosoIuoiouIn¡Iuco.
TrunsistnrQ!husunN!lubolnnits
tnp,whiloQ2husunN2lubolinstoud.
Resistor Colour Codes (Receiver)
❏ No. Value 4-Band Code (1%) 5-Band Code (1%)
❏ 4 10kΩ brown black orange brown brown black black red brown
❏ 2 2.2kΩ red red red brown red red black brown brown
❏ 2 1kΩ brown black red brown brown black black brown brown
❏ 2 680Ω blue grey brown brown blue grey black black brown
❏ 1 220Ω red red brown brown red red black black brown
❏ 2 100Ω brown black brown brown brown black black black brown
❏ 1 10Ω brown black black brown brown black black gold brown
Fig.ß: Inllnw this diugrum tn mnunt tho purts nn tho rocoivor bnurd. Uso u snckot Inr tho PIC micrncnntrnllor und
tuko curo tn onsuro thut ull pnlurisod purts uro cnrroctly nriontutod. Tho inIrurod rocoivor mndulo (IRD!} cun oithor
bomnuntodnnthobnurd(usinthoprntntypo}nrcnnnoctodviushioldodcublo(soodiugrumnoxtmnnth}.
2
3
3

2
0
0
9
-
0
7
-
1
3

1
6
:
0
4
:
3
0
Constructional Project
Everyday Practical Electronics, August 2009 19
TlosonumhoisioIulololloMMBT1uu
unu MMBT2uu ly¡os ios¡oclIvoIy.
Don’lgolllommIxouu¡.
Instullingthosomicnnductnrs
TlooiIonlulIonoIllolvoliunsIslois
IsohvIous–lloyluvoono¡Inonono
sIuooIllohouyunulvoonlloolloi
sIuo.RLG1lusuGNDluh¡IusINunu
OIT¡InsllulmuslhosoIuoioulollo
PChouiu.TloconliuI¡Inholvoonllo
INunuOIT¡InsIsIoIlunconnoclou.
Bo curoIul with tho nriontutinn nI
LFD2–itscuthndoloudistholnngor
nIthotwn.
Noxl,soIuoiInsvIlclosS1unuS2,
llon InsluII Ivo PC slulos Ioi llo ICSP
louuoi.Tloso¡InsuioInsoilouIiom
llo non-co¡¡oi sIuo oI llo PC houiu
unu soIuoiou In ¡osIlIon. Tlo ¡Ins
uiollonliImmouonlloco¡¡oisIuo
lo8mmInloIgll.OnllounuoisIuo,
lloy uio liImmou unu IIou lo u.õmm.
Tloslunuuiucom¡ononlscunnov
hoInsluIIou.Tlosomuslhomounlou
lul uguInsl llo PC houiu oi us cIoso lo
Il us ¡ossIhIo In llo cuso oI llo 1ulΩ
iosIsloi llul sliuuuIos Q2. Tulo cuio
vIllllooiIonlulIonoIuIouosD1unu
D2ununolollulllolo¡soIllollioo
monoIIllIccu¡ucIloismuslhonomoio
llun4mmuhovolloPChouiu.
In¡uilIcuIui,llolvocu¡ucIloisnoui
RLG1 cun ho IuIu ovoi ul uhoul 4õ°, vlIIo
lloonouujuconlloIC1noousloluvoIls
IouusuujuslousoIlcunho¡uslouuovn
onlolloPChouiuIuionougllomoolllo
4mmloIgllioquIiomonl.
Cul uII llo Iouus honoull llo PC
houiu (Io, on llo non-co¡¡oi sIuo) lusl
vIllllosuiIuco.
LLD1cungoInnoxl.IlsunouoIouu
Is llo Iongoi oI llo lvo (unIIlo LLD2)
unullIsIouumuslgolovuiusIC1.To
mounl Il, Iisl honu Ils Iouus uovn hy
uu° oxuclIy 2mm Iiom Ils houy, llon
InsoillloIouusInlolloPChouiu.II-
nuIIy,¡usllloLLDuIIllovuyuovn
onlo llo PC houiu, soIuoi llo Iouus
unu cul llom lusl vIll llo unuoisIuo.
NolollulusmuIIcIicuIuinolclIs
ioquIiou In llo iIm oI llo loyIoh huso
IoilloLLDlosIlIn.TlIscunhomuuo
usIng u smuII iul-luII IIo. Wlon llIs
nolcl lus hoon muuo, IIo u mulclIng
nolcl In llo lo¡ luII oI llo loyIoh cuso.
Buttorytorminuls
TlohulloiyloimInuIsuioInsluIIou
hy Iisl ¡IucIng llo PC houiu In llo huso
oIllocuso.Tluluono,lloloimInuIs
uio sIIu Inlo ¡osIlIon unu soIuoiou.
Mulo suio llul llo loimInuI vIll llo
s¡iIngIsIoculouusslovnInIIg.8.
Switch cnvor mndiñcutinns
Tlo loy svIlcl covois llul uio su¡-
¡IIou vIll llo loyIoh cuso luvo lo ho
mouIIou lo suIl llo lvo svIlclos on
lloPChouiu.
Assu¡¡IIou,llolvosvIlclcovois
uio uIiouuy socuiou In ¡Iuco In llo loy-
IohIIu.TlIsussomhIymuslhoiomovou
unullocovoiscuioIuIIygiounuuovn
lo 1.õmm llIcl ÷ soo IIg.õ. TlIs Is uono
hy ¡IucIng somo 18u-giIl sunu¡u¡oi
onlo u lul honcl unu sunuIng llo svIlcl
covois unlII lloy uio lul on lloIi huso.
Tlul uono, cul oul u 2u × 24mm
ioclunguIui¡IocoIiomusIIIconoTO-8
vusloi (2u × 24mm) lo mulo u nov
svIlclcovoiussomhIy.Il’sllonsIm¡Iy
umulloioIulluclIngllosvIlclcovois
lollIsvusloiusIngsIIIconosouIunl–
soo ¡lolo. Iso llo loyIoh IIu us u lom-
¡Iulolo¡osIlIonllocovoiscoiioclIy.
Rocoivorussombly
Nov Ioi llo iocoIvoi – soo IIg.6.
As usuuI, sluil hy cloclIng llo PC
houiu Ioi uny uoIocls. Clocl uIso llul
lloloIosIzosIoillosciovloimInuI
hIocls uio coiiocl unu onIuigo llom II
nocossuiy.
Tlul uono, clocl llul llo PC houiu
Ils InsIuo llo s¡ocIIou ulIIIly cuso.
IIIo llo houiu ougos lo gol Il lo Il II
nocossuiy hul uon`l IIo llom loo mucl,
olloivIso llo houiu vIII nol Iocl coi-
ioclIyInlollovuIIsIols.
IIg.6 slovs llo ussomhIy uoluIIs.
InsluII llo vIio IInl Iisl, llon InsluII
lloiosIslois.Tlouccom¡unyIngluhIo
slovs llo iosIsloi coIoui couos, hul
you slouIu uIso clocl llom usIng u
uIgIluImuIlImoloi.
Tlo uIouos unu llo IC soclol cun go
In noxl, lulIng cuio lo oiIonl oucl vIll
llocoiiocl¡oIuiIly.IoIIovllosovIll
llo cu¡ucIlois, uguIn mulIng suio llul
llo oIoclioIylIcs go In coiioclIy. Tlo
llioo PC slulos Ioi TP1, TP2 unu TPG
cunllonhoInsluIIou.
Do¡onuIng on youi ioquIiomonls,
LLDs1unu2cunoIlloihomounlou
uIioclIyonlloPChouiuoimounlou
oxloinuIIyunuconnoclouusIngvIio
Iouus. Bo suio lo mounl oucl LLD
vIll Ils cullouo Iouu (llo sloiloi oI
llo lvo) lovuius llo Iovoi ougo oI
lloPChouiu.
SImIIuiIy,IRD1cunoIlloihomounlou
uIioclIyonlloPChouiuoiconnoclou
ThoussomblodPCbnurdclipsnoutlyintnustundurd
plusticutilitycuso.ThoIullinstullutinnundsottingup
dotuilsInrthorocoivorwillboinPurt2noxtmnnth.
Constructional Project
20 Everyday Practical Electronics, August 2009
usIng lvIn-coio slIoIuou cuhIo (soo
uIugiumInPuil2noxlmonll).
TiIm¡ols VR1 unu VR2 unu llo
8-vuyunu2-vuy¡InlouuoisIoiLK1-
LK4 uio noxl on llo IIsl. Tlul uono,
InsluIIRLG1unuliunsIsloisQ1lo-Q4.
Q1unuQ2muslhoInsluIIouvIlllloIi
moluIIucoslovuiusIC1.
IInuIIy,com¡Iolollohouiuussom-
hIy hy InsluIIIng svIlcl S1 unu llo
sciov loimInuI hIocls. Nolo llul llo
6-vuyloimInuIsullloiIglllunuougo
oI llo PC houiu uio muuo u¡ usIng
llioo2-vuyhIocls.TlosouiojoInou
hysIIuInglloIiuovoluIIjoInlslogolloi
hoIoioInsluIIIngllomonlloPChouiu.
Tlul’s uII vo luvo s¡uco Ioi llIs
monll.Noxlmonll,vo’IIcom¡Iolollo
consliuclIonunuuosciIholloInsluIIu-
lIonunusollIng-u¡¡iocouuios,IncIuu-
Ing sollIng llo onliy unu oxIl uoIuys.
Wo’II uIso uosciIho llo o¡lIonuI SOIC
uuu¡uloihouiu,sollulyoucun¡iogium
lloPICmIcioconlioIIoiouloIcIicuIl.
One question that’s often asked
about rolling code systems is what
happens if the transmitter is out
of range and one of the transmit
switches is pressed? Will the receiver
still work when the transmitter is later
brought within range and the button
pressed again?
This question is asked because the
code the receiver was expecting has
already been sent and the transmit-
ter has rolled over to a new code. So
how does the system get around this
problem?
The answer to this is that the receiver
will acknowledge a signal that is the
correct length and data rate, but it will
not trigger unless it receives the correct
code. So if the signal format is correct
but the code is incorrect, the receiver
then calculates the next code that it
would expect, and checks this against
the received code. If the code is now
correct the receiver will unlock the door.
If the code is still incorrect, the
receiver calculates the next expected
code and will do this up to 200 times.
If none of these are correct, the re-
ceiver keeps its original code, but it
will not trigger. In fact, the only way
to trigger the receiver after this is to
re-synchronise it to the transmitter.
Of course, a second transmitter will
still operate the receiver (provided
they have been synchronised in the
first place). That’s because this trans-
mitter has a different identity and a
different code to the other transmitter.
Automatic synchronisation
Some rolling code transmitters sys-
tems offer automatic synchronisation
if the transmitter and receiver lose
sync. In these systems, the receiver
includes a code ‘look-ahead’ feature,
as described above, but the number
of look-ahead codes is usually limited
to fewer than 200. What happens is
that if the code is not recognised after
all the look-ahead calculations have
been made, the receiver changes its
synchronisation method.
Basically, the receiver requires two
separate transmission codes before
restoring correct operation. On the
first transmission, it calculates the
next code it should receive using this
received code as the basis for calcu-
lation. If the second code sent by the
transmitter is the same as the code that
was calculated, the receiver operates.
The drawback of this latter scheme
is somewhat less security since, in
theory, two successive transmission
codes could be intercepted and re-
corded. These codes could then be
re-transmitted to synchronise and
thus trigger the receiver.
Calculating the code
Another question that’s often
asked is how does the receiver know
which code to expect from the trans-
mitter, since this changes each time?
The answer to this is that the trans-
mitter and the receiver both use the
same calculation to determine the
next code. They also both use the
same variables in the calculation and
these variables tend to be unique
values that no other transmitter uses.
For example, if the calculation for
consecutive codes requires the origi-
nal calculated code to be multiplied
by 100 and the number 7 added to it,
then both the transmitter and receiver
will use these numbers to perform
the calculation.
Without knowing both the mul-
tiplier and the increment value, it
would be very difficult to predict the
next code. This is particularly true
because of the very large numbers
involved. The values quoted for the
multiplier and increment value are not
as simple as 100 and 7 but are 24 bits
and eight bits respectively in length.
In addition, the code length is 48 bits
with as many as 2.8 x 10
14
combina-
tions. This reduces by a factor of 200
because of the look ahead feature to a 1
in 1.4 × 10
12
chance of striking the cor-
rect code – still impossibly long odds.
Code scrambling
A further complication with the
transmitted code is that the code is not
necessarily sent in sequence. There
are also 32 possible scrambling vari-
ations that can be applied to the code.
What if the transmitter sends two
consecutive codes that are the same
and the code is intercepted and re-
transmitted to open the lock? This is
highly improbable and our rolling code
transmitter has safeguards to prevent
the same code appearing twice in suc-
cession. For each code calculation,
a comparison is made between the
current and last code. If the code is the
same, the code is recalculated after an
increment of the code value to ensure
successive code calculations diverge.
It is this new code that is transmitted.
The receiver performs the same
recalculation so that the new code
will be accepted.
Another question concerns the use
of different transmitters. Does each
transmitter use the same rolling code
calculation and if so, wouldn’t the
receiver lose its synchronisation if
several transmitters were used? The
answer is that the receiver will not
lose synchronisation, even if one of
the transmitters is not generally used.
This is because each transmitter op-
erates independently from the others.
Only 16 transmitters can be used
with a given receiver and each must
have its own different identity from
1 to 16. The identity is built into each
transmitter and synchronisation is
required for each transmitter.
The codes sent by each transmitter
are different and the code includes the
transmitter identity value. The receiver
has 16 different rolling code and
calculation parameters, and so each
transmitter is treated independently.
Frequently Asked Questions
Constructional Project
24 Everyday Practical Electronics, September 2009
H
AVING completed the receiver
board assembly, as described last
month, it can be housed in a UB3-sized
plastic box. As shown in the photo last
month, it simply clips into place, but
ÚRSTYOUWILLNEEDTODRILLAHOLEINONE
end for IRD1, plus a hole in the other
end for the external wiring.
You will also have to drill matching
holes in the lid for the Ack/Power and
Arm LEDs (LED1 and LED2).
Now for the initial set-up. First,
install a jumper link in the minus
Last month, we described the circuitry and
gave the PC board assembly details for
our Rolling Code Keyless Entry System.
This month, we cover the installation and
setting-up procedures and describe an
optional SOIC adaptor board, so that you
can program the PIC micro out of circuit.
(–) position for LK2. This will set the
Strike2 output to toggle mode (note:
LK2 must always have a jumper con-
nection, either to the ‘+’ or ‘–’ posi-
tion). Leave jumpers LK1, LK3 and
LK4 out for now.
Next, set trimpots VR1 and VR2 to
mid-range. These trimpots are later
used to set the various time periods.
Transmitter set-up
At this stage, the transmitter is
already partially set up because its
identity is selected during construc-
tion. If the transmitter’s PIC micro-
controller has not been programmed,
then program it now via the ICSP
connection. This connection can be
MADE BY SOLDERING ÚVE LEADS TO THE
transmitter’s ICSP pins and then con-
necting the other ends of these leads
to a 5-way ICSP socket to plug into the
PIC programmer.
After the IC has been programmed,
clip in the 12V battery and check that
the green acknowledge LED lights
when a switch is pressed.
Of course, if you buy a complete
kit, the PIC microcontroller (and the
PIC in the receiver) will be supplied
pre-programmed, so you won’t have
to worry about that last step.
Testing the receiver
The receiver can now be tested. First,
with IC1 out of its socket, connect a 12V
power source that can supply at least
60mA. That done, switch on and check
that there is 5V between pins 14 and 5
Rolling Code Keyless
Entry System
Versatile IR unit also
functions as an alarm
Part.2: By JOHN CLARKE
Constructional Project
Everyday Practical Electronics, September 2009 25
of the IC socket. If this is within 10% of
5V (4.5V to 5.5V), switch off and plug
IC1 into its socket, making sure that it
is correctly orientated.
Next, wire up the test LEDs as shown
in Fig.6. These are all wired in series
with 2.2kΩ current-limiting resistors.
Once the LEDs are wired up, apply
power and check that the receiver’s
POWER,%$ÛASHESBRIEÛYATABOUTONCE
per second. If it does, then so far so good.
4HE TRANSMITTER MUST NOW BE RAN-
domised and then synchronised with
the receiver. Let’s now take a look at
these two procedures.
Randomising
Randomisation of the transmitter
ensures that it uses a unique set of pa-
rameters to calculate the rolling code.
4HISPROCEDUREISIMPORTANTBECAUSE
the original parameters programmed
in are the same for every transmitter.
Basically, you need to personalise the
parameters to prevent another trans-
mitter that has the same identity from
operating your receiver. If randomisa-
tion is not done, there is the real risk
that someone else’s transmitter that has
ALSONOTBEENRANDOMISEDWILLOPERATE
your receiver.
To randomise a transmitter, simply
connect pins 3 and 5 of its ICSP con-
nector together and then press switch
3 4HE TRANSMIT ,%$ WILL ÛASH AT A
one-second rate for the duration. Re-
lease the switch when you are ready
AFTER BETWEEN SEVERAL SECONDS AND
several minutes).
The parameters are all altered every
40μs (that’s 25,000 times a second), so
THEYWILLBEDIFFERENTFOREACHTRANSMIT-
ter after even short presses.
Synchronising
After randomising, the transmitter
MUST THEN BE SYNCHRONISED WITH THE
receiver. To do this, disconnect pins 3
and 5 of the ICSP header and connect
pins 3 and 4 together instead. That
done, press and hold down S1 on the
receiver and then press one of the
switches on the transmitter.
4HE TRANSMIT ,%$ WILL NOW ÛASH
twice momentarily and the receiver’s
ACKNOWLEDGE ,%$ WILL ÛASH ON AND
off at a one-second rate until switch
S1 on the receiver is released.
Rolling Code Protection: Keeping It Secret
As previously noted, the Rolling Code Keyless Entry System provides a high
level of security because the transmitted code changes each time it is sent.
However, to further improve security, we have also included code protection for
both the transmitter and receiver.
Basically, code protection prevents the program and data within the PIC micro-
controllers from being read by a PIC programmer. As a result, the parameters used
to calculate successive rolling codes are kept safe within the microcontrollers.
In particular, this effectively prevents a transmitter from being ‘interrogated’, in
order to make a duplicate transmitter that will operate the door lock.
So, while the hex files can be used to program the microcontrollers, they can-
not be read back once programming has been verified. The parameters used
for calculating the rolling code are then randomised in the transmitter using the
set-up procedure already described. It is these parameter and the rolling code
seed values that are hidden by the code protection.
Fig.6: the test LEDs are connected to the receiver as shown here. Follow the
procedure in the text to synchronise the transmitters and test the receiver.
.OWREMOVETHELINKBETWEENPINS
and 4 on the transmitter’s ICSP header.
/NCETHATmSDONEYOUSHOULDNOWÚND
that the transmitter operates the receiv-
er. If it doesn’t, try synchronising again
and make sure that the IR receiver has
a clear ‘view’ of the transmitting LED.
4HE ABOVE RANDOMISATION AND SYN-
CHRONISATIONPROCEDURESMUSTBEDONE
for each new transmitter. Note that a
TRANSMITTERTHATHASNOTBEENSYNCHRO-
NISED WILL NOT BE ABLE TO OPERATE ITS
receiver, even if their rolling codes are
the same. Note also that synchronising
a new transmitter prevents the use of
a previously synchronised transmitter
that has the same identity.
Next, press the main switch on the
transmitter and check that the receiver’s
3TRIKE ,%$ LIGHTS FOR ABOUT ÚVE SEC-
onds. The external Arm LED should
ALSOLIGHTWHILETHERECEIVERmSONBOARD
!RM ,%$ SHOULD ÛASH WITH AN EVEN
ONOFFDUTYCYCLE4HISÛASHINGSHOWS
the exit delay.
!FTER ABOUT S THE EXIT DELAY
should expire and the Arm LED should
THENÛASHBRIEÛYONCEPERSECOND
Now check the operation of the
second (smaller) switch which is on
the transmitter. This switch should
toggle the Strike2 LED on and off with
successive pressings.
Testing the alarm
To test the alarm, arm the unit and
short Input1 on the receiver to ground
(0V) using a clip lead. The external
alarm (ALRM) LED should light after
20s and should then stay on for 60s.
You can check the operation of
THE DELAYED EXIT BY ARMING THE UNIT
and momentarily shorting Input1 or
Input2 to 0V during the exit period.
The alarm LED should not light after
the exit period has expired.
Receiver options
4HERECEIVERCANBEPOWEREDFROM
A6$#PLUGPACKORA6BATTERY
7HENPOWEREDBYAPLUGPACKMAKE
sure it can supply the necessary cur-
rent for the electric striker and an
ALARM SIREN IF ÚTTED -ANY ELECTRIC
strikes draw around 800mA, so a 1A
PLUGPACKWILLBEREQUIRED
Note that the armed status is stored
in case the power goes off; the armed
OR DISARMED MODE WILL BE RETURNED
when power is reconnected. So, if
the receiver was armed when power
was lost, then the armed mode will
BERESTOREDWHENPOWERISRETURNED
Constructional Project
2 Everyday Practical Electronics, September 2009
When powering from a 12V battery,
a charger should also be connected to
maintain battery charge – see Fig.7. A
12V 350mA charger for sealed lead-acid
batteries would be suitable. These charg-
ers are fully automatic – they charge the
battery when required and maintain full
charge with a trickle current.
Depending on your application,
Strike1 can be optioned to operate on
arming, on disarming or on both arming
and disarming. These options are selected
using link LK1. Table 1 shows what each
link connection does. You may also wish
to place a small buzzer across the door
strike connection to give an audible in-
dication of door strike operation.
The Strike2 output can be momentar-
ily activated whenever the secondary
switch on the transmitter is pressed.
Alternatively, it can be toggled on or
off with each switch pressing. Link LK2
selects these options.
Receiver time periods
Trimpots VR1 and VR2 are used to set
the time periods for Strike1 and Strike2,
the exit and entry delays for Input1 and
Input2, and the alarm period. Link LK3
provides the means to set each time
period – see Table 3.
With LK3 in the ‘+’ position, VR1 and
VR2 set the strike period for Strike1 and
Strike2 respectively. Table 3 shows the
various voltages that VR1 and VR2 can
provide to set the strike periods. These
voltages can be measured at TP1 for
VR1 and at TP2 for VR2.
To set the strike periods, simply adjust
VR1 and VR2 to the voltage settings re-
quired and press the synchronise switch
(S1) on the receiver board.
The delayed inputs (ie, the entry
delays for Input1 and Input2) are set
when LK3 is in the ‘–’ position. Once
again, it’s simply a matter of setting the
voltages at TP1 and TP2 and pressing
S1 to set the values.
Finally, when LK3 is out, VR1 sets the
alarm period (VR2’s setting is ignored).
Just set the required voltage at TP1 and
press S1 to program the period in.
Note that because pressing switch S1
programs in the timing adjustments,
synchronisation will also alter the
timing. This means that if you syn-
chronise a transmitter to the receiver
at a later date, you will have to make
sure that VR1 and VR2 are in
the correct positions for the
LK3 option selected before
pressing S1.
Table 1: Strike1 operation (LK1)
LK1 + – Open
Strike1
operates
on
Arm Only
Disarm
Only
Arm and
Disarm
Table 2: Strike2 operation (LK2)
LK2 + – Open
Strike2
operation
Momen-
tary
Toggle Not valid
Table 3: LK3, VR1 and VR2 settings
LK3 + – Open
Operates when
S1 pressed
VR1 sets Strike1
period
VR2 sets Strike2
period
VR1 sets Input1 delay
VR2 sets Input2 delay
VR1 sets alarm period
Notes
5V sets 64s
2.5V sets 32s
1.25V sets 16s
0.625V sets 8s
0.313V sets 4s
0.156Vsets 2s
5V sets 64s
2.5V sets 32s
1.25V sets 16s
0.625V sets 8s
0.313V sets 4s
0.156Vsets 2s
5V sets 128s
2.5V sets 64s
1.25V sets 32s
0.625V sets 18s
0.313V sets 8s
0.156Vsets 4s
Where To Get The Bits
Suitable reed switch assemblies, door strikes and sirens are
available from Jaycar electronics. They can also supply kits
for this project.
The parts available from Jaycar include: (1) the LA-5072
normally closed (NC) reed switch magnet assembly;
(2) the LA-5078 door strike; and (3) the LA-5255 and
LA-5256 piezo sirens.
Above right: door strike available from Jaycar.
In practice, this just means leaving
6262AND,+INTHEIRÚNALPOSITIONS
AFTERYOUÚNISHTHETIMINGADJUSTMENTS
That way, if you synchronise a transmit-
ter later on, the last set timing values are
simply reset to the same values.
Arm output option
Link LK4 sets the arm output option
– see Table 4. When LK4 is in the ‘+’
position, the Arm output is low on arm
and open on disarm. Conversely, when
LK4 is in the ‘–’ position, the Arm output
is open on arm and low on disarm. It all
depends on how you intend to use this
output as to which option you choose.
Receiver lockout
Any transmitter that has been syn-
chronised can later be locked out from
operating the receiver. This is done by
setting links LK1, LK2, LK3 and LK4
in the receiver and pressing switch S1
during power up.
Table 5 shows the link options for
each transmitter identity. Note that
these link settings correspond exactly
to the links used in the transmitter to
set the transmitter identity
When lockout is performed, the
POWER,%$ÛASHESTHEIDENTITYNUMBER
to indicate that the procedure has
been successfully completed. So, for
example, if you lock-out an identity 3
TRANSMITTER THE POWER ,%$ WILL ÛASH
three times at a nominal 1s rate before
a 4s break until S1 is released.
When S1 is released, the receiver
then operates normally, but with the
selected transmitter now locked out.
If S1 is held closed, the cycle of
,%$ÛASHINGCONTINUES!TTHEENDOF
the third cycle, all identities will be
locked out and the power LED will stay
lit until S1 is released. This feature is
included as a short cut to locking out
all identities.
If one transmitter is locked out and a
second one also needs to be locked
out, then the power will have to be
switched off and links LK1-LK4 repo-
sitioned for that transmitter identity.
The power must then be re-applied
with S1 pressed.
Once the lockout procedure has
been completed, you must relocate
links LK1-LK4 to their correct posi-
tions for the receiver functions that
you wish to select. It is then best to test
that everything is correct by pressing
the switches on another (non-locked-
out) transmitter and verifying that the
receiver operates as expected.
Constructional Project
Everyday Practical Electronics, September 2009 2
Undoing lockout
It’s easy to get a locked out transmit-
ter to operate the receiver again (ie, to
unlock it). Just synchronise the trans-
mitter with the receiver and all will be
back to normal.
The rolling code for the infrared
transmitter comprises four start bits,
a 48-bit code and four stop bits.
A calculation comprising a multi-
plier and an increment value is used
to generate the 48-bit code. First, you
start with a number (called the seed),
then you multiply this seed by the
multiplier and then add the increment.
The result becomes the next value for
random code.
Normally, if the calculation is con-
tinued, the random code will become
larger and larger as we multiply and
then add the increment value. How-
ever, this is prevented by limiting the
seed value used in the calculation to
a certain width; 32 bits in this case.
In practice then, the 24-bit multiplier
multiplies the 32-bit seed. The 8-bit
increment value is then added and the
result is limited to 48-bits by eliminating
the more significant bits. This resulting
48-bit code is the code used for the roll-
ing code transmission. In addition, the
order of transmission for these bits is
jumbled using an 8-bit scramble code
with 32 possible combinations.
The calculations do not necessarily
produce random numbers, but they do
produce variations from one transmis-
sion to the next. However, in some
cases, the result could converge to
settle at the same value, so it is impor-
tant to check this and make sure the
calculations do give diverging values
each time.
To do this, the result of each calcula-
tion is compared to the last value to
ensure it is not repeated. If the result is
the same as before, the duplicate code
is not transmitted and a new calcula-
tion is made after incrementing the
result. Subsequent calculations will
then begin to diverge again.
Randomisation
To avoid conflict, each transmitter
must have a unique set of parameters
for making the rolling code calcula-
tions. As a result, we have included
a ‘randomisation’ function, whereby
the multiplier value, the increment
value, the scramble value and the
seed value are all changed in a rela-
tively random way.
There are 16.7 million multipliers
available and 54 possible increment
values. Together with the 32 scramble
variations, these provide 29 billion dif-
ferent combinations. In addition, the
minimum multiplier value is 8192 to
ensure a significant change in value
with each calculation.
Even if two transmitters do end up
with the same parameter values, the
fact that the seed value is a part of
the calculation means that you need
to be within 200 values of the correct
value in order to unlock someone
else’s lock. The probability of this is
2
24
divided by 200, or one in 83,000.
This is in addition to the one in 29
billion chance of having the same
parameter values!
There are up to 16 different trans-
mitters that can be used with the one
receiver, and each transmitter uses
a different set of seed, multiplier,
increment and scramble values. The
transmitter sends out its identification
code that is embedded in the rolling
code, so the receiver knows which set
of values it must use in the calculation
for each transmitter.
When the transmitter is sending
synchronising code to the receiver,
it sends the 8-bit identifier, the 24-bit
seed, the 24-bit multiplier, the 8-bit
increment value and the 8-bit scram-
ble values. The identifier value is also
stored, so that the receiver knows that
this identity has been synchronised.
An identity that has not been synchro-
nised will not operate the receiver.
Once the receiver has these param-
eters, the transmitter and receiver will
remain in lock because they use the
same calculation values.
Calculating The Rolling Code
Installation
The Rolling Code Keyless Entry
System is suitable for use in homes,
factories and cars. Fig.7 shows
how to wire the unit for a typical
installation. Note that IRD1 must
be shielded from direct sunlight,
otherwise the reception range will
be severely affected.
In some cases, it may be necessary
to connect the infrared receiver (IRD1)
via extended leads using twin-core
Fig.7: here’s how to connect the receiver in a typical installation. Note that you can use both NO (normally open) and NC
(normally closed) sensors on the alarm inputs (Input1 and Input2). The battery charger keeps the battery topped up.
Constructional Project
2 Everyday Practical Electronics, September 2009
shielded cable (eg, if the receiver is
mounted on one side of a wall, but in-
frared reception is needed on the other
side). Fig.8 shows how this is done.
The two alarm inputs (Input1 and
Input2) can be used in conjunction
with reed switch magnet assemblies
that change state when a door or
window is opened or closed. You
can use either normally closed (NC)
or normally open (NO) types. (See
last month’s weather station project
for the lowdown on reed switches.)
As shown in Fig.9, NC types are
connected in series, while NO types
are connected in parallel. However,
for best security, use only one sensor
per input.
Alternatively, you can use a PIR de-
tector or a glass breakage detector on
one or both of the inputs. EPE
Table 5: Receiver lockout
selections
Lockout
Identity
LK1 LK2 LK3 LK4
1
+ + + +
2
+ + + –
3
+ + – +
4
+ + – –
5
+ – + +
6
+ – + -
7
+ – – +
8
+ – – –
9
– + + +
10
– + + –
11
– + – +
12
– + – –
13
– – + +
14
– – + –
15
– – – +
16
– – – –
Table 4: Arm output (LK4)
LK4 + –
Arm output low
on arm, open on
disarm
Arm output open
on arm, low on
disarm
Fig.8: the IR receiver (IRD1) can be connected via twin-
core shielded cable as shown here.
Above: you can
buy both NO and
NC reed switch
assemblies.
Fig.9: here’s how to wire the two different sensor types (NO and NC) to the
alarm inputs on the receiver board.
Reproduced by arrangement
with SILICON CHIP
magazine 2009.
www.siliconchip.com.au
Get your magazine ‘instantly’
anywhere in the world –
buy and download from the
web.
TAKE A LOOK, A FREE
ISSUE
IS AVAILABLE
A one year subscription (12 issues)
costs just $18.99(US)
Back issues are also available
HandsOn Technology
http://www.handsontec.com

Low Cost 8051C Starter Kit/ Development Board HT-MC-02

HT-MC-02 is an ideal platform for small to medium scale embedded systems
development and quick 8051 embedded design prototyping. HT-MC-02 can be used as
stand-alone 8051C Flash programmer or as a development, prototyping and
educational platform



Main Features:

 8051 Central Processing Unit.
 On-chip Flash Program Memory with In-System Programming (ISP) and In Application
Programming (IAP) capability.
 Boot ROM contains low level Flash programming routines for downloading code via the
RS232.
 Flash memory reliably stores program code even after 10,000 erase and program cycles.
 10-year minimum data retention.
 Programmable security for the code in the Flash. The security feature protects against
software piracy and prevents the contents of the Flash from being read.
 4 level priority interrupt & 7 interrupt sources.
 32 general purpose I/O pins connected to 10pins header connectors for easy I/O pins
access.
 Full-duplex enhanced UART – Framing error detection Automatic address recognition.
 Programmable Counter Array (PCA) & Pulse Width Modulation (PWM).
 Three 16-bits timer/event counters.
 AC/DC (9~12V) power supply – easily available from wall socket power adapter.
 On board stabilized +5Vdc for other external interface circuit power supply.
 Included 8x LEDs and pushbuttons test board (free with HT-MC-02 while stock last) for fast
simple code testing.
 Industrial popular window Keil C compiler and assembler included (Eval. version).
 Free Flash Magic Windows software for easy program code down loading.

PLEASE READ HT-MC-02 GETTING STARTED MANUAL BEFORE OPERATE THIS BOARD
INSTALL ACROBAT READER (AcrobatReader705 Application) TO OPEN AND PRINT ALL DOCUMENTS

HandsOn Technology is a manufacturer of high
quality educational and professional electronics
kits and modules, uController
development/evaluation boards. Inside you will
find Electronic Kits and fully assembled and tested
Modules for all skill levels. Please check back with
us regularly as we will be adding many new kits
and products to the site in the near future.
Do you want to stay up to date with electronics
and computer technology? Always looking for
useful hints, tips and interesting offers?
http://www.handsontec.com
Inspiration and goals...
HandsOn Technology provides a multimedia and
interactive platform for everyone interested in
electronics. From beginner to diehard, from student to
lecturer... Information, education, inspiration and
entertainment. Analog and digital; practical and
theoretical; software and hardware...
HandsOn Technology provides Designs, ideas and
solutions for today's engineers and electronics
hobbyists.
Creativity for tomorrow's better living...
HandsOn Technology believes everyone should have the tools, hardware, and resources to play
with cool electronic gadgetry. HandsOn Technology's goal is to get our " hands On" current
technology and information and pass it on to you! We set out to make finding the parts and
information you need easier, more intuitive, and affordable so you can create your awesome
projects. By getting technology in your hands, we think everyone is better off
We here at HandsOn like to think that we exist in the same group as our customers >> curious
students, engineers, prototypers, and hobbyists who love to create and share. We are
snowboarders and rock-climbers, painters and musicians, engineers and writers - but we all have
one thing in common...we love electronics! We want to use electronics to make art projects,
gadgets, and robots. We live, eat, and breathe this stuff!!
If you have more questions, go ahead and poke around the website, or send an email to
[email protected]. And as always, feel free to let your geek shine - around here, we encourage
it...

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close