For some contracting work this summer, I built some laser gates for detecting the transit of a baseball/softball at up to 135 miles per hour. The Teensy 4.1 has been an incredible board for getting the timing down. The design is made up of 4 emitter boards (no Teensy) and 4 sensor boards (one Teensy on each). Each emitter board has 34 laser diodes that can be aimed using three set screws. Each sensor board has 34 transimpedance amplifier circuits for a PIN photodiode. Using a validation fixture with a tightly controlled rotational velocity setup, I am detecting the point that the beam begins to be broken and the beam being restored to within about 3.75 microseconds.

Each detector board is connected to a Raspberry Pi4 over i2c, with a trigger to start the timing sequence just before the cannon fires the ball. Then, each Teensy polls the 4 ports that are connected to amplifier outputs as quickly as possible and stores the cycle counter time and the state of the 4 ports each time there is a change. After the completion of the firing sequence, a post-processing step unscrambles the ports into the bits that are triggered in geometric order. The RPi4 then retrieves all the timings and does a nonlinear least squares minimization problem based on the geometry of the ball's flight and the beam configurations to determine the incoming and rebound velocity.

Here is a photo of the boards mounted on the aluminum plates and a video of a shot from the cannon.

Click image for larger version. 

Name:	IMG_6130.jpg 
Views:	19 
Size:	178.0 KB 
ID:	21477Click image for larger version. 

Name:	IMG_6233.jpg 
Views:	25 
Size:	142.3 KB 
ID:	21478