11.07.2015 Views

Handic VIC-REL Manual - Bombjack.org

Handic VIC-REL Manual - Bombjack.org

Handic VIC-REL Manual - Bombjack.org

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In gene ral<strong>VIC</strong>·<strong>REL</strong>A Y ·CASSETTEThe purpose ol lhis cossette is 10 simplify conlrol of, fo r example, burglaralarms, garage doors, doorlocks. healing elements, lomps. tra nsmitters,remote controllers, valves. pumps, telephones, accumulators. irrigolionsystems, electricol too ls, slo p walches, ventila tors, hum id ifiers, etc, etc.The cossette conta ins 6 re lo y outpu ts, and 2 inpuls of type o ptacoup le r.ConnectionTh is cassette is connected 10 <strong>VIC</strong>-USER-PORT (on Ihe BACK 10 the LEfT).Turn Ihe cossette so tha I Ihe le.-I and the lights face upwards. The greensocke t is connected to the <strong>VIC</strong>. The Red lig ht indicates tho t Ihe inlets 1-6ore octiva ted (closed ). The Green light indica tes Ihol Ihe inlets 1-2 oreoctivated (5-12v DC connected).In and outputsOutputs: 1- 6.Connections 1- 12 are connected in pairs to a re lay in the <strong>VIC</strong> <strong>REL</strong>AY.FIG· l .\RE; AY?oI"~AY/o~ , Connection 10Connection 2I0 , Connection 30Connection 4IThese OUT puts ore galvanically separa ted fr om the <strong>VIC</strong>.If the Red light (1) is lit this indicates thaI the socket on re lay (1) is connected,that is to soy 1-2 a re contacted with each o ther. As a result of this if thesome light is nat lit, there is no connectio n between 1-2.A re la y is simply a switch which can be programmed by the <strong>VIC</strong> to sw itc h onand off.IN PU TS 1- 2Or connections 17-18 19- 20.These constist of two optocouplers, indicating that when the re is 5-1 2v DCconnected by you to some o ther machine the Green light is lit. The samehappens with the optocoupler. The light is caught by 0 light sensi tivetransistor which then informs the <strong>VIC</strong> that one of the inpu ts has beenconnected to 5-12v DC. This is to ensure that a ll your connections to the<strong>VIC</strong>·userport a re isolated.FIG·2. <strong>VIC</strong>·<strong>REL</strong>A YIYo ur con nec tion.\Output +5v DC -(+) _ Connection 14 >o utput -5v DEt=C- (-J-t Connection 15 -.--]-SI:::-tOPTO. III I-I-j Co""eol,oo 17 cop L,. 1 _ (+)-0 Connectio n 18 __ < ____---'0\IO nl off SWITCH


