A seed counting sensor for pneumatic seeding machines, said sensor comprising: - a detection chamber within a house, said detection chamber allowing the seeds to pass through the sensor and having a center axis extending in the flow direction of the seeds; - a plurality of light sources arranged within the house, outside the detection chamber, at predetermined distances from each other, said light sources being in a plane extending substantially perpendicularly to said center axis of the sensor, - a plurality of light detectors arranged within the house, outside the detection chamber at predetermined distances from each other, said light detectors being in the same plane as the light sources, - wherein said light sources and said light detectors are arranged in said plane so that they are capable of scanning substantially the entire cross section of said detection chamber, - a signal processing unit for controlling operation of the light sources and for processing the electronic signals produced by the light detectors, and - wherein the sensor further comprises optical masks arranged in front of the light sources and the light detectors, respectively, and made of a non-transparent material, characterized in that - the number of the light detectors equals to the number of the light sources, - each of said optical masks has a plurality of parallel channels opening into the detection chamber, wherein the number of the channels equals to at least the number of light sources or the light detectors, wherein the channels have smaller diameter than that of the optical lenses (241, 251) of the light sources and the light detectors, and wherein the optical lenses of the light sources and the light detectors closely fit to the outer ends of the channels, - wherein the light sources are separated from each other by non-transparent partitions, and - wherein the minimum length of the channels is dimensioned so that substantially the entire amount of the incident light received by a light detector is emitted by a light source arranged directly opposite thereto. - a detection chamber within a house, said detection chamber allowing the seeds to pass through the sensor and having a center axis extending in the flow direction of the seeds; - a plurality of light sources arranged within the house, outside the detection chamber, at predetermined distances from each other, said light sources being in a plane extending substantially perpendicularly to said center axis of the sensor, - a plurality of light detectors arranged within the house, outside the detection chamber at predetermined distances from each other, said light detectors being in the same plane as the light sources, - wherein said light sources and said light detectors are arranged in said plane so that they are capable of scanning substantially the entire cross section of said detection chamber, - a signal processing unit for controlling operation of the light sources and for processing the electronic signals produced by the light detectors, and - wherein the sensor further comprises optical masks arranged in front of the light sources and the light detectors, respectively, and made of a non-transparent material, characterized in that - the number of the light detectors equals to the number of the light sources, - each of said optical masks has a plurality of parallel channels opening into the detection chamber, wherein the number of the channels equals to at least the number of light sources or the light detectors, wherein the channels have smaller diameter than that of the optical lenses (241, 251) of the light sources and the light detectors, and wherein the optical lenses of the light sources and the light detectors closely fit to the outer ends of the channels, - wherein the light sources are separated from each other by non-transparent partitions, and - wherein the minimum length of the channels is dimensioned so that substantially the entire amount of the incident light received by a light detector is emitted by a light source arranged directly opposite thereto.