# Parallel Port Speed Calculator

7,091

10

32

Published

## Introduction: Parallel Port Speed Calculator

Here's a neat project that can measure how fast something is going. It's very easy to make, requires few parts, and is fun to use. It simply plugs into a computer's parallel port, and using some software, can record an object's speed.

It works by measuring the time it takes you to step on each of the pads, then converts that to miles per hour and meters per second.

Thanks to this site for part of the code.

## Step 1: Tools and Materials

This is a pretty low-cost project, but still works very well. Most of these things you should already have.

Materials:
Aluminum Foil
Scissors
Duct Tape
Cardboard
An old Parallel Cable
Wire (Speaker wire preferable)
Heat Shrink Tubing (Optional)

Tools:
Old Windows 95/98/ME Computer (More on this later)
Heat Gun (Used with heat shrink tubing, optional)
Hot Glue Gun
Soldering Iron
Solder
Helping Hands

## Step 2: Making the Pads - Part 1

The pads we are going to make are going to be very low-cost. You can make nicer ones that will last longer, if you like.

Take the cardboard, and cut pieces that are about 9" by 4". You need four of these. Cut four sheets of aluminum foil that are the same size as the cardboard, but about 1 1/2" shorter. You don't want to make them as long as the cardboard, because then you would have no space to glue.

## Step 3: Making the Pads - Part 2

Now we need to attach the aluminum foil to the sheets of cardboard.

Center the aluminum foil on the cardboard. Take a piece of duct tape and use it to tape the aluminum foil to the cardboard. Place the tape about a centimeter in to the foil. Try to keep the foil as flat as possible.

It's a good idea to put a dab of hot glue in the center of the aluminum foil before you tape it; it'll hold the foil in place and provide a bump for the two plates to make contact.

## Step 4: Making the Pads - Part 3

Now it's time to finish up the pads.

Cut pieces of wire about five feet in length. We need two wires for each pad. If you are using speaker wire, you only need to cut two pieces. For normal wire, four.

Get out your glue gun and some tape. Tape the exposed wire to the aluminum foil, then glue the insulated part to the cardboard so it won't be pulled out. You could use staples to stick the wire to the aluminum foil, I chose to use tape.

Time to glue the pads together. On one of the pads, put a small pile of glue on each of the corners. Wait until it dries, then put a little more glue on top. Place the other pad on top of it, trying to keep a half centimeter of space between them. This is to keep them far enough away from each other so that they don't get set off accidentally, but will still be easy enough to press.

Tip: When you are gluing the corners, don't get hot glue strands on the aluminum. They will make the aluminum stick together the first time you step on them, and that is not good.

## Step 5: Creating the Parallel Interface

You need a way to attach this to your computer, right? In this step we will modify the parallel port plug to accommodate the pad wires.

If you're lucky, you got a printer cable that can be easily taken apart and put back together. Mine had small screws that allowed for quick and easy disassembly.

Once you have the connector open, you should have everything shown in picture 2. I threw away the screws used to keep the connector attached to the computer, I don't use them anyway.

Desolder all the wires from the connector. We only wanted the printer cable for the connector. You could also just buy a connector from Radio Shack. I saved the small rubber cable "decorator" shown in picture 3. You don't need it, but I kept it to make the connector look nicer.

We only need pins 12, 13, and 20-25. 12 and 13 are input pins, and 20-25 are all ground pins. Take one of the pads, and thread it's pair of wires through the rubber "decorator". Solder one of the wires to pin 12, and the other to one of the ground pins. Do the same for the other pad, but use pin 13 instead of 12.

It should now look like picture 6. Before you put the plastic hood back together, you should test the pads to make sure it works and that there are no shorts. Use the below program; it was made for Microsoft Quick Basic. To use it, start the program. The number you see on your screen is the "resting" position for the pads. Press one pad, and the number should change. Press the other, and a different number should appear. If not, check your connections and make sure there are no shorts.

For me, the "resting" number was 127, pressing pad #1 yielded 111, and pad #2 was 95. Remember yours, they will be important later.

Program:

10 LET PinStatus = INP(889)
20 LOCATE 10, 1
30 PRINT Pin Status
40 GOTO 10

In the first line, 889 is the standard address for parallel port input lines. Yours may be different.

## Step 6: Finishing the Interface

If all is working well, then you now need to put the plastic hood back together.

Tie a knot in the wires, so that they cannot be pulled out of the connector, and screw everything back together.

## Step 7: The Software

The software used was written by me, with a small portion from qwerty.com. To use it, you need an older Windows 95/98/ME computer and Microsoft QuickBasic. The older computer is essential because newer computers do not allow for direct control of the parallel port. QuickBasic can be downloaded from Microsoft here. The program is included in a BAS file at the end of this step.

Start qbasic.exe and open the BAS file from this step. Press Shift+F5 to start the program. You will be greeted with an intro screen. Press a key to continue.
Enter the amount the pads are spaced apart, in meters. Press enter.
The program will then wait for the first pad to be pressed.
Once that has happened, it waits for the second pad to be pressed.
Some text will pop up, saying how fast you went in m/s and mph.

If, in step 5, your numbers were different than mine, follow this procedure to correctly change the program.

Open the BAS file in Notepad or some other text editor. Find lines 200 and 250. See the numbers, where they say 95 and 111? You need to replace those with your numbers. Once you do that, save the file and close it.

You could write your own software, too. You just need to know how to program BASIC. The key is the timer, which is located in lines 230-280. If you don't get how to use it, see this page and look under "Got a Minute?". This is the original code, which can be modified to be used essentially as a stopwatch.

## Step 8: Start Running!

That's it! You're finished! Plug it in, start up the software, and try it out! I can run at 16mph. Beat that!

I labeled the pads, so I know which one is pad #1. Also, make sure that you enter the correct value for the pad spacing, because that could really mess things up if you don't.

## Recommendations

• ### 3D CAM and CNC Class

608 Enrolled

• ### Casting Contest

We have a be nice policy.

## Questions

can it work on windows xp

sir is this project have no schematic and circuit diagram?

No, it's just two switches hooked up to pins 12 and ground, and 13 and ground. ;)

..sir, how does this speed calculator work if it is already finish?what will be the usage of this output?is the wire connected to the parallel?or is it connected inside of the cardboard?please send me more details of this projects if you dont mind, here's my add cylovemasaera@yahoo.com thanks! =)

..what was inside of the cardboard??

Check steps 2-4, it's just some aluminum foil and wire.

is there anyway that i can do the program in C or turbo C sir?thank you.

Probably, if it has parallel port access. I don't know either of those languages, so you're on your own there.

Think this could work on Windows 3.1?

Yes, and it'll even work in DOS.

I love this instructable!!!!!!!! like lolcat360 said on a scale of 1 to 10 I give it a 1000000!!!!!!!!!!!!!!!!!!!!!!!!!!!! I made the rain detector that I found on this site and hooked it up to my computer and changed your code a little. Now when It is raining a message box pops up on my computer and says its raining grab a coat and umbrella!!

2 replies

Please can you send me the details of your project Thanks ranjit39@hotmail.com

I wish that I could but sadly the old laptop that I used crashed and after I fixed it I was unable to retrieve the rain detector file. SORRY

according to my gps,i ran up to 14 MPH... Can this be made to detect continuity,Like having a bunch of switches there and being able to tell which is on and off from the PC?

3 replies

I think i misplaced this comment...

so know that i know that i can't go any faster than 14,ill see if it is accurate

AH DOH...Nevermind,big nevermind

I have played with the parallel port on an XP machine before using both Qbasic and Visual Basic.

Note that I've only played with output to the parallel port and not input so I don't know if it will work on XP, though it should.

Qbasic on XP supports parallel port output (and hopefully input) out of the box. For Visual basic, you'll need a special dll file to interface with the PP (dl it here: http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html)

You wrote this in QBASIC? Ah,nice. Could this be used to detect continuity in a bunch of switches?

Hmm Im gonna try making these But Possibly out of wood RATED 5 / 5