PROGRAMMINGInilio l ion, i.e. the prog ramming of the different connections all <strong>VIC</strong>'s user ­porI wh ich should be inle ts ond outle ts respecti ve ly. is do ne by using asimple command.poke 37138 ,63Thi s puIs p ins 1- 6 as outputs a nd pins 7 -8 os inputs. (se <strong>VIC</strong> programmingmanua l).Thi s command should a lways be first in your program.Now everything is ready fo r a short test program. Write the f o llowing o nyour <strong>VIC</strong>.10 reg=3713820 poke reg,6330 poke dot , 140 poke dot ,250 poke dot ,460 poke dot ,870 po ke dot ,1680 poke dot ,3290 enddot 0:037136gosu b 100gosub 100gosub 100gosub 100gosub 100gosub 100gosub 100rem datarem initia ting the il orem switch on lomp (1 )rem switch on lamp (2)rem swit ch on lamp (3)rem switch on lomp (4)rem switch on lamp (5)rem switch on lamp (6)100 for t = 1 to 700 : ne xt :return : rem wait (loop)If everything isa ll right, a ll the red lig hts should be lit and a ll outputs closed.As you will see in the example above, every re lay has its own nu mber.FIG -3.<strong>REL</strong>AYCONNECTIO N1 1-22 3-43 5-64 7-85 9-106 11-12PO KE - DATA12481632St udy these fi gures very carefully.FI G -4.<strong>REL</strong> AYON1 0' 12 OR23 0"4 OR85 0.166 0' 32O FFAND(63- 1)AND(63-2)AND(63-4)AND(63-8)AND(63-16)AND(63- 32)If relay-2 has to be clo sed (1) You have to write:poke(37136), peek(37136} or 2If re loy-2 has to be opened (O) You have to write:poke(37136},peek(37136} and (63-2)W hat happens next is the fo ll owing, <strong>VIC</strong> reads the register as it exists a tPEEK (371 36) then we perform a logical operation 'O R' with '2" (data to2


elay two is added to CXI~ t l l1g data). You can ge t further explanation aboutthe OR hmctlon ill your <strong>VIC</strong> manua l. As you will be reodmg about the ORfunction, why not ta~e the opportlty to reod about the AND function also.H you wont to resel all the re lays, jusl write: POKE 37 136,0Bullf you only wont 10 reset a particular relay and leoye Ihe others in theiractual stale (see fig-4 and) write:POKE 37163,PEEK(37163) AN D 8In this case only relay no. 4 will be rese!. (poke data for re lay no. 4 = 8.(see fig·3).All the numbers which you wrile on the sc reen are in decimal. These arethen interpreted by the <strong>VIC</strong> as hexadecima l or binary num bers.Vi c's user-port is a register containing 8 bits (l byte).OK! With this m mind we 'lI have a look at the conyer/ion table:FIG-5,DECIMAL HEXADECIMAL BINARY1 01 0000 00012 02 0000 00103 03 0000 001 1• O' 0000 01005 05 0000 01016 06 0000 01107 07 0000 01118 08 0000 10009 09 0000 100110 OA 0000 101011 08 0000 101112 OC 0000 110013 OD 0000 110114 OE 0000 111015 OF 0000 11 1116 10 0001 000017 11 0001 0001 Etc.Let us return to the first example. You switch on relay (1) with the code1 or 0000 0001 (as the VI C sees it). This data is placed in Ihe reg ister whichcorrespondens 10 the <strong>VIC</strong>'s user·porl. A close up: N OTE reversed data!!FI G-6.o 0 0 o, , , , ,E E E E El l l l lA A A A AY Y Y Y Y2 3•5o o o, I IE N Nl P PA U UY T T6 2<strong>VIC</strong> USER ·PORTWITH DATA.10000000 = POKE DATA 1(poke dot, 1).3


HOW TO READ THE INPUTSTo read input no. 1PRINT PEEK(37136) AND 64If the answer = 0 then input one is active. (17-18 conneeled to 5-12v DC)All other answers mean thot input one IS not active (Without 5-12v DC).The some goes for mpullwo e)(cepl lor the 'A ND dolo.PRINT PEEK(37136) AND 128NOTE! 128 for input two. See following example:When Input- l has 5-12 ... (1), then "peek(37136) ond 64" 0When inpul-l loses 5-12 ... (0), then "peek(37136) ond 64" 64When input-2 has 5-12 ... (I), then " peek(37136) and 128" = 0When mput-2 loses 5-12 ... (0), then "peek(37136) and 128" 128let's soy thai the button on your front door (door bell) is connected toconnections 19 and 20 (inpul-2J. When someone presses iI, the molor 10 theautomatic door-opener storts up (connected vio 0 power reloy to output·I). When the door is fully open, it presses a button which is connected toinput-1 that switches off the motor and waits a few seconds beforeswitching on the light in the hall (connected via a power relay to output-2).And lastly, the motorfor closing the door, motor two which is connected tooutput-3, starts up.FIG-7.3,>-->----jlamp 1920>--


NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!!Plea 5e Note! That the re lays wh ich are found in the <strong>VIC</strong>-I/ O can only toke 0mox. of 24 vo lt5 10 watts and that the circuit in the <strong>VIC</strong>-I/O is nat designedfor the intended load (current) wh ich may be needed fo r the motors andlamps. That is why it·s recommended that one or more POWER <strong>REL</strong>AYS beinstol led by on electrician. To make <strong>VIC</strong> see input 1 and 2you must activatethem by opplying 5- 12v DC. Th is you moy toke from connection 14 whichis (+ 5v) a nd connection 15 wh ich is (-5v). Please note! MAXIMUM LOAD is50 mA. This power is connected in series with some kind of switch , which wi llactivate the in puts. NOTE! Moke connectio ns (- ) minus to minus, and (+)plus to plus.look at bottom of first poge for correct wireing.Next poge conta ins the beginning of fu ture experi ments, here you migh tdra w you r own diagrams to v IC- <strong>REL</strong>. GOOD LUCK! .<strong>VIC</strong> <strong>REL</strong> and CBM 64Address 37136 is changed to 565 77Address 37138 is changed to 565 795


<strong>VIC</strong>-<strong>REL</strong>AY-CONNECTION SOBJECT,DATE,OUTPUT -1I•- -I-1 • 2IOUTPUT -2 • 3- I- -2 • ,IOUTPUT -3 • 5- - -3I• 6IOUTPUT -, • 7I- - -, • 8IOUTPUT -5 • 9I- - -5 • 10IOUTPUT -6 • 11- -I-6 • 12IN .C. •ID C. (+ 5v.) • 14IDC. (-5v.) • 15IN,C- •INPUT-1 1-1 • I17I-"--1 )+) 18 •IINPUT-2 1-1 • 19I-"--2 )+) •I 20 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!