Arduino suitablility for a project

Thanks guys. With a lot of googling and reading based on your comments, you've just filled in the 'blank spots' that I was mentally struggling with.

@GrayNomad:

You can use pin-change interrupts, the ISR does nothing but store the new state of the pins in a small circular buffer (say 256 bytes) with a time stamp, increments the buffer's write pointer, then exits.

Perfect, I was under the impression you could only fire ISRs from the pins that were designated as such. I do suspect that the Mega would make my job easier, as it looks quite a bit more complex to do Pin Change Interrupts (to this noob anyway), but Im sure I can figure it out with enough time and grey matter.

This does, however, also help with a longer-term goal of making this s/w and h/w usable with 8 lane tracks. My intention, if it all goes well, is to make it available as OS, as clubs and individuals are always looking for cheap/accurate options for lap counting & timing / race-control.

I couldnt find a lot of stuff about setting up a circular buffer with an Arduino. Would this be something that is just a standard C routine that I can research?

Same data format as suggested above but the "lane" byte is a bit field to allow simultaneous events.

Im not 100% sure of the reasoning behind this? As far as I can gather, a bit-field is effectively a group of 0/1's which designate state. The only tie-in I can think of is that the in the ISR there is a lower-level way of accessing the pin states, which is done via a bit-field.

@Korman:

... you just buffer the data for a while and make sure no measure is lost. If I understood it correctly, at worst you have 4 simultaneous lap times and then at least one second before the first intermediate time measure can occur...

Yup, at worst 4 simultaneous lap counts, which would then potentially occur typically ~4.5 - 6 sec later.

The more likely scenario is that you will get the cars crossing in fairly rapid sequence. EG 4.601s, 4.691s, 4.723s, 5.941s (last guy fell off in that lap hehehe). This will typically happen for the first few laps of the race, and is also the scenario that Im most concerned will mess up the serial comms.

Do you also have a display board and starter lamps installed and how are those driven?

Race control lights, and track power are manually controlled at the moment by the race controller. The start switch electrically somehow turns off the start light, and also signals the computer to start counting time (its wired to the spacebar on keyboard).

All race data is displayed via computer to the person running race control (who also needs to do things like adding / removing laps when cars jump lanes and cross the counters in the wrong lane). The race controller also presently manually switches the power off at the end of the race, and then manually turns on the start light again as well (red light goes out to start race).

Im certainly wanting to look at automating the start light and track power at some point. We do power-on starts at present due to the manual aspect of the power control, and Id want to keep that as it means there is more driver skill in the start (otherwise with a power-off start, they'd just sit there with finger on trigger).

Race Scenarios;
1. Practise - Computer just displays a rolling list of laptimes for each lane

2. Qualifying - Computer sits in practice mode, and a stopwatch is used to to time the driver for 1 minute. Driver tries to achieve fastest lap possible, and the fastest 2 laps are manually identified for providing qualifying order. When 1 minute ends, driver is allowed to complete current lap.

Races are usually comprised of 4 heats. Drivers rotate lanes between heats so that they get a run on each lane.

3. Trophy Race - System used for club championship + national-level races. Races are done by time, with XXX seconds racetime per heat (typically 3 - 5 mins). Laps counts are noted at end of each heat and manually put on a board, and then segments (100ths of a lap) are entered into the computer for each car.

All Laptimes saved for review by driver if interested, or to assist with disputes. Drivers then rotate to next lane, and it all happens again. Race results are ordered by total laps completed in race across all heats (done manually at present, computer just tracks current race). Computer provides total laps for race at end, and positions at end of each heat.

3a. Clubnight Handicaps - Drivers have 100 secs to complete 10 laps. Drivers are handicapped based on previous best performance for that particular class of car (records maintained in computer). The idea of handicaps is that all drivers should finish at almost the same time if they are driving well. It also allows cars of varying performance to compete equally.

Drivers are verbally advised their starting order, and are verbally released slowest handicap to fastest. EG slow driver will have 20 sec handicap which means it takes him 80 secs to do 10 laps. Fast driver will have 53 sec handicap, which means it takes him 47 secs to do 10 laps.

Computer provides the handicap order, and prompts race-controller with a 'READY' 1 sec prior to release time, and then a 'GO' when release time for that driver arrives. Race controller verbally calls these out to the drivers. When driver has finished 10 laps, their lane colour is called and they drive back to drivers podium and stop. Driver with fastest heat-time wins the heat. Points are allocated per heat.

Times typically will be over the 100 sec mark, and any time under 100 secs means that the drivers handicap will be increased. The computer usually starts the clock at the nearest 10 sec mark relating to handicaps. EG if we have 53, 51, 49, 35 then the computer will start the clock at 30 secs and do the necessary maths (add 30 secs to timer at start).

3b. Clubnight Grades - Drivers are seeded into grade races based on their handicap times. Grade races are for 10 laps. Drivers all start together when light goes out (instead of sequentially as in handicaps). Driver with fastest heat-time to 10 laps wins the heat. Points are allocated per heat.