Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with measuring speed of an object

Status
Not open for further replies.

dkw

New Member
Very new to this. Planning to use 2 beam-break lasers (IR transmitters & receivers) to determine speed of a ball. Crossing the first beam would start clock and crossing 2nd would stop. Distance is constant (6 inches). Output needs to be in MPH. Can calculation be programmed within the clock read-out or is it separate?

Is this the simplest way? I found velocity sensors (would obviate the need for an IR receiver) but they all seem to require a metallic object to trigger.

Thanks for any help!
 
A microcontroller (e.g. PIC) would have no problem resolving the time interval and converting that to a mph signal for driving a display. If you need help with programming it that should be available on this site. Simple IR transmitter-receiver pairs should suffice, rather than lasers, unless you need high accuracy and hence very narrow beams.
 
I come to a different conclusion:

1) You are very new to electronics; and
2) You want the simplest way.

While a microcontroller is a simple way for someone familiar with them, learning to program one just to determine the speed of an object with a beam-break device may not be so simple or cost effective.

About 17 years ago, my son needed to determine the speed of a pinewood derby car for the boy scouts. I used beam break with a couple of Radio Shack IR detectors and IRED's. The interface was a 2N2222 transistor (also Radio Shack) and the timer was an electronic stopwatch from a place like Walmart. The 2N2222 essentially grounded the start and stop buttons to give me a split time. A hand-held calculator was used to calculate feet per second based on the measured time to 0.01 second and the distance between the sensors. That is when my interest in hobby electronics was re-ignited. It is hard to imagine anything much simpler for someone very new to the field.

I can probably find the old circuit somewhere, if that is the route you want to take.

John
 
Last edited:
To make it direct reading (in mph), you could also use a digital counter kit as an up counter, with just the right frequency clock. 4 digits in the counter could be configured for a max speed of 99.99mph. Figure the clock rate thusly:

99.99mi/1hour*5280ft/1mi*12inches/1ft*1hour/3600sec = 1759.824 inches/sec

Since the goal posts are six inches apart, the time of flight between them is 6inches/(1759.824inches/sec) = 3.409431msec

To get 99.99 mph full scale, then you would need 9999 pulses in 3.409431msec, which is a pulse frequency of 2.9327466Mhz.

So you need to get a **broken link removed**, the counter kit, and the beam break detectors.

I would check to see what the response time of the IR detectors is. Definitely use rising-edge to rising-edge (not rising to falling or falling to rising).
 
Last edited:
I like your idea MikeMl. As a slight modification I would suggest you could use a standard frequency crystal, such as the 3.579545 MHz color oscillator frequency which is common and cheap, and just adjust the distance between the sensors (if possible) to give the desired MPH reading. For that frequency you would adjust the distance to 4.92 inches. Or you could divide that crystal frequency by two and adjust the distance to 9.83 inches.
 
Err...
Hold on a minute Mike, I may have missed something in your thinking, but, the "gate time" from the beam break sensors in inversly proportional to speed.

So if 100MPH is 3.4mS, then 50 MPH is 6.8mS.
Using this as the gate time, the slower object will give a higher reading.


What is needed is the inverse of the count.

JimB
 
Very new to this. Planning to use 2 beam-break lasers (IR transmitters & receivers) to determine speed of a ball.

What type of ball? Some assume it is a baseball.

How fast will it be moving?

What accuracy and precision do you need?

