Hi I'm doing a project at university whereby I have to electronically differentiate between a tennis ball and an orange hi-vis golf ball. I have chosen to sense by colour which has led me into the world of Arduino, something I've been waiting to have an excuse for actually! To sense the colour of the tennis ball I will be shining green led's onto it and then measuring the intensity of the reflected light with a Taos TSL230RD (outputs a square wave that varies with light intensity) which is behind a green filter. However I would like a line of these sensors as to gain a large sensing area which could be swept over the balls. I have become familiar with pulseIn but I worry that as I can only do one pulseIn at a time I may miss some tennis balls that go past inactive sensors. I have since looked into measuring frequency with interrupts and have successfully written code to work one sensor but I'm starting to get a little confused how to take that any further. Ideally I would like to measure the frequency of 15 of the sensors, if needs be with multiple arduinos. Could you please share your thoughts as to the best route to take or even a completely different method if you think! Thankyou
Current inspiration : http://docs-europe.electrocomponents.com/webdocs/0892/0900766b80892a9b.pdf
http://www.avdweb.nl/arduino/hardware-interfacing/frequency-period-counter.html
http://bildr.org/2011/09/tsl230r-arduino/
http://dronecolony.com/2008/11/13/arduino-and-the-taos-tsl230r-light-sensor-getting-started/
what is the frequency range of the square wave?
guymalpass:
I have chosen to sense by colour which has led me into the world of Arduino
I don't understand why that has led you to Arduino. Using colour to differentiate between them makes perfect sense and seems to be the intention of the assignment, but why don't you just point a camera at them and use image processing to determine which one(s) are in the field of view?
In the conditions I plan to operate the sensors, between 40 and 60 kHz.
Camera (machine vision) was my first port of call but without spending some decent money on a camera I can't get it to sense fast enough.
I should elaborate that the sensors will be moving past stationary balls and the faster I travel past and still successfully sense the balls the better.
guymalpass:
I should elaborate that the sensors will be moving past stationary balls and the faster I travel past and still successfully sense the balls the better.
Can you give more details about the physical arrangement of the sensor and target, and the relative movement between them? Are they really moving too fast to grab a frame from a decent quality web cam?
guymalpass:
In the conditions I plan to operate the sensors, between 40 and 60 kHz.
I read the datasheet wrong, at saturation this will put out a 550kHz square wave.
PeterH:
Can you give more details about the physical arrangement of the sensor and target, and the relative movement between them? Are they really moving too fast to grab a frame from a decent quality web cam?
The tennis and golf balls will be about 1m apart in a line on the floor and the sensor will pass over the top of them. I would like to travel at at least 1m/s something I can easily achieve with these sensors but have struggled with using a webcam. I used a program called roborealm to specify the correct colour and then blob size to get accurate detections. I've read that background subtraction can be very fast but my background will also be constantly moving.
guymalpass:
The tennis and golf balls will be about 1m apart in a line on the floor and the sensor will pass over the top of them. I would like to travel at at least 1m/s something I can easily achieve with these sensors but have struggled with using a webcam. I used a program called roborealm to specify the correct colour and then blob size to get accurate detections. I've read that background subtraction can be very fast but my background will also be constantly moving.
Paper on machine vision I found very useful: http://ecommons.usask.ca/bitstream/handle/10388/etd-08302006-125935/thesis_Jinzi_Mao.pdf?sequence=1
guymalpass:
The tennis and golf balls will be about 1m apart in a line on the floor and the sensor will pass over the top of them. I would like to travel at at least 1m/s something I can easily achieve with these sensors but have struggled with using a webcam.
That doesn't sound like a very demanding set of requirements - I'd have thought you could solve that without too much difficulty using something like opencv. Given that you're only really trying to detect blobs in one of two colours, I would have thought that a simple colour reduction followed by blob detection would do the trick. I assume you would capture a few representative video sequences and run them through your software to test it while you're playing with the algorithms.