If my calculations are correct the time the sensor "sees" the projetile is about 100 us. (400 fps ~ 5000 inches per second -> 0.5 inch is 1/10,000 of second). That is very fast for a phototransistor. Morover the output of the detector is probably in saturation slowing it even further. I would try circuit like this to prevent the saturation:
EDIT: See better schematic in my next post.
When the detector wants to pull to GND it will also pull Base of Q1 to GND and reduce current in D1. This way the LED current should be controled to be as low as possible.
For first testing drive the IR LED by Arduino pin - another Arduino if possible running some simple sketch. Let it turn off the LED for 100 us and look how the detector responds. You may trigger the scope by the LED drive (if it has 2 channels) simplifying everything greatly.
And forget interrupts. I don't think they can bring anything useful, just complicate this.
Very difficult to select appropriate components without knowing more details of your project and what the anticipated max speed of the projectile would be. Who knows, your existing components might work just fine.
Extracting the best performance ...
Alignment:
From the technical details, we have: Transmitter/Receiver LED Angle: 10°
The beam angle is the viewing angle at which you get only 50% response. 10° isn't very much for misalignment, so align both receiver and emitter precisely.
I dont understand - the LOW pulse from the diode - at around 100usec - connected via an RC filter RSmallC1 is much too fast to change the transistors base voltage as the time constant is 10msec.
I like the idea of using a driven emitter to produce a controllable pulse width for testing; I have a battery driven 555 in a box driving an LED to produce light pulses with a controllable frequency and duration set by pots, but an arduino output would do just as well.
How to detect a negative edge without polling?
@dlloyd - i dont see a reference for the graph, but its similar to the bpv11
Its certainly worth trying a smaller resistor to get a faster response, which from the graph you SHOULD get;
however with no data sheet you are working in the dark (sorry I had to)
IR_LED_Drive is what I propose to drive for testing by Arduino (or '555 or any other device that can produce short pulses with very low duty). In "mature" project it will be permanently connected to 5V. There the Arduino will be able to turn off the IR LED despite the R3 - C1 low pass filter.
Detector_Output cannot go to less than about 0.7 V (for long). If it does Q1 reduces the LED current, preventing saturation of the detector. 0.7 V is low enough to be reliably detected as LOW by Arduino.
I would use polling. As I understand it the program can be quite simple
Trigger the projectile
Wait for 1st beam to be interrupted and remember the time
Wait for 2nd beam to be interrupted and remember the time
...
x. Wait for last beam and remember the time
x+1. Report data collected and prepare for another projetile.
Plus add some timeout if some of the events are missed.
I don't see any benefit in using interrupts there. If us precision is required using something as the Input Capture feature of Timer1 on Arduino Uno may be used.
Ahh, but to illuminate, there are some tools at our disposal ... camera viewfinder and "IR googles". I used IR googles (digiKey's database and query system).
From the first post the link gives this specification:
Power Voltage: 3.3 - 5.5VDC
Emitter Current Draw: 10mA @ 3.3V, 20mA @ 5V
Output Current Capability of receiver: 100mA sink
Transmitter/Receiver LED Angle: 10°
Response Time: <2 ms
In DigiKey, I got the Radiation Characteristics graph by searching for all infrared emitters, then narrowing the search to those with 10° led angle. It was taken from the OHF03594 datasheet. The photo transistor response was taken from a component with specified 2ms response and 100mA max collector current.
Regarding the photo transistor response, note that this is normally specified (in photo transistor, opto isolator datasheets and others) while using a low value for R load so they can determine and advertise the max response.
I think the graphs would be very close to the charateristics of the actual part used.