For example, if it is a baseball (3" diameter) and going 100 mph, it will take 1.7 mS to cross a point and 3.4 mS to travel 6" . (I know similar calculations were made above.)

IR detectors, such as the TSOP 4338 (https://www.electro-tech-online.com/custompdfs/2012/11/tsop45.pdf) are fairly fast, but do take a finite time to respond. That response time is given in the datasheet as multiples of the base frequency (i.e., 38KHz). For the TSOP it is about 3 to 9 cycles (79 µS to 237 µS). How much jitter is there in the detection times? We don't know, but lets assume its 160 µS (0.16 mS). It is quite obvious when transmitting data that there is jitter.

That could be a 9% error from start and stop errors over the 6" travel distance. That's the difference between a major league and minor league player. ;)

If it is a soccer ball, then that is a different story. Remember, though, that the ball will likely not pass the sensors exactly on its diameter every time.

Can you move the sensors further apart to give you more time so such errors are not such a significant part of the expected time (time of flight)?

John
 
Last edited:
Thank you alec_t, jpanhalt, MikeMI,crutschow, JimB these are all very helpful!!

Follow up question:

John - your point about the error/variability is critical. The 6” is probably the max distance and 9% error/variability is unacceptable for my application. Yes, it is a 3” diameter baseball. Speeds will vary between about 50MPH and 100MPH.

What are my options? Could the 3” be addressed if I went the microcontroller/PIC route? (I realize it would be a somewhat circular calculation as total time from beginning to end of ball would also depend on speed). A different/faster receiver? Other ways to improve the error factor?

Also, if there is a bat following the ball through the brake-beams, what is the best way to address this so that it does not get measured or interfere with the determination of the ball speed?

Again, thanks so much for all the expertise, this forum is amazing!
 
dkw,

Doppler radar/ladar are teo other options. Doppler sound would introduce more significant variables.

As for beam break, the potential problem that I outlined has to do with the receiver. Modern IR receivers use some sort of noise cancellation (it is described in the datasheet I linked to). Basically, it takes time for such receivers to tell noise from signal and the minimum for that is 3/frequency of the carrier. In other words, it would need to see absence of the modulated IR carrier for 3 cycles before calling it signal; however, that time can be as long as 9 cycles.

One way around that would be simply to use a photodiode or phototransistor and a steady IR beam. You could address the problems of interference from environmental IR by physical design. It is not as good as electronic noise filtering, but it can work. Basically, think of putting the receiver at the end of a long, IR opaque tube. That would keep any stray light out, but allow the aimed light to be sensed. One downside is that the IR source and detector will have to be relatively close together and/or you will need a more powerful or focused IR source than if you were using electronic filtering.

Second question about the bat can be addressed by blanking or not starting any count/beam break occurring within xx mS of the first. That can be done with a microcontroller or something as simple as an NE555. In other words, you simply look at the first start sigal and the first stop signal.

John
 
Last edited:
Err...
...
What is needed is the inverse of the count.

JimB

Of Course you are right. No point in being stupid unless you show it...:(

It is back to the PIC. It can do the inversion. Mr RB, where are you when we need you...
 
Last edited:
Great! Thank you again!! The photodiode or phototransistor may work as the IR source and receiver will be within 10-12". I will do some more research and try to make some headway. Very much appreciate your thoughts and experience!
 
Deleted
 
Last edited:
...
It is back to the PIC. It can do the inversion. Mr RB, where are you when we need you...

Lurking... ;)

I would use any cheap PIC, run the timer at 1MHz (ie 4MHz PIC xtal), so 1uS per timer tick.

Start timer on first pulse and stop timer on the second pulse, recording timer overflows so the result is an elapsed period in uS, in an unsigned 32bit variable.

If the sensors are 1 foot apart then speed in feet per second is given as one simple division;
speed = 1million / period

or if you want reading in tenths of feet per sec;
speed = 10million / period

then display it on the LCD or 7seg display.
 
Since the OP is using 6" for the gate and needs to measure 100 mph (approx. 3.40909... mS), I might use a processor with a 16-bit timer. We don't know the precision or exact range he needs yet. If he only needs ±1 mph over a limited range, then 8-bit could work with a lower clock frequency.

The OP did say he needed to measure 50 to 100 mph. I am not certain whether he wants only values in that range, or whether that is the expected range, and he wants values above and particularly below it, e.g., 25 mph. If he needs the lower speeds while maintaining accuracy at the higher range, then a processor with a 16-bit timer (e.g., 12F683) might be a better choice.

The real question is not selection from a group of similar processors, it is whether the OP wants to go down that path. I interpreted his last post to mean that he needs to do a little tinkering before proceeding.

John

BTW: For those not used to America's miles, furlongs, rods and feet, a nice equivalency to remember is that 60 mph is exactly 88 feet/sec.
 
Last edited:
I had a couple more questions on this project. Update - I am leaning towards using a 12F683 PIC, a CW laser and a fast photo diode (~20ns response time). Here are some follow-up questions:

1) I would like to explore the option of using just one beam. With a fast photo diode, a CW laser, and appropriate set 16 bit timer, would this work if the timer started at beam break and stopped when it was picked up again? (1.7045mS at 100MPH to travel 3"). If I want to measure values between a min of say 25 MPH and max of 120MPH (most will be 50-100MPH) what would be the best setting for the timer?

2) In terms of pairing transmitter/photo diode, I would like to be able to use this outdoors and indoors. Is there an optimal wavelength for this? Also, in terms of safety, I would prefer that the beam is visible. Would these goals be mutually exclusive or is this possible? Also, the transmitter I'm looking at has a power of 5mW (CW). Would this be sufficient to trigger the sensor from about 10"?

Thanks again for all the help!
 
I had a couple more questions on this project. Update - I am leaning towards using a 12F683 PIC, a CW laser and a fast photo diode (~20ns response time). Here are some follow-up questions:

1) I would like to explore the option of using just one beam. With a fast photo diode, a CW laser, and appropriate set 16 bit timer, would this work if the timer started at beam break and stopped when it was picked up again? (1.7045mS at 100MPH to travel 3"). If I want to measure values between a min of say 25 MPH and max of 120MPH (most will be 50-100MPH) what would be the best setting for the timer?

Don't understand that question. 16 bit should suffice.

2) In terms of pairing transmitter/photo diode, I would like to be able to use this outdoors and indoors. Is there an optimal wavelength for this? Also, in terms of safety, I would prefer that the beam is visible. Would these goals be mutually exclusive or is this possible? Also, the transmitter I'm looking at has a power of 5mW (CW). Would this be sufficient to trigger the sensor from about 10"?

