Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby

Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby

Hi, this is Wayne again with a topic “Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby”.
A couple years ago i was asked to help out a local scout troop by building a pinewood derby track timer system. I used some pvc pipe to make a gantry to go over the lanes using some bright leds to shine down on some photo transistor sensors and some red leds on top to actually indicate who won and in what order. The box of electronics contain an arduino. Is the main muscle and lots of connecting wires this year, i decided to update that track system for starting with a new gantry, something a little better looking and that would contain all the electronics using an ala mode to do the high speed sensing of each lane Sensor and a raspberry pi to give me some more flexibility and connectivity to make it easier to use the circuit setup. For this whole thing couldn’t be simpler for power input. I use this circuit. I have 12 volts provided by a wall wart and a cbt c5 that steps that 12 volts down to 5 volts. This is what is used to power some of the electronics and the ala mode and the raspberry pi directly. I actually solder this onto my shield board that i made that i’ll show you here in a moment onto the five volt pin of the ala mode and it back feeds into the raspberry pi. This has a capacity output of three amps, so it has plenty of power to run the circuits that i need the 12 volt wall.

Wart has sufficient supply through this circuit. The start of the race is controlled by a handle at the top of the track. A momentary switch grounds, one of the digital.

Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby

I o ports, thus telling the alamo that the race has started simple circuit of a pull-up resistor to 5 volts keeps it high until the switch is pushed low when the start of the race occurs. The sensors at the bottom of the track are phototransistors here when the light strikes the photo transistor. It turns it on grounding this point, putting a low on the port if the car blocks the light. This transistor turns off, and this resistor pulls the port up to 5 volts, giving me a one. This circuit is multiplied four times one for each lane. Also one for each lane is a bright white led for the light for the sensor to see.

I use one for each lane for a few reasons, one i can blink them in series or in order of finishing cars once for one first place twice for second. If people don’t want to actually hook a computer to the system and use it standalone to facilitate this, i have a transistor controlled by my digital output. When i have a digital output, that’s high, it turns the transistor on turning the light on. This also can be used to switch on and off the lights during a alignment procedure that i programmed into the ala mode to verify that everything’s lined up properly i’ll begin by making a replacement gantry.

Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby

I want all the electronics to fit in this gantry, so i’ll measure, the height that i need. First of the raspberry pi, then of the old shield board i’ll still use it. It still works and then for extra i’ll measure. The arduino that it’s already connected to to give me the height that it needs over the ala mode after the measurements are taken i’ll start cutting the pieces. I need for my gantry.

Projects with Ryan Slaugh: Raspberry Pi meets Pinewood Derby

First, i cut the width of the gantry itself, which is the same as the width of the track. I’M using poplar here, which is an easy wood to use and will make a nice finished product that’ll match the track. I then use my table saw to cut them to width.

This is measured to include the electronics at three inches i’ll, make the height the same, using some wood glue on each of the mating surfaces and then brad nailing them together. I complete the gantry once i have the ends in and wipe off a little squeeze out there with the glue i’m able to do a quick test fit with my raspberry pi. The width is fine and has plenty of head space for more electronics. The next pieces to be put on are the top and the legs of the gantry itself.

I like to use screws on all these, so i can take out the screws and pull the top off if i ever need to get to the electronics inside and if i need to change the leg height off the track. I can also do that as i’ve screwed them on here once the gantry is all finished, it’s a good replacement for the old one. Next, we mount the leds into the box. These are spaced at the exact spacing of the lanes themselves and centered along the box. So they match the sensors down below with the leds in this rough, in condition, there’s still the ability to adjust them when the gantry is first placed on the track before i’ll hot glue them in place, so they don’t move all right now, it’s time to tackle The electronics we want to take everything out of this old box and throw away what we don’t need: the switches and the wires, because we’re going to put new wires on everything start by desoldering, the old wires.

Again, i’m not using the old switches like the reset switch and the align switch, because it’s all software controlled. I decided to put headers on the top of my little shield board here to make it easier to remove all the electronic parts from the box once we have that the bottom looks pretty neat hooking the header pins into the connection pins or into the transistors on The top of the board plug it all in through the ala mode into the pi do a quick fit test and now it’s time to get the wiring done inside the gantry box. We add the 12 volt of 3 or 12 volt to 5 volt converter and start powering in the wall.

Wart, and here is a rough wiring, showing all the connections made and it’s time for a test. So i plug in the shield to the alamo to the pi and write a quick sketch through the pi using ssh or remote, desktop to blink. The leds on and off things are working well, not much changes on the bottom side of the board, except that we change out the old connector and put in a db9. The mate to this db9 will be cabled up to the gantry box, where i’ll connect to the shield, thereby providing the sensor input to the ala mode after drilling a hole in the side.

So we could route our ethernet cable to the computer connection and our cable for the db9, as well as the power supply and adding an appropriate paint job done by my wife. We have a finished gantry put all the electronics inside mount them securely button it up and there it is. Luckily, we were invited to a race to test the system out. So the race begins. Cars come down the track and they trip the light sensor. If we were to look at a serial, monitor and see what’s coming out of the ala mode, we would see this when the lever is dropped.

Activating the switch the ala mode reports race across the serial port, then once the cars cross, the finish line, the order in which they did so is listed in this case 3142. The number to the right indicates how many seconds it took from the start of the race to the finish for that car, and this is in milliseconds and then at the end, there’s end of race. If user wanted to, they could remote into the pi or ssh into the pi, and just use this to tabulate entries and calculate times.

However, they could also use a python written script or, like i did, use a custom made web server and interface here on the left. You see the cars that have raced or the car list, one through 16 in this case and the points they get for first place. It’S four second place three etc. If they have a zero listed here, it means they haven’t raced. Yet, in the middle column, there you see the fastest time and the car that posted it and over to the right.

You have this race and the alamo output would fill in the place that those cars achieved the next race and then, of course, on deck. So you can get things queued up and keep things going smoothly. Click the button to advance the next race to make the system ready for the starting gate and then exit the program with exit. Well, this project was fun to build and even more fun to use.

I hope it inspires you on one of your next projects with the raspberry pi, beaglebone, black and or arduino happy building. .