i'm building a shot counter circuit for my airsoft gun controlled by an ATtiny26L MCU, where the shots are detected by an infrared diode + phototransistor couple. The PT outputs positive signal when it's triggered by the IR LED, which goes into a PNP transistor to invert the signal and then I have an electrolytic 1uF cap to lengthen the pulse, a 100k pull down resistor (initially there was a 1k), and a 1k resistor to regulate the output current to lenthen the cap's output:
The circuit works flawlessly when I block the IR diody by hand or drop a BB through the detector. However if I shoot a BB through it doesn't detect it.
The shot BBs trigger the detector for around 70 microseconds and if i'm correct there shouldn't be any trouble with a such big cap as 1uF lengthening the pulse, but maybe i'm doing something wrong? Or perhaps the phototransistor won't get triggered in such small time?
Also my MCU runs at 1MHz.
I'm glad to hear any tips.