Phidget Tips for PC Lap Counter
By Dale DeWeeseIf you have purchased or are considering purchasing a Phidget 0/16/16 interface card for use with PC Lap Counter (PCL) and your non-digital plastic or routed wood track, you might find the following information helpful.
Why consider a Phidget card for lap counting:My reason was to eliminate missed laps with my 4-lane, routed, analog track. I had been using my PC's parallel port for lap time detection and pit stops. This worked great with lap-timing programs in the DOS environment. However, as soon as I switched to the Windows XP operating system, I experienced occasional missed laps using the parallel port. The parallel port does not get the same priority within Windows XP as it does in DOS. In contrast, the Phidget card uses the much faster USB port, and it buffers the incoming signals. I have not yet experienced a missed lap with PCL since installing my Phidget 0/16/16 board. Plus, I still have 12 more input channels and 16 output channels to work with beyond the lap-counting duties.
Where to purchase a Phidget 0/16/16 interface card:Phidget cards are offered by several vendors on the web. However, if you are able to, I strongly recommend that you purchase your Phidget card from Mainline Hobbies (
www.mainlinehobbies.com). This is where I purchased mine. The prices are competitive, and their service has been excellent. Besides, the guys at Mainline Hobbies are actually using the Phidget card and PCL for their own 6-lane store track, so they understand Phidgets and lap timing.
What software is required for the Phidget interface card:I am using my Phidget card with Windows XP Pro (SP2) and PCL. The PCL website states that Windows 2000 & Vista also work with the Phidget cards and PCL, but Windows 98 does not. My Windows XP installation required the latest .Microsoft NET Framework v2.0 upgrades and Phidget software libraries, named "Phidgets 21 MSI”, before PCL recognized my Phidget card. The Phidgets 21 MSI software is available in the “Downloads” section at www.phidgets.com. The current version as of this writing is v2.1.2 dated June 25, 2007.
Wiring the Phidget 0/16/16 interface card for lap counting with PCL:First, the basics. A PC’s USB port is the means by which a Phidget board communicates with the PCL software, and it powers the Phidget’s circuitry. The Phidget 0/16/16 board requires an external 4 to 30 Volt D.C. power supply to change the logical states of the 16 available input and output channels. (I chose a discarded PC power supply, capable of either 5 Volts or 12 Volts for my Phidget board’s external power supply.) When the Phidget’s input/output channel receives the minimum 4 Volts (referenced to Ground), the logical state for the corresponding channel is “1”. When the input/output channel receives less than 4 Volts, the logical state is “0”.
Two rather simple wiring circuits, Diagram 1 & Diagram 2 are shown at these links:Diagram 1Diagram 2Each circuit requires the Phidget 0/16/16 card and a set of Phototransistors (also called photo detectors) – one for each lane. For reference, (4) Infrared photo detectors beneath my track are illuminated with (4) Infrared Emitters above the track in a “light bridge”. The detectors and emitters can be purchased in sets at Radio Shack as part #276-142. Whether you use a light bridge or not, the principle is the same; the photo detector acts as a switch to close a circuit between the Phidget card and the external power supply when it receives light. The detector opens the circuit between the Phidget card and the external power supply when it is blocked of light from a passing car.
Diagram 1 is the simpler of two circuits shown to achieve lap-counting with a Phidget 0/16/16 and PCL. This circuit defaults to a Logical “1” state at each of the Phidget’s lane inputs when the detectors are unblocked. This Logical “1” state changes to a Logical “0” state at the corresponding Phidget lane input when a passing car blocks the light to the detector. PC Lap Counter recognizes this change in logical states and registers it as a lap count. The major shortcoming of this circuit design is that the PC Lap Counter’s fuel management/pit-stop features will NOT work with this circuit design. PC Lap Counter currently detects a pit-stop when a Logical “0” state changes to a Logical “1” state. The circuit in Diagram 1 works the opposite of what PC Lap Counter needs with regards to pit-stops.
The Diagram 2 circuit will let you enjoy all of the lap counting and fuel management/pit-stop features that PC Lap Counter offers. This circuit uses a “pull-up” resistor for each of the Phidget 0/16/16 lane input channels. This circuit defaults to a Logical “0” state at each of the Phidget’s lane inputs when the detectors are unblocked. This Logical “0” state changes to a Logical “1” state at the corresponding Phidget lane input when a passing car blocks the light to the detector. PC Lap Counter recognizes this change in logical states and registers it as a lap count. The program will also properly register a car stopped over a detector as a “pit-in”, if the fuel management/pit-stop features are enabled within the program.
This circuit requires that a 4.7 K Ohm resistor be wired between the positive lead of the 5 Volt power supply and each of the detectors’ collector (C) pins. A separate wire is required between each of the detectors’ emitter (E) pins and the ground. If you use a power supply greater than 5 Volts D.C., you will need to possibly experiment with a different value of resistor. The goal is to achieve a Voltage less than 4 Volts, measured between a lane input channel and ground, when the detector is illuminated (unblocked). This same reading should jump to greater than 4 Volts when the detector is blocked. Remember, 4 Volts happens to be the Logical “0” to Logical “1” trigger point for the Phidget 0/16/16 card.
A Phidget 0/16/16 card may appear a bit intimidating at first. But, as you can see, it is rather simple to wire for lap-counting with PCL. It has proven to be very reliable, and thanks to PC Lap Counter’s built-in interface, its capabilities go well beyond just counting laps.