Silicon ChipExperiments For Your Games Card - January 1992 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Appliance safety is a concern
  4. Feature: The Story Of Electrical Energy; Pt.17 by Bryan Maher
  5. Project: Build A 4-Channel Guitar Mixer by Darren Yates
  6. Project: Automatic Controller For Car Headlights by Wally Hammer & Jeff Monegal
  7. Serviceman's Log: Same set, same symptoms, but... by The TV Serviceman
  8. Feature: Computer Bits by Jennifer Bonnitcha
  9. Feature: Experiments For Your Games Card by Darren Yates
  10. Project: Baby Room Monitor & FM Transmitter by John Clarke
  11. Vintage Radio: Restoring an AWA Radiolette receiver by John Hill
  12. Project: Adjustable 0-45V 8A Power Supply, Pt.1 by John Clarke
  13. Feature: Amateur Radio by Garry Cratt, VK2YBX
  14. Feature: Remote Control by Bob Young
  15. Order Form
  16. Feature: New Blood Steriliser Uses Microwaves by Leo Simpson
  17. Market Centre
  18. Advertising Index
  19. Outer Back Cover

This is only a preview of the January 1992 issue of Silicon Chip.

You can view 43 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • The Technology Letters, Pt.2 (January 1989)
  • The Technology Letters, Pt.2 (January 1989)
  • The Story Of Electrical Energy (July 1990)
  • The Story Of Electrical Energy (July 1990)
  • The Story Of Electrical Energy; Pt.2 (August 1990)
  • The Story Of Electrical Energy; Pt.2 (August 1990)
  • The Story Of Electrical Energy; Pt.3 (September 1990)
  • The Story Of Electrical Energy; Pt.3 (September 1990)
  • The Story Of Electrical Energy; Pt.4 (October 1990)
  • The Story Of Electrical Energy; Pt.4 (October 1990)
  • The Story Of Electrical Energy; Pt.5 (November 1990)
  • The Story Of Electrical Energy; Pt.5 (November 1990)
  • The Story Of Electrical Energy; Pt.6 (December 1990)
  • The Story Of Electrical Energy; Pt.6 (December 1990)
  • The Story Of Electrical Energy; Pt.7 (January 1991)
  • The Story Of Electrical Energy; Pt.7 (January 1991)
  • The Story Of Electrical Energy; Pt.8 (February 1991)
  • The Story Of Electrical Energy; Pt.8 (February 1991)
  • The Story Of Electrical Energy; Pt.9 (March 1991)
  • The Story Of Electrical Energy; Pt.9 (March 1991)
  • The Story Of Electrical Energy; Pt.10 (May 1991)
  • The Story Of Electrical Energy; Pt.10 (May 1991)
  • The Story Of Electrical Energy; Pt.11 (July 1991)
  • The Story Of Electrical Energy; Pt.11 (July 1991)
  • The Story Of Electrical Energy; Pt.12 (August 1991)
  • The Story Of Electrical Energy; Pt.12 (August 1991)
  • The Story Of Electrical Energy; Pt.13 (September 1991)
  • The Story Of Electrical Energy; Pt.13 (September 1991)
  • The Story Of Electrical Energy; Pt.14 (October 1991)
  • The Story Of Electrical Energy; Pt.14 (October 1991)
  • The Story Of Electrical Energy; Pt.15 (November 1991)
  • The Story Of Electrical Energy; Pt.15 (November 1991)
  • The Story Of Electrical Energy; Pt.16 (December 1991)
  • The Story Of Electrical Energy; Pt.16 (December 1991)
  • The Story Of Electrical Energy; Pt.17 (January 1992)
  • The Story Of Electrical Energy; Pt.17 (January 1992)
  • The Story Of Electrical Energy; Pt.18 (March 1992)
  • The Story Of Electrical Energy; Pt.18 (March 1992)
  • The Story Of Electrical Energy; Pt.19 (August 1992)
  • The Story Of Electrical Energy; Pt.19 (August 1992)
  • The Story of Electrical Energy; Pt.20 (September 1992)
  • The Story of Electrical Energy; Pt.20 (September 1992)
  • The Story Of Electrical Energy; Pt.21 (November 1992)
  • The Story Of Electrical Energy; Pt.21 (November 1992)
  • The Story Of Electrical Energy; Pt.22 (January 1993)
  • The Story Of Electrical Energy; Pt.22 (January 1993)
  • The Story of Electrical Energy (April 1993)
  • The Story of Electrical Energy (April 1993)
  • The Story Of Electrical Energy; Pt.24 (May 1993)
  • The Story Of Electrical Energy; Pt.24 (May 1993)
  • The Story Of Electrical Energy; Pt.24 (June 1993)
  • The Story Of Electrical Energy; Pt.24 (June 1993)
Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
  • Control Your World Using Linux (July 2011)
