Method for operating a vending machine with at least one article storage unit (A1, 5) configured as a lead screw, in which a plurality of individual articles (A2, 4) are stored, wherein the vending machine comprises a control unit and at least one optical sensor, - wherein the optical sensor records image data of the at least one article storage unit (A1, 5) and of the plurality of individual articles (A2, 4) located therein, - wherein a brightness curve (A3, 30) with brightness minima (A5, 31) and brightness maxima (A4, 32) is respectively calculated by the control unit from the image data of an article storage unit (A1, 5) of the optical sensor, - wherein the control unit determines the number of articles (A2, 4) located in an article storage unit (A1, 5) from the number of brightness minima (A5, 31) of a brightness curve (A3, 30), - and wherein the control unit identifies gaps between the individual articles (A2, 4) from the brightness maxima (A4, 32), and wherein at least one light source is used, which emits UV light with a predetermined first wavelength (λ1) of a predetermined first wavelength range (λ10), and wherein the article storage unit (A1, 5) comprises a layer with fluorescent properties which emits light with a predetermined second wavelength (λ2) within a predetermined second wavelength range (λ20), and wherein a filter device is used for the optical sensor, by means of which only light of the predetermined second wavelength range (λ20) is captured by the sensor, and wherein the optical sensor records image data of a profile in the longitudinal direction of the at least one article storage unit (A1, 5) and of the articles (A2, 4) located therein, and wherein the brightness curves (A3, 30) calculated by the control unit exhibit a pulse-shaped progression with a digital character. - wherein the optical sensor records image data of the at least one article storage unit (A1, 5) and of the plurality of individual articles (A2, 4) located therein, - wherein a brightness curve (A3, 30) with brightness minima (A5, 31) and brightness maxima (A4, 32) is respectively calculated by the control unit from the image data of an article storage unit (A1, 5) of the optical sensor, - wherein the control unit determines the number of articles (A2, 4) located in an article storage unit (A1, 5) from the number of brightness minima (A5, 31) of a brightness curve (A3, 30), - and wherein the control unit identifies gaps between the individual articles (A2, 4) from the brightness maxima (A4, 32), at least one light source is used, which emits UV light with a predetermined first wavelength (λ1) of a predetermined first wavelength range (λ10), and wherein the article storage unit (A1, 5) comprises a layer with fluorescent properties which emits light with a predetermined second wavelength (λ2) within a predetermined second wavelength range (λ20), and wherein a filter device is used for the optical sensor, by means of which only light of the predetermined second wavelength range (λ20) is captured by the sensor, and wherein the optical sensor records image data of a profile in the longitudinal direction of the at least one article storage unit (A1, 5) and of the articles (A2, 4) located therein, and wherein the brightness curves (A3, 30) calculated by the control unit exhibit a pulse-shaped progression with a digital character.