Folks,
I've made a lap counter for a 1:32 slot car track. The lap is counted as the car passes over a photoresistor that is illuminated from above. As the car's shadow passes over it, the lap is counted.
My prototype works on the bench, but once on the track, I've found that the race speeds of the cars are so fast, the lap isn't being counted. I have tinkered with the sensitivities and used Serial.print on the mapped voltages. It seems that there is nearly no change when the resistors are in shadow for only an instant.
POSSIBLE ISSUES:
Could this be a logic problem? That is my code is too bulky and not Analog reading the resistors frequently enough.
Is it a hardware problem? Have I just bumped up against the speed limit of my photoresistors?
Is it a knowledge problem? I'm new. I've used analog.read to get the voltage then the map() function to get trigger values to count the lap.
I have made a slot car lap counter, using an IR LED and an IR sensitive phototransistor - this works nicely, actually cut into the track from below so the guide rail cuts the beam - means a bit of modification to the track but it doesn't need a gantry overhead, so far has proven very reliable.
this is fed in via a digital pin (not even using interrupts, just reading on each cycle and checking for changes as I needed more sensors than I had interrupt pins) driving on an interrupt for two lanes from an Uno or Nano would work very nicely though.
sensor hardware is an IR LED & resistor, plus the IR phototransistor and a 10k resistor, its fast enough for guide blade detection (go 1k and its fast enough for scalextric digital car decoding)
thread at Lap Counter/Timer project | SlotForum covers the hardware and software side, overkill for just lap counting but its so easy to add in lap timing I thought why not?