Laser Timed Hot Wheels Drag Strip

by diltsjam in Circuits > Sensors

4563 Views, 49 Favorites, 0 Comments

Laser Timed Hot Wheels Drag Strip

IMG_2819.JPG
20210131_200158.jpg
Hot Wheels track Clamp.jpg

What kid wouldn't want to time their Hot Wheels or Match Box cars to see which one is fastest? I was playing Hot Wheels with the grandkids, you know, building a track from the upstairs family room to the downstairs kitchen. Then trying to figure out how to keep the cars on the track on the corner at the bottom of the stairs.

This led to talk of which car was fastest and the idea of laser timing started to grow in my mind. I started going crazy with elaborate ideas, but finally decided to start simple. A length of track with a starting laser and a finish line laser. I decided to make the track scaled 1/4 mile, like a drag strip. Since Hot Wheels are 1/64th scale, I made the track 20 ft. 7-1/2 inches, from starting gate to finish laser. (MATH: 1 mile = 5280 ft.; 1/4 mile = 5280/4 = 1320 ft.; 64th scale = 1320/64 = 20.625 ft.; and 0.625 ft. = 0.625*12 = 7.5 in.; our 1/4 mile track will be 20' 7-1/2" start to finish) So the project begins …

Supplies

You will need the following materials:

Tools

20210131_204047.jpg

The following tools are needed:

  • 3D Printer (or printing service -- the two .stl files are in step 3)
  • wire strippers/cutters
  • small Philips screwdriver
  • utility knife or x-acto knife

Preparing the Track

20210131_143643.jpg
20210131_143717.jpg

We need the starting gate and about 25 feet of track with connectors. First, connect about 25 - 30 feet of track and put the starting gate at the beginning of the track. Lay the track out straight on the floor with a tape measure beside it. Line the end of the tape measure up with the starting gate and mark the track at the 20' 7-1/2", as shown in the pictures. This line will be the location of the finish line break beam sensor. As I mentioned in the introduction, this is 1/64th scale of a 1/4 mile track. First step complete. That was easy!

Assemble Break Beam Sensors on 3D Printed Parts.

20210131_144745.jpg
20210131_144908.jpg
20210131_144956.jpg
20210131_145231.jpg
20210131_145357.jpg
20210131_145623.jpg

There are 2 parts that need to be printed on a 3D printer, I used PLA. If you have a 3D printer, you can print them, or you can have them printed by a 3D printing service, or possibly a friend. The .stl files are included here. After you have the 2 parts printed and cleaned up, we need to install the break beam sensors in them. These mounts will be assembled to the track with the towers toward the finish line.

The break beam sensor can work on 3.3v or 5v. In this project we will use 3.3v, because that is the power we can get from the GPIO pins on the Raspberry Pi. You will see that there are 2 parts to each break beam sensor. The part with 2 wires is the IR emitter or transmitter. The black wire is ground and the red wire is power. The part with 3 wires is the receiver. The black wire is ground, the red wire is power, and the white wire is the signal wire.

Now let's install the sensors in the gates (printed parts). When I refer to direction on the gates, it is with the towers in the back. Let's assemble the finish gate first (the smaller one).

  1. Install the transmitter (2 wires) on the right first. Install the black wire in the front right hole and the red wire in the back right hole.
  2. Pull the wires down snug and screw the sensor to the gate with a #4 x 1/2" flat head screw.
  3. Now for the receiver, install the red wire through the front left hole,
  4. then install the black and white wires through the back left hole.
  5. Pull the wires down snug and screw the sensor to the gate with another #4 x 1/2" flat head screw.
  6. Repeat steps 1 - 5 for the starting laser gate.

Next, lets prepare the wires.

Making Up the Wire.

20210131_155354.jpg
20210131_151757.jpg
20210131_152124.jpg
20210131_152416.jpg

First, you need to prepare the wire. Cut a piece of cat5e wire about 35 ft. long and strip sections of the cat5e wire as described here. (Three wires are needed for each set of break beam sensors. I used cat5e because it has eight wires and I always have plenty around. Because there are two extra wires, I twist the white wires in pairs.)

With your wire strippers or utility knife, score the outer cover on the wire about 4" from each end (see first photo) and remove it. Mark one end of the wire "PI" and the other end "FINISH." Now mark a spot about 25 ft. from the end you marked "FINISH" and strip a section about 4 in. long. In this center section of the wire, separate out the green and blue pairs of wires, and cut them on the side toward the end marked "FINISH."

On the end of the wire marked "FINISH," cut off the blue and green pairs next to where the outer cover was stripped. Now, untwist the orange and brown pairs on the "FINISH" end and strip about 3/8 inch on each wire, then twist the two white striped wires together. Untwist the blue and green wires in the center section of the wire, strip 3/8 inch of each wire and twist the two white wires together. Now, on the "PI" end of the wire, untwist all four pairs of wires, strip 3/8 inch on each wire, twist the orange-white and brown-white wires together, and twist the blue-white and green-white wires together. Now, it's time to connect all the wires.

Make the Wire Connections.

20210131_155748.jpg
20210131_160014.jpg
20210131_160424.jpg

For everything to work when completed, the wiring connections and which wires are connected are very important, so be sure you connect the right colors and make sure the connections are good.

Finish Line Laser Gate: Make three wire connections on the end of the wire marked "FINISH:"

  • Connect both black wires to the two white wires with a small wire nut.
  • Connect the two red wires to the orange wire
  • Connect the white wire to the brown wire.
  • Slide the Finish Laser Gate on the track with the mark you made, with the sensors away from the Starting Gate and lined up with your 20' 7-1/2" mark.

Starting Line Laser Gate: Make three wire connections where the wire was stripped in the middle:

  • Connect both black wires to the two white wires with a small wire nut.
  • Connect the two red wires to the blue wire
  • Connect the white wire to the green wire.
  • Slide the Starting Laser Gate on the starting gate, with the sensors toward the track.

Jumper Wires: Make six connections to the bread board jumpers, so they can be plugged into the Pi. Each wire has a specific purpose, so the colors are important for remembering which wire is which. Use 2 black jumpers, 1 blue, 1 green, 1 orange, and 1 brown. Wire nut the wires to the male pin on the jumpers:

  • blue-white and green-white to black jumper
  • orange-white and brown-white to black jumper
  • blue wire to blue jumper
  • green wire to green jumper
  • orange wire to orange jumper
  • brown wire to brown jumper

Finally, let's make all the connections to the Raspberry Pi.

Connecting to the Raspberry Pi.

20210220_162721.jpg
Raspberry-Pi-GPIO-Header-with-Photo.png

First, the Pi needs to be powered down and unplugged from power whenever connections are made or changed on the GPIO pins. The GPIO pins specified are the one's assigned in the software, so if different pins are used, the pin names would have to be changed in the program.

Make sure to make the correct connections as follows:

  • Connect one Black jumper to Pin 6 - ground (all the GPIO grounds are the same ground, so it doesn't matter which black wire).
  • Connect one Black jumper to Pin 14 - ground
  • Connect the Blue jumper to Pin 32 - GPIO 12
  • Connect the Green jumper to Pin 33 - GPIO 13
  • Connect the Orange jumper to Pin 36 - GPIO 16
  • Connect the Brown jumper to Pin 11 - GPIO 17

Now, assemble the track and it's time for the software.

Install the Software.

RaspberryPi4.jpg

If you need to setup your Raspberry Pi, the Raspberry Pi website has this link: Setup or there are several instructables that will help. I use VNC Viewer, so I can run the Pi remotely, from my laptop. You can learn to set it up with this link.

When you have your Raspberry Pi running, it will need to have the programming language, Python 3 installed. Python 3 is installed as part of the newer versions of the Raspberry Pi OS. To find out if it is installed, open a terminal window (the black square icon on the toolbar) and type "Python3" ENTER.

If it is installed, you should receive a response like this:

Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Type Ctrl-D to exit Python3.

Download the file DragStrip.py and save it in the "/home/pi/Documents/Python Code" directory.

Now, let's run this thing!!!

Downloads

Time to Race!!!

IMG_2814.JPG
IMG_2829.JPG
IMG_2843.JPG
DragStrip-py Output Screen.jpg

Open a terminal window (the black square icon on the toolbar) and change to the directory where you placed the downloaded file. When you open the terminal window, you should be in the "/home" directory, which is the default. Type the following at the prompt and hit ENTER :

cd "/pi/Documents/Python Code"

This should put you in the directory where you copied the file. The double quotes must be used if there are spaces in the path name. You can type "dir" at the prompt and hit to see a list of the files and directories in the current directory. In the list, spaces are replaced with "\ ". To run the program file type the following at the prompt and hit ENTER:

sudo Python3 dragstrip.py

When the program is running, first it will ask the length of the track in feet and inches separately. If the track is like the instructions, type "20" for feet and then type "7.5" for inches. After the track length is entered, before each race the program will ask the length of the car in 16ths of an inch. For example, the car I have been using is 2-11/16 inches or 43 - 16ths of an inch, so I enter "43" for the length of the car. The length of the car is used to accurately calculate the speed. Then you are ready for the race. Place your car in the starting gate, hit ENTER to let the program know the car is staged (in the starting gate), and push the release button. You will receive a response like this:

Finish Time = 2.133 seconds

Average speed was 6.59 mph

Average scale speed was 422.0 mph

Finish Line speed was *** 6.04 MPH ***

Finish Line scale speed was ********** 386.37 MPH!!! **********

Then you will receive the prompt for the length of the next car. Enter "100" to quit.

I hope you enjoy this project. I will be working on added features, like two tracks and a drag racing Christmas tree. If you like the project, please vote for it in this contest. Thank you and have fun!