Introduction: Parallel Port Speed Calculator

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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!

Picture of 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.

Comments

robot1398 (author)2010-12-27

can it work on windows xp

Erjie (author)2010-10-06

sir is this project have no schematic and circuit diagram?

1up (author)Erjie2010-10-10

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

cylove (author)2010-09-21

..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! =)

cylove (author)2010-08-09

..what was inside of the cardboard??

1up (author)cylove2010-08-10

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

bryan11 (author)2010-07-28

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

1up (author)bryan112010-07-29

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

Wehrdo (author)2009-08-25

Think this could work on Windows 3.1?

1up (author)Wehrdo2009-08-25

Yes, and it'll even work in DOS.

TOCO (author)2009-03-09

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!!

Ranjit50 (author)TOCO2009-08-04

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

TOCO (author)Ranjit502009-08-15

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

ReCreate (author)2009-04-23

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?

ReCreate (author)ReCreate2009-06-16

I think i misplaced this comment...

ReCreate (author)ReCreate2009-05-02

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

ReCreate (author)ReCreate2009-05-02

AH DOH...Nevermind,big nevermind

proto-man (author)2009-05-17

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)

ReCreate (author)2009-05-02

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

stephenniall (author)2009-04-14

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

Hi just started Learning qbasic finally This has opened Loads for me Tyvm

TOCO (author)2009-04-02

You could make a tripwire type of thing. I tried It with my computer and It worked. I took a clothespin and some aluminum foil. You rap the foil around the top part of the pin and more foil on the bottem. Then put one wire on top and the other on the bottem. Now tie some string to a piece of cardboard and the other end of the string to the wall or a table. Pull on the string and it will pull the cardboard out letting the foil touch. Then make another.

TOCO (author)2008-12-19

I made this. It worked great for a wile but then it had trouble communicating with the pads. I had to open notepad and try to print something every 5 times i use the pads. I might bring my computer and these pads to science class.

1up (author)TOCO2008-12-20

I was having problems with the pads, too. I think making them out of better materials would help greatly.

lolcat360 (author)2008-08-18

Oh... also, on a scale of 1 to 10, i give it a 1000000!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

lolcat360 (author)2008-08-18

OMG! This is awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

GorillazMiko (author)2008-03-11

...1up, how do YOU KNOW SO MUCH?! Seriously, you're so smart! Your Instructables are ALWAYS awesome, VERY cool, wow, just great job. +1 rating. By the way, just wondering, how old are you? You seem to know a lot, and if you're young, that's GREAT!

1up (author)GorillazMiko2008-03-11

Oh, wow... Thanks. :D Just wait, I'm posting a new Instructable in ~1 month, and if you thought that was cool, my next project will blow you away! Bet you can't wait now, huh? Oh, and I'm 14, by the way.

GorillazMiko (author)1up2008-03-11

No, I can not wait. :-( And 14? Dang. You're smart. :P

eastie617 (author)2008-03-10

Good Job, that looks nice. Any way you can convert for USB tests?

1up (author)eastie6172008-03-10

There are Parallel to USB adapters, but I'm not sure if qbasic will still work for it.

Shadow Dragon (author)2008-03-09

Sweet! This looks so awesome! :)

About This Instructable

7,063views

10favorites

Bio: Sometimes my Instructables are few and far between, but I try to make them as well as I can. Hopefully you can be inspired or ... More »
More by 1up:How to Make a Portable Game SystemMacro Photography: An Essential Skill for Good InstructablesThe Smallest USB LED
Add instructable to: