# Speed & Proximity Sensor

What I am interested in is a device that can measure how fast a bowling ball is traveling and how far the ball is from the sensor as it passes by. The sensor would be placed on one side of the lane perpendicular to the lane. I imagine two light beam sensors for speed, and and ultrasonic sensor for distance.

I'm mainly a software guy, and I'm new to arduino. Don't hesitate to talk about hardware as if I'm a complete idiot.

Is there any reason this cant work?

I did something similar with rolling a marble down a ramp. I had a LED on one side and a phototransistor on the other. And another pair further down. You can detect the time differences and turn that into speed (assuming you know how far apart they are).

The bowling lane would be wider but perhaps a little laser pointer on one side hitting a LDR on the other would do the trick.

The code is pretty trivial.

... how far the ball is from the sensor as it passes by ...

You know that, don't you? Adjacent to the sensor.

My thought was to place the light sensors to measure 2" of travel, then use that speed to determine when to trigger the ultrasound device so it will measure the distance to the middle of the ball.

I want to measure speed in the X direction and the distance in the Y direction

That way the ultrasound device will trigger later when the ball is slow, and sooner when it is fast.

I was also thinking of keeping all of the electronics on one side of the lane and place small mirrors on the other side to reflect the light source back.

Will the real Werner Heisenberg please stand up?

JimboZA:
Will the real Werner Heisenberg please stand up?

They say brilliant minds think alike, and sometimes a blind squirrel finds a nut.

I assume you are referring to the position, momentum issue, and not the observer effect.

You know that, don't you? Adjacent to the sensor.

In one dimension yes, but from this:

I want to measure .... the distance in the Y direction

... that sounds like wanting to know where the ball is into the width of the lane?

I assume you are referring to the position, momentum issue, and not the observer effect.

Of course

You would need to do a quick and dirty calc (if you didn't already) to check the worst case of a fast moving ball right over on the far side from the ultrasonic sensor.... will the ball still be there when the ultrasonic pulse gets there? (If I get you right, that the y-dimension is the width of the lane?)

There's a library over in the Playground....

JimboZA:
You would need to do a quick and dirty calc (if you didn't already) to check the worst case of a fast moving ball right over on the far side from the ultrasonic sensor.... will the ball still be there when the ultrasonic pulse gets there? (If I get you right, that the y-dimension is the width of the lane?)

There's a library over in the Playground....

Ok the lightbulb is now on.

The sensor claims to fire off 8 pulses at 40khz. If I time it right the 1st pulse would be set to hit the center of the ball if it is on the far side, and a subsequent pulse would hit the center if the ball is on the near side.

If multiple echoes are received, does the device return the closest, furthest, or whatever it feels like returning at that moment based on the phase of the moon?

Yes the Y dimension would be the width on the lane plus a known amount since the device will be placed a safe distance from the edge of the lane.

It sounds feasible, given that you can measure the longitudinal speed as it passes the light beams and time the ultrasonic pulse accordingly. I don't know how reliable an ultrasonic sensor would be with a bowling ball (the curved surface is probably not a good reflector and you may be in a noisy environment) but that's a separate issue.

Can you ignore spin for the purposes of your problem? It's usually relevant for bowling, but much harder to measure than speed and position.

If the ultrasonic sensor proves unreliable for measuring distance to a spherical, moving object, it would be possible to create 39 diagonal light beams and 2 perpendicular beams. The two perpendicular beams would detect speed, and based on the pattern of diagonal light beams broken at the moment the timing beam is first broken the distance of the ball from the side of the lane can be determined. The part I'm not too clear on is how to interface 39 inputs.

Is this also possible?

Some port expanders could do it for you. For example:

http://docs.macetech.com/doku.php/centipede_shield

That could be configured for 64 inputs, and you can get an interrupt when any of them change logic levels. It's based on the MCP23017 if you wanted to make it up yourself. Each chip can have 16 inputs or outputs, and communicates via I2C (or you can get an SPI version).

It only needs one diagonal beam (and the two perpendicular beams), surely?

This just keeps getting better and better.

If the beams crossed the lane in a shape of a capital N, assuming left to right motion, the time from the first beam to the diagonal beam would be proportional to the distance of the ball to the far side of the lane.

Ok if I set this up so every time a beam is broken an interrupt is called, the 1st thing I would do is read the micro() and save it based on which beam is broken (or just keep a running count) that way when I have all 3 readings, the calculations would be fairly simple.

I figure the low end I would measure is 5mph, at a 4" gap that would give a difference of about 45454 microseconds, and a high end of 30mph, 7575 microseconds.

Thank You, Thank You, Thank You