I suspect it's not a trivial problem to solve -- you want the thing to work reliably. First, ask yourself if there are commercial detectors that solve the problem reliably on the market for any price. If the answer is yes, then that gives you a clue that the problem might be solvable. If the answer is no, then I'd be a bit concerned, as the technology to do such things has been around for 50-100 years and since there have been millions of farmers who plant things, such a device would be of obvious utility.
My engineering intuition worries about two problems. First, dust will collect and block optical paths, so that issue will need to be dealt with (it's compounded by electrostatic problems). Second, the detection problem depends on the diameter of the seed in relation to the diameter of the tube it's falling through and the diameter of the detector. It makes intuitive sense that you'd want the optical beam to take up most of the diameter of the tube (I'm imagining a transverse hole with a light on one side and a detector on the other). So then the issue is when a seed passes, it causes a blip in the optical signal; the electronics needs to detect this blip. All of this is doable and has been done thousands of times in other industries, but the devil is in the details and you'll need to sit down and do some experiments.
A good engineer would also look at other detection methods than just optical. For example, an electrostatic charge could be put on each seed, then that moving charge detected by a sensor. Of course, that opens an engineering can of worms with lots of other things to worry about. How about a mechanical device that is deflected by a passing seed? Some library research would uncover methods that have been used in other areas. Consider contacting some folks on the staff of an agricultural college or your local ag extension.
If you want more thinking from folks here, you'll have to define the problem better. What's the range of seed diameters, shapes, and masses? How big is the tube they have to fall through? What's the number of seeds per second? Engineering stuff like that...