I have a project to measure the the time taken for a slot car to travel between two sensors but i want the sensors to be fairly close together. At the moment i am using two time of flight laser sensors, which are 100mm apart.
What i have found out is that the laser 'pulses' every x milliseconds and the lowest i can set it to is 17ms. As the car can take 100ms (or whatever) to travel between the two sensors, the 17ms leads to a biggish +/- error.
So, what i am trying to understand if there is a more accurate method of catching the car passing a sensor, which is more 'asynchronous' or 'analogue', so that the sensor is tripped, perhaps, within 1ms.
So far, I haven't been able to find any information on how a laser or IR breakbeam sensor works, so I don't know if they or any other sensors would work better/faster. I don't really want to go the IR emitter/receptor sensor route, as they are very sensitive to light conditions and require constant adjustment.
I have the code working nicely, using interrupts to minimise any code delays, so finalising the sensor would make it ready to go!
Any suggestions or experience would be gratefully received.
Use an IR detector that is made for light gate applications. They will be more reliable if there is ambient light. It uses an emitter that constantly flashes at 38KHz (use the tone() function or the Tone library). The detector is only sensitive to 38KHz so ambient light is ignored.
Thanks for the quick replies and i will certainly look into these. What i didn't say in my post was the reason i like the ToF sensors (and no I'm not using it for ToF features) is that it doesn't require a partner device/receiver.
So, my solution, at the moment, is housed in one neat little box that just gets 'plonked' down beside the track with no need to have anything else set up.
Is that possible with any of these devices or is there another solution?
The break beam sensor is what you want, and you can count on microsecond accuracy. As you noticed, it does not fit in a single box, but it is what most people use.
If you use a modulated IR beam and receiver then this is not affected by ambient light very much at all. Especially if you fit an IR filter before your receiver, just like the Ir receiver on most of the world's TV sets.
There is a demodulator circuit for a modulated beam breaker it is in the TSOP IR sensors, one of which is set up to be a beam breaker circuit. The others are all for TV remote controls.
I don't know the actual number at the moment because I am away from my laptop. Confusingly TSOP is also the name of a case style for ICs.
OK! Lots to unpack here... Thank you all for your advice. I've been having a quick look at this and other devices and, if I understand it, there is nothing 'out the box' that I can use, other than my ToF (too slow) or a LIDAR device (too expensive).
Some devices (Sharp?) are either too slow or only work at very short ranges (<5 cm).
I don't want to use a device that requires a partner component set apart, so I think the only solution so far is the TSSP40 mentioned above? This still needs a partner device but it can be placed 'next door' separated by a screen but I would have to build it? Is that correct? What are the components i need, then and how do they all marry up? A lot of the technical spec is waaaaaaay over my head.
@connal
An other option no one has mentioned before is the use of an inductive proximity sensor along side the track. So just the single unit you say you want.
I hadn't thought of that but it looks like it needs to be really close to the track.
I feel I'm drip feeding you requirements here, for which i apologise, but the sensor needs to be a reasonable distance from the track (so the box doesn't get hit), so it probably needs to be 10cm minimum.
I have a feeling that I looked at this and thought there would be a problem with it. Having looked again, the only thing I can see is the 'sampling rate'. But i don't know what this means in this context, if this is analogue and therefore continuous light/detection.
Otherwise it seems to tick the boxes, with the exception of Leo's comment about a well defined position of the object. Not sure what this refers to but, if it helps, i don't really care about the distance being accurate, only that the device is triggered in the same way each time something passes it. Does that make a difference? Does that make sense?
I imagine that the reflection time of an object can vary with colour, angle, etc. This could get worse with distance. The breaking of a thin IR beam is very sharply defined.
I don't like linking to Instructables (usually bad advice), but did you see how this dude has embedded a beam break slot sensor in the track.
Leo..