Fun with Electronics and Code

Just another site

Category Archives: Netduino

Arduino vs Netduino

So I have had a few questions about if the Grand Prix / Pinewood derby track timer design or code would work on a Arduino. Well the short answer is no. Now that does not mean you can’t build a track timer with an arduino (I looked at them when initially consider the design) but there are a few reasons why (in my opinion) the Netduino is better in this situation. The most important is how the interrupt triggering works vs polling that you do on arduino.

If you want to know the “exact” time a car took to travel down a lane the resolution of that time is dependent on how small you can make the loop and that resolution can change if something else occurs on the arduino.

With the Netduino however you can set up hardware level interrupts on each of the input pins and those events have a timestamp from the hardware layer. Now it take considerable longer to process the events in the netduino but since you have that timestamp it is very easy to calculate the time elapsed. This allowed me to get to x.xxxx seconds vs to x.xx seconds with the arduino.

Now some may ask if that is necessary and in response I will just give this example. In our first race after building the timer the final race was so close that on video you could not see a difference between the cars. Thier times were 3.1415 vs 3.1417.

If the time resolution was less than x.xxxx then this would have been recorded as a tie. Since using this system we have not had a single tie. This time resolution seems to fit the track we have which is 43′ long and only the first 10 to 12 feet has slope… if your track is shorter than that then you might need a higher time resolution.

Well I hope that helps. let me know if you have any other questions.

.NET Micro Framework game console you can built!

Well a couple of the community leaders over at the Netduino forums has turned out an embedded project that is a full-blown PIX-6T4 console (think paddles and asteroids).  You can check it out here:  They have videos of its operations and full build instructions.

Track Timer – Additional Build Details and Source code

Well it has been busy the last few months, but I finally freed up enough time to add the design documents for the Grand Prix Timer to the build page on my Blog and add the source code to a new Codeplex project. With these items you should be able to build your own after doing a little homework.

Note: All the design documents I have created are now uploaded. However if you have any questions please let me know and I will add details where needed.

This is cool!!

The embedded controller I used for the Track Timer, the Netduino, has added my project to the project page on their website. check it out:

First Race with new track and timer complete!!!

The Netduino based Track Timer has been a fun project and last weekend we finally got to see the new 8 lane track and timer in action. 50 racers came to race their cars in an attempt to win a speed or design trophy.  The timer performed great and the only real issue I had come when the person operating the start gate closed it before the race was finished. It would reset the timer and the software would not record any times (even though i send the times as each racer finishes). This resulted in us having to rerun 2 of the heats. I will look at ways to change the code so that the Grand Prix Race Manager software will still complete a race if the start gate is closed. We are hoping to bring it out again before the Grand Prix next year as we all had a blast (especially the kids) and we want to do it again. I have added a video and some pictures below

As for the project details (Bill of Materials,  process diagrams, code, and build pictures), I will be working over the next week or two to get the project page updated with all the details on this project. If you have any questions or would like additional details on a portion of the build.

Thanks for the support during this build. I have some ideas for my next project but I am taking suggestions, so if you have an idea leave a comment or send me an e-mail. If I like the idea then i’ll build it.

Demo of track operation

Pictures of setup (and a shameless plug for my kids cars).

This slideshow requires JavaScript.

FYI – sorry about the picture quality, My SLR died and we have not fixed / replaced it yet so these were taken with my cellphone.

Testing the Track and Timer together – SUCCESS!!

What a great weekend!!!

Saturday we (Danny, My kids and I) setup the Track and the timer together for the first time. It was also the first time the entire track had been assembled. We had to drill the holes for the light sensors and the second support board and then everything fit right together. By 11:30am or so we have everything ready to start our first tests.  The first issues we ran into was that lane 4 would not register that it was receiving  light. After taking the finish line apart and checking alignment  we discovered that the whole in the track was about 1mm off and the IR LED holder in the top of the frame was 2 mm off in the other direction. So a combination of the to displacements (although each was in tolerance) meant that the light was not getting from the IR LED to the Photo Transistor. We reassembled everything and by 2pm we start the track tests.

