Honestly I was cursing quite a few times during the construction of this barrel, since the space inside of it is kind of restricted. If you are looking for an easier method, just use a pvc tube and glue the components to the outside of it.
I ended up loving the barrel, since it makes sure that the Nerf darts fly straight through it ever time.
Step 1: Stuff You Need
- SAA 1064 7-segment driver
- 2 x NPN transistors (z.B. BC547)
- 2 x IR LEDs (Osram LD 274-3)
- 2 x photo transistors (SFH 3100 F)
- 16 MHz quartz
- 1 x 4.7 uF Capacitor
- 1 x 1 uF Capacitor
- 1 x 2.7 nF Capacitor
- 2 x 22 pF Capacitors
- 1 x 22 kOhm Resistor
- 3 x 10 kOhm Resistors
- 2 x 220 Ohm Resistors
- 3 x 7-segment displays
- Nerf barrel
- modelling clay
- sanding paper
- JB weld
Step 2: Attaching the Leds
Once you have marked the hole and are sure, that it won't interfere with the function of the barrel, drill the holes. You will have to drill two holes for the photo transistors (you will see what I mean, when you take a closer look at it).
Attach wires as shown in the second picture and use a third hand to hold the LEDs in place. It is important, that they don't reach into the barrel, else they will slow down or even stop the Nerf dart. Once you found the right position use JB Weld or an other type of strong two component glue, to hold them in place.
Step 3: Modifying the Barrel
Use sanding paper to even the surface. Carefully drill a hole for the segment display. I used diamond files to get them to fit perfectly.
Depending on the size of your battery compartment you might have to mill some of the plastic away, as shown in the third picture. Furthermore you will have to remove parts of the middle rail to fit the wires and drill a hole for the button (as shown in the sixth picture).
If you want you can paint the barrel, but that's up to you.
Step 4: Electronics
When a dart passes the light barrier blocking the IR-LED the current drops instantly to zero. At this time the micro controller starts counting the microseconds until the second LED is blocked. As we know the distance between the LEDs we can calculate the dart speed.
The value is send to a LED driver chip (SAA 1064) to display it on the seven segment display located on the side of the barrel.
I used an Arduino UNO to upload the following code to the Atmega: