I'm trying to build a simple system to detect the presence of a object passing across several sensors.
The idea is if you have a straight piece of wood and roll a ball (for example) down you could have multiple sensors gauging it's progress down the path.
I had a bash with a hall effect and I found it to be a bit flaky with the obvious hindered of a magnet being required. My second thought would be to use trip sensors (led + photo resistor) but that requires a certain level of installation precision - something that would go out of alignment almost immediately.
I finally thought maybe a simple IR + detector sitting on a vera may do the trick? If a box shaped object passed in front of the detector, the short range would reflect the light triggering the sensor.
Would that work? Can anyone suggest an IR/Receiver pair from Farnell in the UK?
My only concern is it would potentially give a lot of infra-red "noise". Each sensor only needs to operate within an inch (2.5cm). I'd considered a PIR or ranger but they are both massively expensive. Potentially I'd end up with quite a few of these so I'd like to keep the price down to a few bucks per sensor.
The range might be a tad less than what you have in mind, but something like this sensor may be what you need.
To avoid noise problems,you could use a trick like they do for consumer IR remotes: modulate the LED, and only respond to inputs of approximately the right frequency.
Since consumer IR receivers are available fairly cheaply on the surplus market, you might make your own version of that Fairchild sensor by getting a compatible IRLED and modulating it with, say, a 555 timer. Then you can get the noise rejection more cheaply than you could by building your own circuit.
That looks pretty much spot on, the only concern is the .2" sensativity. I think that's probably too short a distance. I need a level of clearance so I can detect different sorts of objects.
That's a good idea in reference to changing the frequency. Though if the sensitivity is already < 1" then noise probably wouldn't be a major issue.
Do you know of a similar IC which has a slightly longer range
My second thought would be to use trip sensors (led + photo resistor) but that requires a certain level of installation precision - something that would go out of alignment almost immediately.
Back to your trip sensor idea, this sensor from forum member GlacialWanderer has enough precision to handle speeding bullets. The best part of his blog entry is that the hardware and software for the project are shared under the Creative Commons Attribution 3.0 License. He includes a simple schematic and a parts list for inexpensive parts if you want to just make this on your own with veroboard.
Though if the sensitivity is already < 1" then noise probably wouldn't be a major issue.
That only refers to how sensitive it is to the signal from its own emitter: i.e., if the object is more than aoubt 1/4" away, most of the light will be reflected to an area outside the sensor diode. The sensor will still pick up ambient noise if there's no object blocking its view, so you still need to protect against it. E.g., by modulating the emitter so a flashlight beam falling on the sensor won't be incorrectly seen as a reflection from a passing object (not as big a problem as it used to be, now that everyone is switching from incandescent to LED flashlights, but still something you need to worry about: after all, you don't want to build systems that will fail as global warming increases ambient heat ;D).
There might be other such sensors out there, but I'm not aware of them. However, I only know about these because I used to work with mainframes, and this particular kind of sensor was used in mag tape drives, so there's probably quite a lot out there that I don't know about.
Hey Tba, that looks dammed impressive! I'm quite suprised he was able to get the response time required.
Trip would work but I'd need some kind of stucture to hold it secure. My "run way" is about 2.2" wide, I'm not sure if you can suggest a decent support?
I'm somewhat down on supplies living in a small flat in London so I usually suck it up and buy COTS hardware.
Going back to the line sensor I was shown earlier. I do wonder how that would respond to dark colours. Most of the stuff I'm tracking is "oddly shaped" and quite dark. Could be a problem for pir based sensors.
I'm not sure if you can suggest a decent support?
Well, I'm the kind of guy who would just screw or hot-glue a wide piece of veroboard to the bottom of the wood ramp.
It depends on what level of professionalism you want to achieve. Unless your "targets" are unusually heavy or would cause a lot of vibration, some sturdy brackets ought to keep the sensors in alignment well enough.
An IR LED and photodetector pair should do the trick pretty well and they can work up to about 15cm without too many issues and are ok with a little misalignment (if the LED has a decent emission angle)
Can you suggest a decent IC pair? I'll probably pick it up from Farnell
Are you thinking of a reflectance or a gate pair?
I can recommend a gate pair if you want. Just let me find it...
Here you go:
The IR led is up to your own choice from farnell[/edit]
Either or, I've not tried these kind of sensors before
Thise ones just require a 5v-sensor-resistor-ground and then an analog read from after the sensor but before the resistor. You will need a relatively big resistor. I'm using a 100K variable for testing on my circuit and it is not big enough.
That's quite high!
Pretty cheap though. I may just throw 10 quid at a couple of different types and see how we go. Could be quite interesting.
It's a shame localization is so difficult and there's nothing you can just get off the shelf.
Side note Mow, you're a young(ish) lad. What do you study?
If you go with the break-a-light-beam answer, line the LED/sensors up carefully to be "hit" by the ball at it's widest point, to get accurate timings.
Use metal ball bearings, and copper contacts on your track are all you need.
Or, instead of balls down a groove, buy a few sections of model railway track and a car with metal wheels. (Mount the track sections with tiny gaps.)
Or, if your ball is heavy, low torque micro-switches would do.
For an elegant solution, which might not be very tolerant of what sort of ball is rolling, consider a reflective sensor....
... an LED and light detector mounted in one neat package such that when something is close, light from the LED bounces off the close object and stimulates the detector.
I made such a device years ago, and made it more complicated than it needed to be. I wired each detector to its own input on the computer. One input will do, wire the detectors to it in parallel.
I'm using a 100K variable for testing on my circuit and it is not big enough.
That's quite high!
Well it's high enough to get a difference and do an analog read but I want the difference around 512 so I can do a digital read from any pin.
They are pretty cheap and seem to work pretty well. I get an analog read difference of about 200 (from open to blocked) at a distance of roughly 10cm.
What sensor are you using? It should be simple to connect it more or less directly to a digital input. The digital input would be read more quickly, I think (anyone care to comment?) than one of the analog inputs, thus giving you more accurate timing. And converting the sensor's output to a digital signal will make it easier to connect all the sensors to one Arduino pin, which will have other benefits.
The beauty of this application is precision isn't required. It purely needs to be a digital response "Present or absent". I think realistically I need about 10mm range with 2.5cm being ideal.