Multiple Timer Circuits

Hi all,

I'm brand new to this forum and also Arduinos in general. I'm currently in the process of making a Pinewood Derby track and just about have that side completed (needs varnishing and a bit more sanding, ...).

My next project is trying to make a timer. I've been following instructions from the USA but don't seem to be able to find identical components here in the UK. The first thing I'll need to do is set up the electrical hardware:

Inputs: 4 pairs of IR LEDs and receivers that I hope to use as the main inputs. 1x start switch (push to make) 1x reset switch (push to make) (I suspect long term I'll double up both of these switches and have ones up near the start gate as well as at the finish line.)

Outputs: 4x 8x8 LED matrix boards (these have the pins to allow daisy chaining) 4x 4bit 7-digit displays (not sure if these can be daisy chained - they have room on the circuit board but no pins - was thinking of just soldering the connecting cables into a chain) 1x solenoid / servo to operate the start gate (I've ordered both from Hong Kong but not sure which would be best to use)

If anyone could give me any tips with where to start in terms of information and how to set this all up I'd be really grateful. Let me know if you need any photos of the components I'm going to use.

The board is an Arduino Uno R3.

Thank you. :)

If anyone could give me any tips with where to start

Start with any one part. Seems logical to me to start by learning how to read the start switch. The state change detection example seems like a good starting point.

When you can tell that the race is supposed to start, open the starting gate. How to do that depends on the hardware. The solenoid will be fast, so all the cars will have the same start time. The servo will be slower, and may allow some cars to start before others, depending on how the gate and cars are designed.

Next, learn to determine when a car has passed the finish line. Repeat for the other 3 lanes.

Last would be to display the elapsed time for each car, first using Serial.print() and then using the LED matrices and/or 7 segment displays (why both?).

My advice would be to start simple.

Write a program that starts recording how much time has passed when an input goes from HIGH to LOW and stops when a second input does the same, then display the elapsed time on the Serial monitor. To do this record the value of millis() at the start and stop and subtract one from the other to get the elapsed time. Note that you need to record when the inputs [u]become[/u] LOW rather than when they are LOW. Use switches for this initially.

Then extend it to 2 sets of inputs, then 3, then 4. By then you will probably have heaps of repetitive code doing basically the same thing. You can reduce the code by using arrays of inputs and variables to store start/stop times.

Separately write a program to read the output from an IR sensor. Can you make it go HIGH/LOW ? if so incorporate the program into your timing program.

Once you have at least the basic program working think about turning the elapsed times into a different format as I suspect that milliseconds will not be very useful. However, starting with milliseconds you can derive any time measurement that you want.

Once that is sorted you can move onto displaying the results on other devices. Once again you would be wise to get them working in a separate program and I suspect that you will be able to find examples to get you going.

That should be plenty to be going on with.

Full details of the components that you will be using would help as it is is unlikely that anyone will have the same hardware so specifications would be helpful.

One of the examples I've seen uses the matrix displays for messages (e.g. Pinewood Derby; Ready, Set, Race; ...) and finishing positions (1;2;3 or 4) and the 4 bit 7 segment displays to show the times.

The code for that setup is available (but I can't duplicate all the components) but I thought I'd try and use it as a starting point but don't really understand it!:

https://youtu.be/Pr-tbBp4JM8

(Look in the description of the above youtube video.)