0

Need Break Beam Sensor With FAST RESPONSE for Near Mach 1 Pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Need Break Beam Sensor With FAST RESPONSE for Near Mach 1 Pi

by maesoph on Fri Jan 12, 2018 9:43 pm

Fair warning: Mechanical engineer here... I know just enough electronics and software to be dangerous.

Had to make a ping pong ball cannon (who could resist?) and having an issue with sensor response time on my home made DAQ system. Using the standard 3mm OMRON Adafruit sensors. Write up and pictures attached.

Bottom line is that I need a break beam sensor with extremely fast response time.

Enjoy.
Attachments
Overview.pdf
Basic summary of data acquisition system for measuring speed of near Mach 1 ping pong ball. Would like a better sensor to give output closer to expected "square wave" pattern.
(362.74 KiB) Downloaded 5 times

maesoph
 
Posts: 22
Joined: Thu Mar 03, 2016 9:04 pm

Re: Need Break Beam Sensor With FAST RESPONSE for Near Mach

by dlleigh on Sat Jan 13, 2018 7:04 pm

The Adafruit sensor that you're using isn't operating quite how you think it is. If you read the web page and look at the data sheet (I know, it's in Chinese), you'll see that the response time for this device is only specified as "less than two milliseconds". That's far too slow for your application.

From the graphs in your linked PDF, I would venture to say that the turn-on response (the output going low) of this device is actually pretty fast. Even so, we don't know anything about it's delay before responding, nor how much error there is in that delay for each measurement. However, the graph clearly shows that the turn-off time has a substantial delay. As you mentioned, the duration of the flat part of the output is too long given the diameter and speed of the ping pong ball.

That flat part of the curve is not the result of no light reaching the sensor because the ping pong ball is blocking the transmitter. It is the result of the light level going below some threshold and saturating some circuit inside the sensor, and thus turning on a transistor and driving the output low. After light starts hitting the receiver again, that circuit has to come out of saturation and turn off the transistor, which takes a little while -- about a millisecond according to your graphs. The upward-going curve after the flat part is the RC time constant due to the combination of your pull up resistor and whatever capacitance is seen at that node.

The digital nature of this sensor is confusing you. You would have an easier time with a sensor that has an analog output, especially if it were much faster than the one you're using.

I suggest this one: https://www.digikey.com/product-detail/en/ams/TSL252R-LF/TSL252-R-LF-ND/

It has a turn-on/turn-off time of around 7 microseconds, which is well matched to the sample rate of your DAQ system. It also has an analog output so that you can see what's really going on with the light. You can hook it up in a fashion similar to your existing sensor (three pins: Vcc, ground and voltage output), and it can run from 3V to 5V. These parts are about $3.50 each from Digikey.

At 300 meters per second, your ping pong ball would travel about two millimeters in seven microseconds. The temporal resolution of the signal is actually better than 7usec because that is the spec for the output rise time, from a 10% signal level to a 90% signal level. If you had a faster DAQ system, you would be able to see detail even finer than that.

I've used these parts before and found them easy to work with.

dlleigh
 
Posts: 46
Joined: Wed Jan 30, 2013 8:08 pm

Re: Need Break Beam Sensor With FAST RESPONSE for Near Mach

by maesoph on Sat Jan 13, 2018 10:26 pm

Thanks for your reply! I did post a "fair warning" that I was a mechanical engineer, not a real engineer. LOL

The sensor you recommend has 0 stock - how about this one?

https://www.digikey.com/product-detail/ ... ND/3095044

Looks the same to me, but again - Lug nut here.

maesoph
 
Posts: 22
Joined: Thu Mar 03, 2016 9:04 pm

Re: Need Break Beam Sensor With FAST RESPONSE for Near Mach

by dlleigh on Sun Jan 14, 2018 3:43 pm

Yeah, that one's too slow. It has a 70 microsecond response time instead of 7 microseconds.

The 250, 251 and 252 models are identical except for the feedback resistor in the transimpedance amplifier. The higher that resistance, the more sensitive the amplifier, but the slower it reacts. The 252, which you want, is the fastest but the least sensitive. You don't care about high sensitivity because you're shining a light directly onto it from a couple of inches away.

You could build your own from parts, but that gets tricky.

I looked at what else is in stock at Digikey right now. This one has a 28 microsecond typical rise and fall time, with no worst case specified: https://www.digikey.com/product-detail/en/texas-instruments/OPT101PG4/296-36066-5-ND/.

This one claims to have a a 10 microsecond typical rise and fall time, with 22 microseconds worst case: https://www.digikey.com/product-detail/en/melexis-technologies-nv/MLX75305KXD-ABA-000-SP/MLX75305KXD-ABA-000-SP-ND/. It is in an SO-8 surface mount package. That may sound tricky to a non-EE, but it's really pretty easy to connect to. Adafruit sells adapters that would make the job very easy: https://www.adafruit.com/product/1212. The problem with this part is that it doesn't have a true voltage output, just a current output that you have to change to a voltage with a resistor. That resistor will have two problems: it will create a low-pass filter with whatever capacitance is attached at that point (mostly the input to your DAQ system), and it may have a lower output voltage than you would be expecting. A lower resistance value here would create a low pass with a higher frequency cutoff (good), but with a lower voltage output.

Your best bet is probably to use what you have now until the 252 comes back in stock. Or look for a different vendor that might have some laying around. Or call the company and try to get a few samples.

One speedup tip for these sensors is to not shine too much light on them. That saturates circuitry inside, which could cause delays. Larger signals also take longer because of finite bandwidth and slew rate concerns. Your best bet is to shine just enough light on the sensor so that it is above both the ambient level as well as any noise in the sensor. That way, when the ping pong ball blocks the light, the sensor's output signal doesn't have to go very far, and you'll get more precise measurements of the beginning and end of the "eclipse".

Let us know how it goes.

dlleigh
 
Posts: 46
Joined: Wed Jan 30, 2013 8:08 pm

Please be positive and constructive with your questions and comments.