What sensor to use?

My team want to be able to detect when balls are in our collection system and at different points in it. We think we want to use a sensor like the one in garage doors that trip if there is an obstruction. I don’t know a lot about electronics or sensors, so I am having a difficult time looking for a sensor that will fulfill this purpose and be relatively easy for our electronics and programming team to integrate into our system. Right now, I found the photo sensors on Andymark http://www.andymark.com/RightSight-photoelectric-sensor-fc12-57-p/fc12-57.htm

Will this work or are there better options to suit my needs?

edit: these sensors look a lot like the line sensors last year, but I can’t tell if they are the same. Are they?

Additionally, we will want to use a range finder to help target the basketball hoops with the shooter. I assume this would work best as a laser, but past that, I have no idea where to start looking for this. We could use the sonar sensor, but I’m not sure if this has enough range.

Photosensors only detect changes in the reflected color they see, an arrangement of 3 is what allowed you to track a line. A single photosensor can detect when a ball passes by it.

As for a rangefinder, you would want to look into a ultrasonic sensor, most have either instructions on how to determine the actual range or the code used to initialize it will get it for you.

Anything using a laser (other than class I lasers) are specifically restricted by rule R08. (Don’t forget to read the blue box!)

The best sensor to detect a ball is a “through beam” sensor. This generally requires an Emitter and a Receiver pair. When these two sensors are matched up, they look at each other, like the sensors at the bottom of your garage door. They don’t care about the surface reflection of the part you are trying to detect.

A sample of through beam sensors can be seen here:
http://www.automationdirect.com/adc/Shopping/Catalog/Sensors_-z-Encoders/Photoelectric_Sensors/DC_Rectangular(QX-z-CX-z-FE_Series)/Through_Beam_(QX-z-CX-z-FE_Series)

A basic sensor for detecting balls can be made from a photoresitor and a laser (class one of course). Aim the laser at the photoresistor. The analog input from the photoresistor should be a high value. When the laser is not shining on the photoresistor, the value should drop.

A short range Panasonic IR distance sensor would work. They come in on-off and distance sensing analog voltage.

Banner Engineering (ex: http://www.bannerengineering.com/en-US/products/8/Sensors/23/Compact-Photoelectric-Sensors/143/WORLD-BEAM-QS18-Series/) makes this type of sensor as well.

You have a number of options. As Chris said, an EMITTER/RECEIVER pair generally is the most robust to different ranges, reflectances, etc. However, it requires two separate parts and (generally) ends up being more costly than other options. You also need to make sure the beam stays aligned (mount them rigidly!).

Another option is using retroreflectors, like the tape used on the vision target this year. You put a sensor on one side of the ball path and the reflective tape on the other. When no ball is present, the sensor sees its reflection. When one passes through, the ball (hopefully) is not reflective enough for the sensor to see it’s beam. This only works if the ball is sufficiently more diffuse than the retroreflector; this type of sensor generally comes with a knob to tune the sensitivity to obtain the desired response. You generally also want to mount your sensor a bit further from the ball in this case.

A final option is using a diffuse sensor. Basically, your sensor shoots off into open space when no ball is present. When a ball is present, it sees its reflection off of the ball. As before, this requires some tuning to get working perfectly.

I have worked with all three configurations in FIRST, and generally they can all work. The latter two options simply require some testing and tuning to get working well.

In a pinch you could probably get away with a properly-mounted limit switch, too.

At Radio Shack you can find a IR LED and Photo sensor pair for under $4. We used one on our Breakaway robot to detect when we had a ball. The key we found to ensure that the sensor didn’t pickup stray signals was to mount it recessed in a hole so it wouldn’t pickup ambient light and to make sure the emitter was aimed directly at it. Here is the page http://www.radioshack.com/product/index.jsp?productId=2049723 and the part number 276-142 it is listed as “This item is available at most stores” and does show up at the tiny store out in my neck of the woods.

Thanks to everyone who gave suggestions. I’ll let you know what we choose and how well it works. Right now it looks as if we will try last year’s photo sensors, but I’ll see if we can try out a few other options.

The sensor you suggest outputs in an oscillating wave pattern; it outputs ON for 600 μs and then OFF for 600 μs. Any tips/tricks/fancy hacks for writing code to detect such a pattern and discern it from a long OFF period?

I believe you are misreading the datasheet. Those values are the response time between detecting an object’s presence/absence and changing the output signal. You should be able to treat the sensor as a simple switch.

Interesting. I hooked the sensor up to a 'scope today and observed a sinusoidal waveform when an object was present. But if others have had success with treating this thing as a simple switch, I will give it a shot!

I’m guessing you were looking at the black output wire of a QS18VN part, and that you didn’t have a pullup resistor connected to it. That output will be pulled to ground when no object is present, and it will float when an object is detected. You were likely seeing ambient 60 Hz noise being picked up by the wire.

Yes that does indeed make more sense. Now that I think about it, even if it were pulsing HIGH/LOW signals, it would have formed a square wave, not the analog sinusoidal wave that I observed.

in the last couple years we have gotten photoelectric sensors in our KOP so look around for them they are in half clear and half white bags

Our team (4183) is using limit switches. If properly mounted, they should work fine.

using two limit switches you can use the collector system to hold the balls in the rollers till needed.