The seed sensor for pneumatic seeding machines comprises a detection chamber allowing the seeds to pass therethrough, said detection chamber having a central axis (211) extending substantially in the same direction as the flow direction of the seeds (102); a plurality of light sources (240) arranged on one side of the detection chamber at predetermined distances from each other along a line substantially perpendicular to the central axis (211) of the detection chamber; a plurality of light detectors arranged on the side of the detection chamber opposite to the light sources (240) at predetermined distances from each other along a line substantially perpendicular to the central axis (211) of the detection chamber, wherein the number of the light detectors equals to the number of the light sources; and a signal processing unit for controlling operation of the light sources and for processing the signals of the light detectors. The sensor further comprises an optical mask (230) arranged in front of the light sources (240) and the light detectors and made of a non-transparent material, said optical mask having 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 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. The light sources (240) are separated from each other by non-transparent partitions, and the minimum length of the channels is defined so that each light detector can detect the light of substantially one light source (240) arranged directly opposite thereto.