Ball Speed trap system

Hi,

I have built a speed trap that measures the speed of a ball between two VL53L1X sensors.

The setup is a tray 660 mm wide and 300 mm long, with 50 mm high sides. The sensors are mounted on the sides so the ball passes through a fixed gate.

Hardware:

  • Arduino Nano 33 BLE

  • 3.7 V battery with boost board

  • Bluetooth app that records and displays the speed

The system works well when I pass a flat object through the gate. However, when I use a ball, the readings can vary randomly.

The ball rolls over carpet through the tray at no more than about 20 km/h. I have spent weeks adjusting the loop timing, trigger values, and code filtering, but I still cannot get consistent results.

My question is:

Is there a better way to reliably measure the speed of a ball passing through a 660 mm wide gate?

I am considering a laser/receiver or IR beam-break setup, but I’m open to any simple and reliable options.

Any ideas would be much appreciated.

Hi Dale
Welcome
The shape of the detected object obviously has something to do with this.
It would be a help if we knew what sort of detecting system you currently employ. That would eliminate such a system as being unsuitable without duplicating effort.
If it is some sort of reflecting system the ball shape could be very iffy as it will only reflect anything at a very small point it its travel. A beam break detector might be a better and more reliable alternative.
Cheers Bob

Thank you for your reply. I am currently using two VL53L1X sensors one metre apart. They are normally used for measuring distance. So the code is looping until it seeing a shorter distance. Then it flags second sensor to do the same. I time stamp the first instance of short distances and calculate speed. Works very well untiL It doesn’t.

So the beam breaking solution would seem to be a better option. Just wanting if anyone has successfully done something similar. Looking for advice on what would be the best laser light and receivers to test the theory. Cheers

Hi Dale
That sounds like a hell of a complicated way to tell if an object has passed a certain point and ultimately calculate speed. I am a firm believer in the KISS principle so I generally look for the simplest way out. Seema to get more reliable results if you can minimise complexity.

I have not used anything like this for a number of years but I think the “sensor” comes complete with transmitter and receiver as one complete system.

If you only want to measure the speed I am sure there are “Time of Flight” sensors that will do this. The only complication here is that the sensor would have to be looking directly at the object and the spherical ball might not be the best target object. Due to the shape the radio reflection might be minimal. If you did this you should only need 1. You seem to presently be using 2.

The up side of a break beam sensor is that the lateral position of the target would not be particularly critical.
Cheers Bob

It’s in my DNA to make simple things difficult. It is very simple what I am trying to achieve. I need to be able to calculate the expected distance of a ball being rolled in a controlled environment. I have a gap of 660mm wide that I roll the ball through and need to capture the speed of the rolling ball so I can calculate expected distance. Currently I am using two sensors to capture the timestamp as the ball passes. Now looking for alternatives

Hi Dale
Haven’t asked this yet
Just how big is this ball ?? Is this ball going to be the one size ??
Cheers Bob

I suspect anything that relies on something bouncing off a sphere will be a challenge.
From a google, the said to keep that sensor at the shortest distance for sphere, but even then it may not work or repeatable/reliably work.

the key issue is the sphere (ball) depending on its texture will scatter the beam as such it may not get enough back to trigger.

My thought would be to place the sensor at a high 1/2 of the ball diamater.

this sort of thing (in my mind) and the “best” signal should be around the center, the leading edge may be missed

1 Like

Hi Dale,

Welcome to the forum!

Michael and Bob are on the money here — anything relying on reflection from a sphere is going to be a bit fussy, especially with texture, ball surface, angle, and where the ToF sensor happens to “see” the curved surface.

For this job I’d move away from distance sensing and use two beam-break gates spaced a known distance apart. The Arduino only needs to timestamp gate 1 broken, then gate 2 broken. At 20 km/h the ball is moving about 5.6 m/s, so even a 70 mm ball blocks the beam for roughly 12 ms - plenty of time for a digital input if you use interrupts.

This project by Matt could be of great inspiration: https://core-electronics.com.au/projects/ir-break-beam-stopwatch/

Keen to see how this comes together!
Liam

Hi Liam

The current setup I created work well over 300mm which is disappointing but this link is exactly what I needed to point me in the right direction . The reflector idea in brilliant and solves the problem of not having an extra cable for receiver. Also I have been told that the beam sensor being used in this example would only cover 500mm yet he is squeezing 2 metres out of it.

I will get new hardware today and get to work.

Bob the ball size could vary from golf ball to bowling ball so I think the laser beam will cater for everything if mounted low.

Hi Dale

With tat sort of size variation I don’t think a reflective sensor would work. This type really should be “square on” to the target, impossible to achieve with varying size spheres. Also as the ball goes past the actual amount of light reflected will change depending on the angle of the surface at any one time so the actual “detected” position could vary with sensitivity and the actual detected point would be very difficult to determine so speed measurement could be pretty meaningless.

With a break beam sensor the beam is either there or it is not so I reckon greater accuracy would be achievable.

So in relation to reliability I think that a break beam sensor would be the way to go. You will have to live with the extra receiver wiring.

As for distance ??? Break beam sensors that are happy across a driveway for garage door opening and closing are pretty common as are sensors that operate over a couple of centimetres. I am sure that within that sort of range there would be one that meets your requirements.

I think there is another type that is essentially a beam break type but uses a reflector panel instead of a receiver to reflect the beam and the receiver is co sited with the transmitter. It does not depend on reflections from a target but in effect the beam is broken both ways.

I think that whichever way you choose to go to be really effective past a few cm the TX and RX need to have a lens or the beam will be likely too wide.

There is quite a bit of info here

The ones of interest on this particular site are laser types. It is not indicated but might be a bit dangerous for your application. I would suggest just using this to get some ideas and look at infra red beam types as being less dangerous optically. These being Telemecanique devices will probably be pretty (read very) expensive but might provide ideas.

For instance if you don’t want to add extra receiver wiring it might be possible to co site the TX / RX units like one directly above the other or alongside very close and fit a mirror or similar reflector on the other side. You would need devices with lenses do narrow the transmission and receiving beam.
Cheers Bob

Been into electronics for a solid two weeks now and only with your help I have created the most excellent speed trap. I went to jaycar and bought a $6 red laser diode. Receiver 1.90 and resistor . Simple loop of code and I’m pushing out 0 1 reliably over 2 metres using my hand quickly passing through beam.

Wired receiver up to nano board and laser to boost board that charges battery . Total setup under $20 excluding boards. I would think this would work over 5 metres no trouble.

Could be a simple solution to any trigger for doors or alarms.

Still need to mount properly and test with ball, reflector and on battery but i’m very confident with what I have tested I’m on a winner.

Thank you everyone

Hi Dale
It is still a bit unclear (to me anyway) EXACTLY what you are doing here. With a simple set up using 2 beams a known distance apart to measure time and thus speed has some limitations.

If measuring several ball speeds ball A would have to enter AND LEAVE the “trap” area before ball B enters and B has to leave the trap before ball C enters and so on. This is required as there is no way to identify individual balls. You can only say “a ball has passed this point” and “the ball has passed the second point” and calculate the speed knowing the elapsed time and fixed distance.

If it is a “one ball at a time” situation then all is good. If however there is a need to have several balls rolling through the “trap” or measurement area at once some serious further thinking I believe would be required.

Just thought I might throw this in. If you had thought through this scenario please disregard.
Cheers Bob