Using IR sensor/transmitter for slotcar detection

It's a challenge to read through >400 posts to dig out pertinent information but is it a fact that the output of the phototransistor circuit has never been examined with and oscilloscope? Software debouncing is always an option but is it not worth trying conditioning the signal a little in hardware with a Schmitt trigger? Obviously one might have to change the logic of the interrupt trigger. Since the signal of interest relies on covering the sensor up with an object that is not an ideal shutter, maybe there is more signal level variation than imagined.

Post #399: The shortest car is actually 116 mm.

The topspeed of the 1:1 Alfa 33 (my fastes model) was 330Km/h, I can't find any record of the 1:32 slotcar ever being recorded, but I'll keep looking.

On 23 june 2018, a measurement was done over 165 ft of Scalextric track, the same bumpy stuff I have...

The car used was a Scalextric 1:32 car, which in general are not bad, but usually too heavy to be competative, other than in a field of similar Scalextric cars.

This time, with a time of 3.017 seconds over 165ft (1/32 of a mile) the speed reached was 1193.28 scale mph (1920.40 scale kph) which equals to 37.29mph (60 kph)

The video shows an over 76 m long straight, which is slightly longer that the straights I have available, but todays Slot.it cars are lighter and using similar motors than the Scalextric cars in the test, in general quicker, both in accelerating and topspeed.

So I think it's safe to say my quickest car travels under the gantry at 40 - 50 kph and is still accelerating at the point where I have to brake for the next corner.

Then set this minimum pulse width to 8ms.
If that does not help then we will have to go to a more complicated hardware solution. Buying more parts and building a circuit on a protoboard.

Will do and report back.

As I thought 40-50 kph would be a bit optimistic on my short track, I set the minimum pulse width to 10ms.

This goes well, most of the times; occasionally there's a lap timer missing, which translates into a very 'slow' next laptime, with two lap times added.

Next to that there's also the 'fake' laptimes which were not driven but computer generated, alsway quicker than the fastest lap sofar.

I tested this by running similar laptimes to the drone, which consistantly laps around the 7.44 - 7,65 sec mark. Even if I stay behind the drone for the duration of the test, eventualy a 'CGL' pops up on the display, showing 6.10 sec, for example, a laptime I can't drive, or improve on.
When I try to do that, I get to 6,14 at best, only to be discouraged by the next CGL which drops down to 6.01, a laptime even more impossible to drive for me...

I lowered the minimum pulse width to 9ms and will see what happens.

I'm sure if I was there with an oscilloscope I could diagnose the problem in a few seconds but since that isn't going to happen, all we can do is try to eliminate the problem by trial and error.

The next step is going to involve changing the phototransistor circuit

Going down to 9 ms only caused one or two missed detections in 100 laps, as far as I could see.
I made a video showing what happened.

Either I had a very good lap of 6.14 sec, or it coincided with a glitch, but I never got closer than 6.18 sec in those hundred laps.

Going down to 8 ms and test again.

I can see if a friend owns a scope, which I could borrow, to measure whatever it is you want measured.

It won't make a difference.
Do you know how to use a scope?

No, but I would get the operator to come with it, to do the measurements for me.

It could be an all day affair with he scope and from his point on I could only spare a few hours here and there to work with you

No problem, it's a hobby after all and; at some point my wife will want the spare bedroom back into it's original state...

Bring on the changes the phototransistor circuit.

Well it was interesting that no false readings occured when you had the emitters disconnected.
Can you try that test one more time?
Do a few laps for both lanes just to get some times on the display and then disconnect the power to the emitters and run a bunch of laps and see what happens

I'll do that in a minute.
Mind you, when I disconnect the power to the emitters, nothing happens on the display anymore. There may be readings, but they don't show on the display any more.
But, I'm off to test that.

The 8ms version didn't wast any time and ignored right away the first lap that should be measured.
Oddly enough it was the lane where the drone car runs it's laps consistantly around the 7 seconds mark, not the lane with the chaser car.

I didn't have a camera running this session, but it appeared to me this setting caused more timing errors than the previous ones.
Maximum was three laps not timed, followed by the next lap around 26 seconds, the accumulation of 4 laps...

And ofcourse the infamous CGL that could not be beaten if my life depended on it.

At one point, the 5.98 sec CGL remained fastest lap on the display for a dozen laps and than made room for a 6.21 sec lap, that I actually did drive...

After you run the test and if you don't have any glitches, we can try a change the phototransistor circuit.
Basically I just switched the position of the Photo and the resistor.
A new Revision F code will work with it.
elapsed_time-F.ino (6.8 KB)

photo

If there were reading then they would be do to glitches/noise

Emitters on: Laps and times are shown on the display.
Emitters off: the last shown laps and times remain on the display, no further action.
Emitters on again: Laps and times are shown again starting with a looong laptime for the duration of the emitters being off, as the timer kept running.

I'll change the phototransistor wiring.

And use the new program (version F)
The thinking is:
The output from the phototransistor circuit is in the HIGH state (near 5V) when the emitters are off and if you don't get glitches then maybe it is better to have the phototransistor circuit be HIGH all the time and go low when the car goes by.
The new circuit will do that.

Not being able to see which one is the short leg (or flat side of the photodiode), I strongly suspect I wired the phototransistors the wrong way around.
The display stays blue and I measure no Voltage over the sensors.
No READY on the display, or the Serial monitor, for that matter.

Don't you know which leg your original circuit was wired to?