IR LED's or PhotoSensor or what

OK getting ready to start my project. Well I'm going to have balls rolling down this clear tubing I want every time one passes to add it to a count and display how many go by onto a LED Board.

Parts list I have

Arduino mega 2560

Red Common Anode 4-Segment Digital Tube Display For Arduino UNO from ebay

the two pack infrared led transmitter and receiver from radioshack.

clear tubing for the balls to roll down into their container.

These may be coming down kinda fast. like 5balls/sec.

I am new to the arduino but have some java and html experience. So I'm not ignorant to coding all together.

I just want to know, are these even going to be able to keep up with roughly 5/s and is infrared the way to go or does anyone have any other ideas. Oh and point me towards a tutorial that might give me a little help too, that would be nice.

like the garage door things that keep from killing kids. When the stream is broken it goes back up. I just want mine to add +1 to my LED board....

What are the balls made of? Metal balls could just make a momentary contact, iron or steel balls could be detected magnetically. Your Arduino can certainly detect events less than 200 milliseconds apart (= 5+ per second).

That would be nice No metallic properties to them them of them like an airsoft bb

skylerdprahl: That would be nice No metallic properties to them them of them like an airsoft bb

As I've no idea what an airsoft bb is, or is made of, I'm sorry I can't help.

yes it should be possible.

One approach would be to use a TSOP4038 or TSOP58038 light barrier IR receiver & TSAL6100 IR LED (or equivalents)

They would have to facing each other across a diameter of the tube (barrel?), using a modulated pulse of 500 -> 1000 uSecs

Would need to know a bit more like velocity, indoors/outdoors/level of ambient light, tube, mounting etc there could be pitfalls.

You will need to do the maths to see if the pulse rate is fast enough to capture a sphere of circa 6mm @ velocity X?

Otherwise, you could look at a plain IR emmitter & IR sensor, with no modulation, which may be better & simpler overall, subject to the questions above. (there should be circuits available similar to finger pulse detectors)

there are other possibilities.....but...more details are required

The expert has spoken (post above) but in general, it comes down to how you make it immune to ambient light.

A photo-interrupter of suitable calibre would do the job but you would need to enclose it to keep out ambient light. This can detect not just five objects per second (extremely slow in computer terms), but five thousand or more! If you wish to have the whole of the tube visible, then you will need the ability to ignore ambient light by using modulation on the IR LEDs and detectors that discern that modulation, which slows down the response a little.