On your mark, get set... Grand Prix/Pinewood Derby Track Timer, via Netduino

Sign in to queue


Today's Hardware Friday Coding4Fun project is one that brings back a number of memories. From being a kid and building and racing in the Pinewood Derby, to those as a parent of a racer, to the "discussions" of which car won. In short, I wish I had this then...

Project – Grand Prix (Pinewood Derby) Timer

So let me set the stage for you (in case you didn’t do Awana Grand Prix or Boy Scouts Pinewood Derby as a kid). You are 9 years old – you and your Dad (or Mom) have just spend 2 weekends building a pine car. It is all painted; the axles and wheels have been polished and they are lubricated. You just know your car is fast. Now it’s your turn to race. Your car is set on the track along with 3 others. There is a count down and …. snap…. they are off. The cars go racing down the tack as all the parents stand over the finish line waiting to see who finishes… but wait!! It appears that 2 finish at the same time. Now all the parents rewind their video cameras and spend the next few minutes “discussing” who actually won.

Well there is an answer to this problem and it doesn’t involve re-winding any tapes on a video camera (unless you want an instant replay). It is called a track timer. Now there are commercial units available out there but since the spirit of these events is to spent time with your kids I figure why not build one?

Our church had a track but it was damage a few years back and was so warped that we decided it was not worth repairing. Last year we borrowed a track from another church, but the timer didn’t work all that well as it only showed positions (1st, 2nd, 3rd, etc). So after the race our Awana leader, Danny, decided to take on the task of building a track and I volunteered to build the timer.

In the following pages I will document the research, design, build and associated materials. I also plan on posting all schematics, source code, and BOMs (bill of materials) for others to use. Please remember that this is a work in progress. I will be sure to state when the BOM and plans are complete. If you have questions or comments please ask.




Project – Grand Prix (Pinewood Derby) Timer, Page 2 - Design



To find the best way wire up the IR Emitters, I used the LED Wizard located here and fed in the specs of the LEDs and the count. It gave me a couple of solutions and I decided to go with the second. I am powering them from +5v and they will be paired with a current limiting resistor (27 ohm 1/2 watt). On the breadboard this works great and the parts do not heat up even after running for a few minutes. NOTE: After assembling the finish line and letting it run for a while the current limiting resistors became quite hot. After reviewing the diagram on the left I realized that I had used 1/4 and not 1/2 watt resistors. This will be replaced before the next race just to be safe.

Process Diagrams and Schematics

These diagrams and schematics are what I used to document the design for the timer. I did some samples / POCs to figure out what I think would work. That way I could follow this as closely as possible when writing the code and building. However once I built the timer and wrote the code I realized I did not really need some functions (like the status check function) or i need to change things after starting the build and so these do not exactly reflect the device and code that I used on our track. With that said everything here should allow you to design your own timer but if you get stuck please let me know.



And a snap from the code,http://gprt.codeplex.com 

        public static void Main()
            // which lanes will be used during the race, default to all in use
            Lane_1_Enabled = true;
            Lane_2_Enabled = true;
            Lane_3_Enabled = true;
            Lane_4_Enabled = true;
            Lane_5_Enabled = true;
            Lane_6_Enabled = true;
            Lane_7_Enabled = true;
            Lane_8_Enabled = true;

            for (int i = 1; i <= timerResolution; i++)
                timerRes = timerRes + "9";
            //setup the LCD
            LCD.SetCursor(0, 0);
            LCD.BacklightBrightness = 40;
            //create interrupt event handlers one for each GPIO setup.
            Lane_1.OnInterrupt += new NativeEventHandler(Lane_1_OnInterrupt);
            Lane_2.OnInterrupt += new NativeEventHandler(Lane_2_OnInterrupt);
            Lane_3.OnInterrupt += new NativeEventHandler(Lane_3_OnInterrupt);
            Lane_4.OnInterrupt += new NativeEventHandler(Lane_4_OnInterrupt);
            Lane_5.OnInterrupt += new NativeEventHandler(Lane_5_OnInterrupt);
            Lane_6.OnInterrupt += new NativeEventHandler(Lane_6_OnInterrupt);
            Lane_7.OnInterrupt += new NativeEventHandler(Lane_7_OnInterrupt);
            Lane_8.OnInterrupt += new NativeEventHandler(Lane_8_OnInterrupt);
            StartGate.OnInterrupt += new NativeEventHandler(StartGate_OnInterrupt);

            //write out startup text
            LCD.WriteText("Grand Prix Tim" +
                          "er v0.1  By:  " +
                          "JarrodSinclair" +
                          "Hold Button 4 " +
                          "for Status    " +
                          "Check         ");


            if (Button.Read() == false)
                //button is being pressed during boot... call StatusCheck
                LCD.WriteText("STATUS CHECK: " +
                              "Be sure Start " +
                              "Gate is closed" +
                              "              " +
                              "Hold Button  " +
                              "to continue.  ");
                // let the user read the message
                while (Button.Read())
                    // waiting for use to press button

            LCD.WriteText("Grand Prix Tim" +
                          "er v0.1  By:  " +
                          "JarrodSinclair" +
                          "@Hotmail.com  " +
                          "              " +
                          "READY TO RACE ");

            COM1.DataReceived += new SerialDataReceivedEventHandler(SerialPort_DataRecieved);

            //prepare the timer and lanes for a race
        // ....           


Overkill you say? The only overkill would be if the results were tweeted and a picture taken... LOL (hum... haven't I covered tweeting from Netduino... and one where a camera was used?... hum...) Wink

The Discussion

Add Your 2 Cents