Another take on a Pinewood Derby car with lights, this time with an Atmel ATtiny2313
microcontroller inside (along with a mess of wires). I haven't verified this, but a rough
calculation suggests that the lights should run for about 4 hours on two CR2016 batteries,
which is sufficient for a weigh-in and race.
The goal was to add front, back and roof LEDs to the car. My son wanted the roof lights to
flash in an alternating pattern (that is, one on when the other is off, and vice versa). The
simplest solution that I could see was to use a microcontroller. I could have used flashing
LEDs, but they wouldn't be synchronized. I could have used a 555 timer and an inverter,
but this would increase the part count. I also wanted to strobe the LEDs to lengthen
battery life and use the duty cycle to equalize brightness in some way. So, it just had to
be a microcontroller. Besides, a Pinewood Derby car with a computer inside - how cool
is that?
The total cost of parts for this project probably amounts to less than $10 or so. However,
you need to be familiar with programming a microcontroller (the wonderful ATtiny2313).
I use the avrdude/avr-gcc toolchain on Linux with a USBtinyISP programmer from
http://ladyada.net . I used a programming cradle (see http://www.instructables.com/id/Ghetto-Development-Environment/ for example) to connect the programmer to the microcontroller.
The electronic parts used in the car were:
1x ATtiny2313 ($2.88)
2x 5mm white LED ($1.72)
2x 5mm yellow LED ($0.64)
2x 5mm red LED (don't remember, probably $0.10 or less)
wirewrap hookup wire (two colors so the LEDs are connected with correct polarity)
ShapeLock (aka Friendly Plastic) to fashion a battery holder
2x ring connectors for battery terminals
2x CR2016 coin batteries ($1.17)
2x 20 pin DIP sockets (one split in half to simplify hooking up the ground connections)
1x tiny switch (I used a SPDT, $0.75)
1x diode to drop supply voltage below 5.5V (I used a zener in the 'wrong' direction)
The total of the known prices is less than $8.00, but it would be a bit misleading to characterize
this as a $10 project! I used the 20 pin DIP ATtiny2313 because I had it in my box. There
are many alternatives, the only consideration is space. If my soldering skills were up to it
(they're not), a SMD version would be cool.
The code is written in C, and is fairly straightforward. Working with interrupts is often a
bit delicate for timing reasons, but in this case a 1mS interrupt rate gives plenty of
time to perform the tasks at hand. Most of my coding time was spent figuring out the
correct timer/interrupt setup. (However, I should point out that I have been coding for
many years, and have a lot of experience dealing with this sort of project.)
Among other things, you will need a programmer for the ATtiny2313. Fast debugging was
helped significantly by my prehistoric (but functional) 4 channel 300Mhz Tektronix scope.
Soldering iron, solder, wire snips, wire stripper, solder sucker, wire of various sorts and
a breadboard for experiments all help too. A good tweezers and double sided Scotch
mounting tape (I like the mounting squares) are almost indispensable.
I am no expert in woodworking, so I have no contribution in this regard. I am, however,
an expert in finding overly complex solutions to simple problems, and in using delicate
and intensely complicated solution techniques. In this regard I can be of great help.
The project took a lot longer than I intended, mainly because (1) the hookup wire I used
(wire wrap) was very brittle and (2) soldering the connections in the spaghetti mess of
wires stretched my limited soldering skills.
Most of the relevant instructable information is contained in the image notes on the
pictures. I split the steps into the woodworking part, the (electronics) hardware, the
software and the assembly (by far the hardest part for me).
Hopefully we will win some category of the Pinewood Derby :-). (See the end of the
last step for the conclusion of this story.)
Remove these ads by
Signing UpStep 1Preparing the car
He then used a Dremel tool to do some sanding. His focus was more on removing wood
than on producing a smooth surface. But he had fun.
I quickly realised during this that I had to let my son drive the process. My initial tendency
was to aim for perfection of some sort (not that I could achieve it), which would have
spoiled the fun. Luckily I got sense and chilled out.
I used a 1/2" wood chisel to hollow out space for the wires, battery and microcontroller. I was
lucky with my size guess. This was a little challenging for me (see picture) as the pine kept
splitting unexpectedly. Take care not to get too close to the sides or the axle slots. Patience
works here, remove small slivers of wood at a time rather than going for big chunks.
Then I drilled holes for the 6 (5mm diameter) LEDs. Two from the top, the back and the
front. I drilled a small hole first, then widened it with a larger bit. Again be careful, the
pine splits easily. Make sure your holes end up in the chiseled out space! No magic here,
just careful aim.
My son then applied one coat wood primer, and the sprayed the car with metallic paint.
More primer coats and more (lighter) layers of spray would probably produce a better finish
(and take much longer). My main concern here, however, was making sure my son pointed
the spray can towards the car and not his face! Also, he was more concerned with process
than product.
| « Previous Step | Download PDFView All Steps | Next Step » |












































i was thinking of making a kit, but need to think about making it very robust.