Zoomkat's "El Cheapo" Parallel Port Contact/Switch Monitor

December 26, 2003

Updated November 20, 2004

Zoomkat's home page

Homemade web controlled parallel port contact/switch monitor. The schematic below shows how to wire up the data and status pins of the parallel port. Use the below batch file and qbasic file in the apache cgi-bin folder along with a copy of qbasic.exe. Get the status.bas file here and open it with notepad to see what is in it. A helper application called userport.zip available here will be needed to allow user level use of the parallel port with Windows NT/2K/XP (the userport defaults will open LPT 1 port 378). Also get wnpar011.zip here to help with setup and testing. It shows real time what is going on with the parallel port pins and allows you to easily control them for testing the below gizmo. Nothing is guaranteed about this (but mine works), so you will have to experiment like I have. YMMV!!!

NEW 11/20/2004: If for some reason you don't want to use qbasic, I've put a zoomkat-lpt.txt text file here showing how to make and use some simple assembly applications to write to and read from the parallel port. This incluses the setup to have web based control the same as using the qbasic on this page. I've also included some batch files that use debug.exe (included with all windows) to access the parallel port.

Demo page (as of 12/26/03) here that uses qbasic. Demo page (as of 11/20/04) here that uses the new assembly applications to access the parallel port, and a demo page (as of 11/20/04) here that uses debug.exe to acess the parallel port.

== status.bat to run the status.bas file===

@echo off
qbasic.exe /run status.bas
cls

==========================================

The Radio Shack parts (catalog prices, in store may be a little higher):

parallel port connector ($1.69, 276-1547)
plastic hood for the connector ($1.69, 276-1549)
4 conductor phone wire (20', $3.00, 278-1310)
4 NPN transistors (15 for $2.49, 276-1617)
4 4.7k resistors ($1.00, 271-1330)
4 330 ohm resistors ($1.00, 271-1315)
12 diodes ($2.49, 276-1620)
small mounting board ($1.29, 276-149)

Place the status.bat file, the qbasic status.bas file, and qbasic.exe in the server cgi or cgi-bin folder (I use the ivista web server module), and make a link to the batch file.

The parallel port contact/switch monitor board:

The basic parallel port contact/switch monitor schematic:

Counter