Items relevant to "Experiments For Your Games Card":
  • Games Card Breakout PCB [07103941] (PCB Pattern, Free)
Articles in this series:
  • Experiments For Your Games Card (January 1992)
  • Experiments For Your Games Card (January 1992)
  • Computer Bits (November 1993)
  • Computer Bits (November 1993)
  • Computer Bits (January 1994)
  • Computer Bits (January 1994)
  • Computer Bits (February 1994)
  • Computer Bits (February 1994)
  • Computer Bits (April 1994)
  • Computer Bits (April 1994)
Articles in this series:
  • Adjustable 0-45V 8A Power Supply, Pt.1 (January 1992)
  • Adjustable 0-45V 8A Power Supply, Pt.1 (January 1992)
  • Adjustable 0-45V 8A Power Supply, Pt.2 (February 1992)
  • Adjustable 0-45V 8A Power Supply, Pt.2 (February 1992)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Articles in this series:
  • Remote Control (December 1991)
  • Remote Control (December 1991)
  • Remote Control (January 1992)
  • Remote Control (January 1992)
  • Designing A Speed Controller For Electric Models (February 1992)
  • Designing A Speed Controller For Electric Models (February 1992)
  • Remote Control (March 1992)
  • Remote Control (March 1992)
~ COMPUTER EXPERIMENTS =INJ#- By DARREN YATES Experiments for your games card You may not have realised it but you can do much more with your PC's game card than just play games. In this article, we'll show you how you can use it to detect various inputs and provide a few GWBASIC routines so that you can start experimenting. If you have a good look at the computer adverts in SILICON CHIP, you will notice that there are all manner of plug-in cards available that you can install in your PC to make it do just about anything. There are clock cards, memory cards, video driver cards, I/O cards and diagnostic cards, plus a host of others. There are even cards that will allow your computer to act as a facsimile machine. However, many people think of the humble games card as a "keep the kids happy" item. That's little unfair because, for just $30 or less, a games card can be a very cheap alter- a native to some of the dedicated input cards currently available. A typical example of the current generation of games cards is the one on offer from Rod Irving Electronics. It sells for just $29 and has inputs for two joysticks via DB15 sockets. It's also easy to install-you just whip the top off your computer and plug it into one of the expansion ports on the motherboard. Let's see what's involved in using one of these cards. SILICON CHIP +5V X·PLANE CONTROL OF~,__._.. JOYSTICK 2.2k TRIGGER 1/41558 OUTPUT Card circuitry The games card contains four !Cs, a handful of passive components and little else. Our main centre of interest on !' the board is an NE558 quad timer IC, which is basically four inde- This games control card is available from Rod Irving Electronics & sells for just $29. It plugs into an expansion slot on the motherboard & has inputs for two joysticks via DB15 sockets. 42 pendent 555 timers in the one package. This IC interfaces to the joystick controls, while the rest of the card can be accessed only by the computer. Fig.1 shows a partial circuit diagram of the NE558 quad timer IC circuitry. In reality, this part of the circuit is replicated four times to cover the controls in both joysticks, so we'll just look at one section. If we take a look at the average joystick, it contains two variable resistors (potentiometers) and a couple of switches. The two potentiometers Fig.1: the input control circuitry for the games card. There are four such circuits to cover all the controls on the joysticks. take care of direction, one in the xplane and the other in the y-plane. The two pushbutton switches, which most joysticks have, allow us to blow F18s out of the sky and other things. We can use these inputs too, as we shall explain shortly. By moving the joystick around, we move the wipers of the potentiometers and thus change their resistance values. As shown in Fig.1, each potentiometer forms an RC time constant with a 2.ZkQ resistor and a .0lµF capacitor, and so this time constant X s1 I ( tlV_I_ \ • 1 2 \ \._ 9 _ +SV s21 lL 3 I10 __ GJ!D_ G_!!!I_ 4 ,5 11 _ X L-I- - -., 6 12 __ 13_ GND S41 Y 7 I14- 08 I 01:.;' S31 y Fig.2: the pinout details for the DB15 sockets on the card. The joystick potentiometers can be replaced with resistive sensors, while the switches can be replaced with relay contacts. varies according to the resistance of the control. In normal operation, the computer sends a signal to the trigger input of the 558 timer and the capacitor charges up via the joystick pot and the 2.2kQ resistor. During this time, the computer clocks an 8-bit counter. When the capacitor voltage reaches the threshold voltage, the output of the timer changes state and the computer stops counting. The value in the counter when it finishes counting is available in a register and we can access this number using a couple of simple GWBASIC commands. Obviously, the larger the value set by the potentiometer, the longer it take for the .0lµF capacitor to charge up and the larger the value in the counter. This gives us a type of analog to digital (AID) converter. In fact, it is really a resistance to digital converter since it is the resistance, and not voltage, that is changing. larly, one side of each of the switch inputs is connected to the circuit ground. This is all the information we need to adapt the card for other applications. In fact, we can replace the joystick with just about any resistancevarying device we choose and we will give you a few examples. Temperature measurement If we replace the joystick with a thermistor, we can produce a very simple but effective thermometer. Fig.3 shows the circuit diagram for this. You simply connect the thermistor leads to pins 1 & 3 of the DB15 socket. Now isn't that easy? The circuit works because the resistance of the thermistor changes with temperature, which also changes the time constant of the timer circuit. Thus, the value in the counter will be proportional to the temperature. The small BASIC routine in Listing 1 prints the value on the screen. The STICK(0) functi_on in GWBASIC returns the counter value for the x-plane controller of the first joystick, which is where our thermistor is located. This program is quite small since it just gives an on-screen reading, but could easily be expanded to record temperature over time, save data to disc, or do other jobs. Light measurement By using a light dependent resistor PIN1-----. TH1 NTC 0815 SOCKET Fig.3: the replacing one of the joystick controls with a thermistor, we have a simple thermometer. The small BASIC routine in Listing 1 prints the value on the screen. PIN1-----~ L0R1 0815 ORP12 SOCKET PIN6 osi~o1 (0SE CAT Z-4801 Fig.4: by using an LDR instead of a thermistor, we can monitor changes in light level. (LDR) instead of a thermistor, we can measure changes in light level. Fig.4 shows the circuit details. Note that, this time, the sensor has been connected between pins 1 & 6 (ie, to the y-plane input). If you now look at the program shown in Listing 2, you can see that it is identical in structure to Listing 1 except that the STICK(0) statement has become STICK(l). The program thus looks at the y-plane control of the joystick where our LDR is located. You could use this simple set-up to monitor light levels in a greenhouse or for any other application where LISTING 1 - TEMPERATURE MEASUREMENT PROGRAM 10 REM Temperature Measurement 20 REM copyright 1991 SILICON CHIP magazine 30 CLS: KEY OFF 40 LOCATE 1,26:PRlNT"SILICON CHIP THERMOMETER" 50 T =STICK(0) 60 LOCATE 3,30: PRINT"Temperature = "; 70 PRINTT 80 GOTO 50 DB15 sockets The pinout diagram for the DB15 sockets on the card is shown in Fig.2. Pins 1 & 9 are the +5V supply pins which we can use to power our projects, provided we only draw low currents. Pins 4, 5 & 12 are the ground pins. As we can see in Fig.1, because one side of each pot is tied to the +5V supply rail, the number of input connections required is reduced. Simi- LISTING 2 - LIGHT MEASUREMENT PROGRAM 10 REM Light Measurement 20 REM copyright 1991 SILICON CHIP magazine 30 CLS: KEY OFF 40 LOCATE 1,26:PRINT"SILICON CHIP LIGHTMETER" 50 T =STICK(1) 60 LOCATE 3,30: PRINT"Light Reading = "; 70 PRINTT 80 GOTO 50 JANUARY 1992 43 Experiments for your games card 0B15 SOCKET TD GAMES CARD PIN 1 0 - - - - - - - - , PIN 2 LDR1 DRP12 SECTOR 0 PIN 3. ,-_---,0---- - PIN 6,0--+-- ---, SECTOR 1 PIN 110-- MINI REED SWITCH (DSE CAT P-7 856) SECTOR 4 RS1 SECTOR 6 RS3 LDR2 DRP12 + -- Fig.5: these sensors & the program shown in Listing 3 can be combined with the games card to produce a simple 8sector burglar alarm. The reed switches can be used to monitor doors & windows, while the LDRs monitor light level changes. The thermistor can be used as a fire monitor. ----, SECTOR 2 PIN 1 3 n - - - + - - - ~ SECTOR 3 house burglar alarm TH1 NTC SECTOR 7 RS4 measurements of light level are necessary. The beauty of this system is that we require next to no hardware at all apart from some wire, an LDR and a DB15 male plug. Home burglar alarm We can now expand on the ideas presented so far and make an 8-sector house alarm. The games card has eight inputs altogether: the four variable resistor control inputs plus the four switch inputs. We haven't used the switch inputs before but again these are very easy to use. The switch inputs can only detect two states - ie, open and closed - and so they are ideal for relays, pushbut- ton switches, reed switches, etc. The circuit diagram for the house alarm is shown in Fig.5. It contains three LDRs, four reed relay switches and one thermistor input, all of which are connected to a single DB15 connector. The reed relay switches replace the joystick buttons and can be used to monitor windows or doors; one section has a small magnet while the other section contains the relay. When the window is lifted, the relay opens and it's then simply a matter of using a suitable GWBASIC program to detect this happening. The LDRs detect light level changes, while the thermistor detects changes in temperature (eg, due to a fire) . Note that we're not interested in the exact values here - just detecting a change is good enough! Listing 3 shows the BASIC program for the house alarm. If we go through it, the program proper begins at line 50. Now if we look at the circuit diagram, we can see that each sensor has LISTING 3 - HOUSE ALARM PROGRAM 1O REM House Alarm Project 20 REM copyright 1991 SILICON CHIP magazine 30 CLS: KEY OFF: DIM A(?) 40 LOCATE 1,2'7 :PRINT"SILICON CHIP HOUSE ALARM" 50 FOR NUMBER = 0 TO 3 60 VSECJOR(NUMBER)=STICK(NUMBER) 70 SSECTOR(NUMBER)=STRIG(NUMBER*2) 80 IF ABS(OLDVSECTOR(NUMBER)-VSECTOR(NUMBER})>4 THEN PRINT TIME$": Sector"NUMBER"alarm .... " 90 IF SSECTOR(NUMBER)=-1 T_HEN PRINT TIME$": Sector"NUMBER+4"alarm .... " 100 OLDVSECTOR(NUMBER)=VSECTOR(NUMBER) 110 NEXT NUMBER 120 GOTO 50 44 SILICON CHIP been given a sector number. Lines 60 and 70 allow the computer to check all of the inputs; ie, the four switches and the four directional control inputs. The variable VSECTOR contains the count for each of the four sensors and these are obtained by using the STICK(x) statement, where "x" represents the sector number. GWBASIC also has a very useful function called STRIG which allows us to check if a particular button has been pressed at any time since we last looked at it. If it has, the function returns a value of " -1 ", otherwise it is "0". Line 90 checks this and prints out an alarm message, along with the time at which it occurred. STRIG statement The reason for the STRIG(NUMBER * 2) argument is that we are only interested in looking at the STRIG(0), STRIG(2), STRIG(4) and STRIG(6) arguments. If you have a GWBASIC manual, you may like to look this up for yourself. Line 80 checks to see if there is a difference of 5 or more in the last two readings from the variable sensors. If there is, it prints the alarm message. Note that because the sensor resistance values can vary widely, the counter can cycle from 0 to its maximum count of 255 a number of times. This can cause false alarm messages in some circumstances if the counter stops near its maximum ·or minimum count. For example, if the counter stops on 255 on one cycle and on 0 the next, a false alarm message will be printed even though there is only a difference of one count. This problem could be solved with fancier software. The program continually loops through each sensor until we press "control-break". Conclusion Although this has only been a brief introduction and the examples we have given are only very simple, it should whet your appetite and encourage you to experiment. There are many other possible project ideas if you are prepared to use more hardware and spend some time writing the software. It's all up to your imagination. SC