Pack 389's Cheap Pinewood Race Timer


Home     Download    

 
 

History

In 1999, our Pack needed a race track for the anual Pinewood Derby.  Our normal source for a track was another pack in the area, and they had a bad experience loaning it to some other pack and changed their policy.  Therefore, it was up to the leaders to come up with a solution.  Tom Watson (and his den) volunteered build the track, and I (Kurt Godwin) volunteered to make the race timer electronics.  We did not have the money to buy a commercial race timer (about $250 for a basic unit, and we wanted six lanes).  So, I did some research on the web, and found that there were a few designs out there, but they were all still kinda pricey,  so I started designing one on my own.

I had a cheap old laptop computer, and it had a bi-directional parallel port on it,  so I had a 6-input device.  All I needed was some electronics to convert the lanes into separate digital signals (one for each lane), and hook them to the parallel port,  write a little C program to poll the parallel port, and viola!  A super cheap timer...

Phase 1

So, I went to work looking for parts to convert a photo resister to a +5 or ground signal. The solution was simple:  use 6 photo resisters, 6 potentiometers, and 2 10K resistors (for a 2.5 volt reference for all of the comparators:

This is what each lane looked like:

Schematic of a single lane

This in combination with a borrowed laptop computer with a parallel port, a little C program called race.c, and a few batteries for a power source, and I was done!

Total price (without the laptop) was about $40!!!!!!

  • 25-Pin Printer cable ($25)
  • 2 LM339N comparitors ($2)
  • 2 10K resistors ($5 for a pack of resistors)
  • 6 photocells ($2 radio shack bulk)
  • 6 10K potentiometers ($2)

    That's it!  Of course, I needed to boot into DOS to run my little race.c program, and ONLY I knew how to run it (you had to hand set the pots based on the lighting such that they were close to the threshold voltage (1/2 supply voltage) before the races could start.  We ran 3 races with the timer and the 6 lane track, and it worked GREAT!

    Phase 2

    After 3 years, my son was in Webelos 2, and ready to move on into Boy Scouts.  I was inspired to make a final improvement to the timer when my oldest son came home from high school and said he needed help working on a PIC chip.  At the time, I had no clue what a PIC chip was,  so I jumped on the trusty WWW and looked it up.  To my astonishment, I found the PIC chip to be the coolest microcomputer that I has ever seen (admittedly, the last time I used microcontrollers was in the 80's, and the 8048 was the killer chip).

    At this point, I was inspired to create a new and wonderful solution to the Pinewood Derby Race timer, and to alleviate the requirement for a laptop computer (and DOS) to run the races.  Since I would be out of the Pack at the end of the season anyway,  this was further motivation to "play" around with this project.

    So, I hit the Microchip web site and checked out some of the cool products that have been developed for embedded systems since the 80's.  I was please to find most of the solutions I needed, and many more ideas for new projects sprang into my head! (that's a topic for another web page).  Anyway,  I was off and designing.  I am a die-hard digital designer (not having any experience designing analog systems) and found some cool technologies to make high speed self clocked serial communication (SPI), and it was built into the PIC chips.  All I had to do was pour over hundreds of pages, drooling over the cool features, trying to find a cheap and easy solution.

    Again, I had a small budget, so the "cheap" was was the right way.  I had two challenges:  Remove the tedious hand tweaking of the potentiometers, and replace the laptop with a small (cheap) display.  For the POTS, I found a source of digital SPI controlled POTS.  For the display, I found a SPI controlled LED driver chip that would drive 6 LEDS at the same time (using strobing).  Since the PIC chips were so cheap,  I had it made.  Everything was going to be DIRT cheap.  Well, not really.  I still needed to be able to program my PIC chip, and I also wanted a cheap PIC programmer for my very own (for the next projects).

    Well, to make this page brief,  I will leave programming the chip to a  PIC programming page. Another problem for my tight budget was a design tools. I needed a PIC compiler and a schematic drawing program. Again, I did some research on the web and found a cool schematic program for Windows that did all I needed. Better yet, it was FREE (at least for a non-commercial solution). I can't say enough good about the Eagle cad solution from CadSoft. Below are the resulting schematics that it put out. Also, I found that Microchip gives away a cool product called MPLAB ICE that includes an assembler. Since I love assemblers, and machine code, I was in heaven. But, since I like tinkering, I also found a great C compiler that allowed me to write the code in C (after I wrote an assembler version of it). The company that makes the embedded C compiler CC5X is B Knudsen Data, a company from Norway. The graciously provide a student/non-professional version that was good enough (has restrictions) for this project.

    Well, by now, you are probably getting board reading the background information on the second phase of my project, so I will jump right in to the meat of things.

    I broke the project into two parts,  a display, and a CPU/Sensor board.  A simple cable (from PHASE 1 of the project) was used, along with the existing connectors. Since each part is independent except for the connecting cable, I could fit them within the limited FREEWARE space provided by the Eagle CAD software.

    Since the old design relied on an external laptop computer with a display,  I needed to replace the Laptop with a PIC chip.  I took the existing breadboard with the old electronics off the bottom of the track,  and added a new breadboard with the potentiometers replaced with digital pots, and a PIC chip programmed with my race timer software.

    Schematic for the CPU and Sensors Display Schematic
    CPU/Sensor board Display Schematic

    Click on the above images to see a more detailed schematic, and a description of what each part does. The total solution ended up with a cost of about $100, but was well worth it, as I learned how to use the new PIC chips,  SPI, and some more analog electronics.

    For PIC source code listings for this project, and more, click the download link above or here

    In closing, I hope this information is helpfull. If you have questions about this solution, or would like to comment on it,  please feel free to contact me at kurtgo@nospamplease.yahoo.com (remove the nospamplease part, sorry but I HATE junk mail).

     


  •