Speed trap timer accuracy

Hello, I am looking for coding advice and example code of possible.

I want to measure the muzzle velocity of an air rifle. I have optical sensors that change state low to high when interrupted. Set of 2 pair of light source and detector each trap 6" apart. This part is not the issue. I want to use a rp2040 pi pico. Fro
m reading around the net, the micros doesn't return a decent accuracy. Not sure if this is true or not. I want to measure 6" of travel at 1500 ft/s. It should be sufficient using micros. Is there a better way of getting high accuracy and repeatability in the code?

Thanks, Nick

It is no problem to time an event of duration 333 usec to about 1% accuracy using the micros() function, and if higher accuracy is required, there are much better and faster approaches to event timing.

The real problem will be obtaining a clean, fast transitioning signal from the two optical gates, as the pellet passes through them. So solve that first.

2 Likes
  • Does the rp2040 pi pico have a programming forum ? :thinking:
1 Like

I have the gates working.

Please post an oscilloscope trace showing the nice, sharp signals generated by a pellet passing through the assembly at 1500 fps.

A closeup pic of the gate assembly would be a bonus.

without additional hardware, i don't believe using a processor running on OS will be able to respond quickly to an I/O event. you'd be better of with an Arduino

While that may be true, I don't think the Raspberry Pi Pico runs an OS by default.

Are confusing the Raspberry Pi Pico with a Raspberry Pi?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.