Circuit diagram for a 4 lane infra-red lap counting gantry, just leave out 3 and 4 if you only need it for 2 lanes. The four Infrared emitting diodes are powered by a Max of 1.4 V DC ,wired in parallel to 1.2v (1.4) NiMH Battery, and mounted in the overhead gantry.
The four 3mm Phototransistors are mounted 55mm bellow in the track, for grater sensitivity you can wire two in parallel for each lane (x8). They act like switches that are normally closed when lined up with the working emitting diodes, pulling the signal lines to ground, when a car passes over them the circuit is broken and parallel port TTL lines go high to 5v.
NB: We also have independent rally tracks that all run on incorporated 5Vdc regulators, with 2 LEDís in series(at 2.8V needs a resistor to limit current <100ma) and 2 phototransistors in parallel giving better sensitivity over grater distances, but still using the same software.
Maplin YH70M Infrared emitting diode IED x 4(8)
Maplin YY66W Phototransistor PT x 4(8)
1.2v (1.4) NiMH AA Battery x 1 *
AA battery holder Maplin YR59P *
* Replace with 5Vdc 1A regulated system as this can be used to drive track Relays and indicator LEDís(each of the LED's will need a resistor to limit current to <100ma)

As the output data lines from the PC are low current and can not directly power lights or relays it will be necessary to adapt the signal to power these devices, however there is a low cost Octal Darlington Driver Array specifically for TTL, the ULN2803A. Each channel of the ULN2803A will drive up to 500MA, with a maximum of 3A total, so can drive the LEDís directly, while a 2A DPDT(BT type 47) relay should be used as a minimum for each track. The total for all eight devices is less than 300MA, well within the capacity of the ULN2803A, and using the relays normally closed contacts means that relays can be permanently connected even if not activated. While we have used 12Vdc *1 (smoothed) for lights/relays, we found that the circuit will work on 9Vdc, but have no idea how long a PP3 battery will last. We have mounted the ULN2803A and RELAYS on strip board with DIL sockets, for convince using plug and sockets for all other connections, many of these could be hard wired to reduce cost. You will also need to hold PC pin 11 to ground as most Parallel ports will not out put otherwise, and if you wish to use pin 11 as a remote Start/Pause connect it with a push to break switch (Maplin ND92A).
Components: (Maplin part No.)
1 x ULN2803A Darlington Driver (QY79L)
1 x DIL 18 pin socket (HQ76H)
4 x 2A DPDT relay (N17AW) *1
4 x DIL 16 pin socket (BL19V)
4 x 10mm 2.5V Red LED (UK25C)
4 x 430 ohm resister (M430R) *1
*1: To run at 5volts, replace 12Vdc with 5Vdc using a 5V relay, and for the LED replace the 430 ohm resistor with 180 ohm.