I won't use Windoze for a lap counter and a laptop is too big. Also I find coding Arduino fun.
Who doesn't!
You may find this topic interesting
Thank you @jim-p, I see that a phototransistors can be wired directly into digital inputs with a digital interrupt.
I see the elegance in that as well as the battery savings.
I will see how well my trap speed detector logic works. I believe the digital input would remove that functionality.
@jim-p you mentioned: So for a car that is 5" long, it would break the beam for 50ms
Actually the cars are 2.5 inches long being "HO" slot cars, we have 25 ms.
The response time of these LDR cells is rather slow at 30ms.
- Model: GL 5506
- Light Resistance: 5 – 10 Kilo Ohms
- Dark Resistance: 0.5 Mega Ohms
- Max Voltage: 150 V
- Max Power Consumption: 90 mW
- Spectral Peak: 540 nm
- Response Time Up: 30 ms
- Response Time Down: 30 ms
- Operating Temperature: -30⁰C ~ +70⁰C
- Dimensions: 4.3mm x 5.1mm x 2.1 mm
- Generally, an LDR has about 30ms rise time as a reasonable value, 5-10ms fall time is more reasonable.
I have LED lighting in the house. I think think it may be older lighting at that. When I record in slow mo with my phone, can see the strobe effect.
With LDR being so slow, that strobing light won't be a problem.
But when I get my photodiodes, will I get false triggers every 60 times a second due to flickering lights?
Someone mentioned that better/new household lighting is at 120hz, they simply have LEDs wired both ways positively and negatively, would that be better room lighting?
That is one of the reasons for buying IR phototransistors.
Wouldn't phototransistors also have react to flickering overhead lights?
Oh boy, the plot thickens, there are two wire and 3 wire phototransistors. I thought all transistors were 3 wire...
Very interesting, just buy tweaking the wiring, with phototransistors, you can sense when the car breaks the beam or enters the beam? So this choice would affect when the digital interrupt fires.
Can choose to trigger the interrupt on a rising edge, falling edge, either edge, or when the signal is low, depending on specific requirements.
A disadvantage is that I must tune the trigger with a resistor and a constant light source via a gantry.
However by having an interrupt triggered on either edge, I could determine the transit time efficiently for trap speed.
With an analog input, it can self tune to some extent. Currently in my program, I sample the sensor on startup. I might get away without having a gantry?
So engineering trade offs.
Depends on the intensity of the light. IR photodiodes are used because most indoor lighting does not contain much energy in the IR region. The black colored phototransistors actually filter out most ambient light and are only sensitive to IR.
See post #95 in the topic I linked