The Track is not sealed yet (as we might need to make some fixes if track issues were found), so we raced 8 cars that Danny brought with him that did not have recent lubrication and therefore should not drip / drop anything on the track. The first run was a mess (the cars had not been used in a year) and half of them jumped the track. We disregarded this run and the following 8 runs whet very well.  Below are the Stats:

Track Average: 3.5040
Best Time 3.2417
Worst Time 4.1188
Maximum Deviation: 0.8771
Standard Deviation: 0.2159

With this testing complete this means the Timer and Track are ready for racing. This week Danny will be clear coating the track this week and I will make some final tweaks to my code. The race day is March 19th and now I will be focusing on helping my kids with their cars and hopefully get time to work on mine. I meant to take more pictures during testing but it was so busy, I forgot to pull out my camera until near then end when we had already started breaking down the track. I will make sure to take pictures and video during the setup and while racing on the 19th.


This evening my son and I setup and tested out the code for this Netduino based Track Timer.  It work extremely well and I only had to make a few minor changes and add about 15 lines of code.  Below is a video of us testing it out.  Tomorrow and Thursday I will be finishing the mechanical portion of the build and on Saturday we have a Car build and test day. This will be my first chance to see it all up and running.


Here are some close up shots:

Finish Line Construction and Code Testing update!

Bob, a co-worker of mine at HP, has been helping my cut, machine, drill, and tap all the parts for the finish line. So far we have all the parts except the LED holder cut and today we drilled and tapped the frame. Tomorrow we will finish drilling and tapping the 2 cover plates for the top and cut and bent the LED holders.  Below are some pictures of the build.

I have also been doing some testing of the code. On Friday I discovered that my Status Check function would not really service the need to verify that each lane and the start gate is ready before each race. It does exercise the Interrupt ports well and help me verify that I have each lane wired correct though. So I started looking at other ways and I ended up writing another function. This one works very well and tonight I plan on doing a lot of testing with it.

In the .NET Micro Framework, the InterruptPort functionality is basically a inputport that adds the ability to interrupt on a change. Therefore the read functionality still is available and with a quick read of each port I can see if each lane is “seeing the light” of the IR LED and that the Start gate is closed.  I also made one other change to the race completion function.  It now will show the top 3 Lanes on the LCD when the Race is complete.

So with these changes, the Grand Prix Race Management Software now running on my system, the testing will really start and I will be able to run mock races using my hand to simulate cars. I have been testing each of the components along the way but it will be nice to see everything working together. Then tomorrow or Thursday when I finish the mounting for the finish line I will be able to assemble the remaining pieces and perform some final testing before the first major test on Saturday, our car build and test day.

If I have anything left to fix then I will have 2 weeks before the real race to fix it. Lets hope I wont need it – Wish me luck!

Shipping cost how much?

I received the 2 aluminum parts I ordered last week and discovered that the shipping was almost more then the parts. It was 27.46 for the parts and shipping was 24.68 for 13lbs and 2 separate shipping containers. What I didn’t realize is that if you get stock that is different lengths (6′ and 8′ as I did) then they have separate shipping containers. Wish that they had told me before hand. Oh well guess I know better for next time.

Finished the electrical harness for the Finish Line. +Video

Well this was a big weekend, I was able to finish the electrical portion of the finish line and start testing it. Also I decided to make a video of the build so far describing what has been assembled so far. I am hoping the Aluminium I ordered last week will come in tomorrow so that Wednesday I can start to build the mechanical portion of the finish line, mount the electronics, and really start to test the software. the basic testing I have been doing seems to work and each lane and the start gate is triggering.

To build the wiring harness I used a peg board (for mounting tools and such on the wall) and some baling wire and a bunch of Cat 5,  Cat 3, and Telephone wire (so that I could get the colors I wanted)  and removed its insulation. Then i sealed the LEDs and Photo Transistors with heat shrink tubing. It is over sized by 3/4 of an inch giving me some room when mounting. Below are some Pictures of the overall and detail view of the main electrical connections. I will take some better pictures with my DSLR later.

%d bloggers like this: