Thinking From the Box

A Simple Low-End PC Project

Roger M - 2002.06.26

These days, 286 and 386 computers can be obtained for $10 or less - and often at no cost. This makes them ideal for dedicated service. With just DOS and BASIC on your computer, the possibilities are almost endless. (BASIC comes with almost any version of DOS, or can be found on older PCs, or on many Windows CDs.)

What can you do? How about turning your computer into a $30 home security system? One that will not only sound an alarm, but will tell you which door or window has been opened and when it was opened (or even how many times is was opened). You can do this even if you have limited technical knowledge. All that is required is a PC and keyboard, a few standard burglar alarm switches, and a few lines of BASIC.

To start with, get an old or cheap keyboard (you'll also need a working one to program your computer). Take it apart. Usually you can just pull an individual key out, but you may have to break the keyboard open. In either case, look for the keyboard circuit board and the electric contacts. You can then wire/solder remote switches (as used on burglar alarms) across an individual key's contact. Place the switches at doors or windows, and wire them back to your keyboard, so that when the door is opened, contact is made at the keyboard.

Then you can program your computer in BASIC to sound an alarm when a switch is broken. In fact, you can program the computer to indicate which switch has been broken (i.e., which window was opened), what time it occurred, and sound an alarm. The BASIC program is quite simple. Say the "D" key is tied to the switch at the front door:

note: This is written for GW-BASIC found on mid- to late 1980s PCs.

10 A$=INPUT

[This makes the variable A$ equal to whatever key that is closed]

20 IF A$= "D" THEN PRINT "FRONT DOOR OPENED" : PRINT TIME$: SOUND 200, 1800

[This tells the computer that if the D key has made contact, print on the screen "FRONT DOOR OPENED" and print the time it was opened, and issue a warning sound of 200 Hz for about 10 minutes]

100 GO TO 10

[Return to line 10 to keep scanning keyboard]

Take note that line 20 is just one command for one key. Many such lines can be written, one for each key that you have wired a switch to. You could also have the computer monitor how many times the door has been opened, to indicate how many people came in or out of your house or building.LEPC

Join us on Facebook, follow us on Twitter, or read Low End Mac's RSS news feed

Recent Content

Go to our home page for a listing of recent content.

About Low End PC Support Usage Privacy Contact

Custom Search

Share

Follow Low End PC on Twitter
Join Low End PC on Facebook

Favorite Sites

MacWindows
Deal Brothers
DealMac

Affiliates

Amazon.com
The iTunes Store
PC Connection Express
Parallels Desktop for Mac
eBay

Advertise

Open Link