Thanks again for all the help!

The Sun is pretty broad spectrum. There is no perfect wavelength. Use what is available. Take care of environmental interference with geometry as suggested.

How predictable will the trajectory be? You may want a vertical linear array of detectors and record first break.

John
 
Using single beams could cause large errors. A ball that goes through one beam in the middle but only clips the other beam could have an error as large as 25% (1.5" in 6"). Moving the sensors further apart will reduce this error or, as John suggested, an array of sensors would work but both these solutions assume the trajectory is known.

If a microprocessor is used then the break time and elapsed time could be used to determine which part of the ball broke the beams. This in turn can be used to reduce the error.

Mike.
 
@Pommie,

Measuring the time for breaking, as you suggest, would be a good addition. If you know the top of the ball breaks both beams, then you can estimate the trajectory. But, you can't distinguish that from a trajectory in which the top breaks beam 1 and the bottom breaks beam 2. Maybe a combination of sensors in a vertical array plus measuring the time for beam breaking at each gate would give the needed accuracy.

And then, there is the third axis to deal with...

Maybe dkw can give more insight into how the hits will be standardized.

John
 
Thanks for the input. Not getting too specific about the device, there isn't really a good way to control for both horizontal and vertical variation of hits. The device (structure) will control the vertical to a large degree so all I'm interested in reducing error is the horizontal.

In thinking about the 1 sensor, I think you are absolutely right Mike that there will be too much variation. My reason for wanting to limit the number of sensors was due to the likely difficulty in keeping them lined up within the structure over time - setting that issue aside for now.

I'm thinking about a possible 3 sensor triangle so that angle going thru the beams could be estimated. The 1st sensor would be barely outside the leading edge of the ball and then 2 sensors lined up (in parallel) 3-4" from the 1st one. Considering the possibility of removing the 1st sensor and starting the timer based on contact w/ a sound sensor. The speed would then be estimated (from sound to 1st triggered sensor) and then refined based how fast and what angle the ball travels thru the parallel sensors.

Thanks again for all the help! If there are any thoughts on starting the timer based on sound that would be great also. I'm trying to get reasonable accuracy with the least number of sensors.
 
On second thought (I need to get out the math books), I think I may be able to determine speed and approximate angle with only the two parallel sensors??
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top