I am looking for a way to detect an airsoft bb with an IR photo gate. Attached is the picture of the bags that the IR emitter and detectors came in. OK my BBs are traveling at 400FPS which converts to 121.92meter per second or 121920 millimeters per second. That means that a 6mm BB takes .00295 of one second to pass through the photo gate. I am not able to detect the passage of the BB, but I can detect the passage of a small piece of wire flicked quickly through the beam. I can't figure out how to make it faster. I am using an Arduino Micro. Is there another way to detect a high speed object. Different sensor, different Arduino. I welcome your thoughts.
Here is my code.
/*
* bb counter test
* to make the IR gate act as fast as possible
*
*/
const int detectD = 2;
const int LED=13;
void setup() {
pinMode(detectD, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(detectD), increment, RISING);
pinMode(LED, OUTPUT);
}
void loop() {
//nothing here to slow anything down
}
void increment()
{
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
delay(500);
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
}