The Microprocessor

The Derby Timer uses the ATMega168 microprocessorThis processor was included in the NerdKits package that I purchased online at http://www.nerdkits.com.  The NerdKits package includes the processor, a breadboard, USB cable, LCD display, and some miscellaneous parts.  Most importantly, the NerdKits package includes a .pdf manual that explained how to put the microprocessor together.  Since the Derby Timer was my first microprocessor project, the NerdKits manual was an invaluable help.  It was definitely money well spent.

The basic NerdKits package is meant for educational use, not an assembled project.  (It would be a bad idea to have a breadboard with jumpers banging around the derby timer!)  Since I now had practice programming the ATMega168 included in the NerdKits, I then purchased a printed circuit board kit from ProtoStack at http://www.protostack.com/boards/microcontroller-boards/atmega168a-development-kit, that uses the same processor technology.

Although the NerdKits and ProtoStack kits use the same microprocessor technology, there is an important difference in how they are programmed.  The NerdKits processor comes with a bootloader program pre-installed, while the ProtoStack processor does not.  The pre-installed bootloader allows the NerdKits processor to be programmed with the USB cable that comes included with the kit.  The ProtoStack processor requires a separate programmer.  There are some pros and cons to each method that I will cover in another post.  (Since I had not yet purchased a programmer, I was able to use the ATMega168 supplied with the NerdKits in the ProtoStack board and program it successfully using the NerdKits supplied USB cable.)

For illustration purposes, here is a picture of the ProtoStack next to the NerdKits.  The ProtoStack is the red circuit board on the left. There is an AVRISP mkII programmer (looks like a small mouse) plugged into it.  The NerdKits is on the right.  Note the green LCD display that comes with the NerdKits.

(Disclaimer:  This picture does not include all of the parts included with either kit.)

Finish Line Circuit

Image

This circuit detects cars crossing the finish line.  As cars interrupt the laser beam hitting the light detector, the voltage (Vmeasure) jumps in the circuit.  The voltage change is analog, but the microprocessor needs a digital signal to operate properly.  The LM339 converts the analog signal to a digital (ON/OFF) signal.  As soon as the voltage increases above the set point voltage, the LM339 switches (Vout) from digital ON (5 volts) to digital OFF (0 volts).

By adjusting a variable resistor, the circuit can be calibrated for the amount of light hitting the detector.  There are many variables that can impact the amount of light hitting the detector.  These include the brightness of the laser, how well the laser is aligned, how well the track reflects light, and the amount of ambient light.  Light intensity covers an extremely broad range.  So, it is important to have a flexible circuit.  When setting up for the race, the set point voltage (VTrip) is adjusted to be just below the measured voltage (Vmeasure).  This insures that the microprocessor will get the signal at the instant that the derby car crosses the finish line.