Zoomkat's "El Cheapo" Parallel Port Video/Audio Switcher

April 11, 2002

Updated May 29, 2004

Zoomkat's home page

New 5/29/04, make your own inexpensive (~$16) servo controller for use with a homemade pan/tilt webcam here.

New 1/19/03: See the "El Cheapo #2" parallel port audio/video switcher version here.

New 2/11/03: See the "El Cheapo #3" parallel port audio/video switcher version (up to 40 cams) here. This page also has a schematic that shows the resistor/transistor setup maybe a little better than the one below.

Two new (1/3/04) parallel port pages that might also be of interest. Individually control up to 120 different things (including switching webcams) via the parallel port here. Also using the parallel port to monitor contact/switch status here.

Homemade web controlled parallel port video switcher made from Radio shack parts I use with the Ivista webcam software (check ebay for surplus 3.1 version, or 60 day demo via www.techtv.com). This one is set up for 3 cam video/audios in and one out to capture card and audio card. The schematic shows for one parallel pin to switch a cam video/audio on/off using 2 resistors and 2 transistors. The combined output of 3 of these are connected at the video out and audio out RCA connectors for single seperate outputs to the video and audio cards. Only one parallel port pin is made high at a time using the below batch file so the video/audio signals don't interfer with each other. The same setup should be able to switch up to 8 video/audio inputs (using 74HTC259 chips ($1.29, 275-2868), you could switch 16, 32, etc cams). Use one of the below batch file in the ivista webcam cgi folder to make the parallel port pins switch cams. A helper application called userport.zip available here will be needed to allow user level use of the parallel port with NT/2k/xp (the userport defaults will open LPT 1 port 378). If you don't want or need web control and just want to switch the cams locally from your desktop, then just put the batch files (or shortcuts to them) on the desktop. Double clicking the files/shortcuts will switch the cams. Nothing is guaranteed about this (but mine works), so you will have to experiment like I have. YMMV!!! Below are sources of the software and some additional info on the setup.

Demo page (as of 4/10/02) here

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 (12', $1.80, 278-1310)
6 NPN transistors (15 for $2.49, 276-1617)
3 4.7k resistors ($1.00, 271-1330) for the video transistor
3 10k resistors ($1.00, 271-1335) for the audio transistor
small mounting board ($1.29, 276-150)
8 RCA connector mount ($2.29, 274-374)
stereo patch cable ($4.99, 42-2351)
RCA to 1/8" stereo jack adapter ($2.49, 274-378) Total: ~$21.00

Info sites:
Webcam switcher Demo
Other Windows and Dos software: http://www.kitsrus.com/zip/k74disk.zip
A similar setup: http://www.kitsrus.com/pdf/k74.pdf
Extra info: http://www.armory.com/~rstevew/Public/LPT/parallel.gif
Extra info: http://www.mattjustice.com/parport/
Zoomkat's home page

The basic how-to-do:

1). Get the parts and build the hardware. The parallel switcher is a simple one transistor/resistor per cam video/audio switched. If you use the generic NPN radio shack transistors, lay one down with the flat side down and the 3 leads sticking out to the left. To the center pin, you connect a 4.7k resistor for video (a 10k for audio). The other side of the resistor is connected to the parallel port pin wire. The top transistor lead is connected to the center of the RCA connector comming from the cam video (audio), and the bottom lead is connected to the center of the RCA connector going to the video capture device (audio card line in). All the bottom wires of the video (audio) transistors are connected together and connected to the video (audio) out center pin of the RCA connector. All the grounds (RCA plug outside) are connected together, keeping audio and video seperated. Note that there are no connections made to the ground side of the parallel port connector (that would ground out the video and audio). For audio and video from a cam, you make two transistor setups that operate as a pair. The resistors for each are both connected to the same parallel port pin so they operate at the same time. Place the below batch files on the desktop and double click them to check out the operation of the parallel pins. Debug.exe can also be used to check/switch the status of the parallel port pins. Type debug in the run box and hit enter. When the dos box opens up, type ? and hit enter. The -i (- i 378) and -o (-o 378 01) are used to read/control the pins. The pins are addressed in the below batch files using the hex value for the desired pin. You would use -o 378 00 for all pins off, 01 for pin #2 on, 02 for pin #3 on, 04 for pin #4 on, 08 for pin #5 on, 10 for pin #6 on, 20 for pin #7 on, 40 for pin #8 on, and 80 for pin #9 on. The bebug batch file works in XP pro when userport is run to open the port. The out.com file works in win 95/98 nativly, and XP with userport opening the ports

2). load the ivista webcam software on your computer. Put a copy of batch files for the parallel port pins in the ivista cgi folder. Make copys of "zoomkat's amazing batch file" for each parallel port pin you want to control. Copy the below example and paste in notepad. Modify for the lpt port and pin you want it to control. Place them in the ivista cgi folder.

3). Make a webpage to access your video/audio feed and have webcam remote control. You can go to the above demo page, click on view source, copy the source, and paste in notepad. Modify for your IP address and control links, and save as an .htm file. Place in your ivista webcast folder, or place on another web server.

4). To run the batch files in the ivista cgi folder, make a link to them like below. The batch file is coded to tell the client brouser to not update its current web page, so the video feed won't be interupted when the control link is clicked.

http://zoomkat.d2g.com/cgi/pin2.bat

5). Have fun! Also see Zoomkat's home page for info on how to pan/tilt your web cams.

== zoomkat's amazing batch file (name it pin2.bat for lpt1, pin 2 on)========

@echo off
echo status: 204 zoomkat's amazing batch file
echo.
echo.
GOTO BEGIN
o 378 01
G
:BEGIN
DEBUG < pin2.bat

===========end debug based batch file===========

The below batch file will make a program called out.com (by Herbert Kleebauer) when run. Copy the below batch file, paste in notepad, save on the desk top as out.bat. Double click on out.bat and the out.com file will appear. out.com can be used in win95/98 to conrol the parallel port as is. Use with userport in XP to control the port. The command line out.com 00 378 sets port 378 to 00. Substitute the desired hex numbers for 00 to make the desired parallel port pin +5v. ***Watch for word wrap***. There are 7 lines, with the the long ones starting with echo and ending with out.com. When you copy/paste, make sure it looks as described or adjust as necessary.

=========out.bat file to make the out.com file for win 95/98 use================

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>out.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>out.com
echo ?@}IIHpkg~K=H?H_CgRNWH?wpBmNEFQNS@CbwH@S?pkoECIQ{_K?\qoCve>>out.com
echo {Sx{X?{Eu@Pq`Dkfk?a@o{A@CoCEFr@B@K~Tj~@CeK??BB0>>out.com
out.com 00 378
rem del out.com

========end out.bat file=======================

====how to use out.com file setting 378 pin #2 to +5v=================

@echo off
echo status: 204 zoomkat's amazing batch file
echo.
echo.
out.com 01 378
cls

=========end batch file==============

The basic parallel port switcher pix:

Soldering 4 conductor phone wires to the parallel port connector.

Completed parallel port connector.

Completed 3 cam audio/video switcher.

The works close up.

Schematic for one cam. Others are paralled in at the video/audio output.

"El Cheapo #2", a 4 cam A/V switcher made for ~$23 from Radio Shack ($$$) parts. More info here!

Below is the completed "El Cheapo #2" switcher connected to the local cable audio/video, satellite audio/video, pan/tilt cam video, and the 4th video connector being used to operate the "channel up" button on an IR remote control. The switcher plugs are connected to the parallel port, the capture card video in jack, and the sound card line in jack. Check it out here.

Counter